Rev 319 | Rev 329 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 319 | Rev 324 | ||
---|---|---|---|
Line 32... | Line 32... | ||
32 | #include <arch.h> |
32 | #include <arch.h> |
33 | 33 | ||
34 | #include <arch/cp0.h> |
34 | #include <arch/cp0.h> |
35 | 35 | ||
36 | #include <typedefs.h> |
36 | #include <typedefs.h> |
37 | #include <print.h> |
37 | #include <print.h> |
38 | 38 | ||
39 | struct { |
39 | struct data_t { |
40 | char *vendor; |
40 | char *vendor; |
41 | char *model; |
41 | char *model; |
- | 42 | }; |
|
- | 43 | ||
42 | } imp_data[] = { |
44 | static struct data_t imp_data[] = { |
43 | { "Invalid", "Invalid" }, /* 0x00 */ |
45 | { "Invalid", "Invalid" }, /* 0x00 */ |
44 | { "MIPS", "R2000" }, /* 0x01 */ |
46 | { "MIPS", "R2000" }, /* 0x01 */ |
45 | { "MIPS", "R3000" }, /* 0x02 */ |
47 | { "MIPS", "R3000" }, /* 0x02 */ |
46 | { "MIPS", "R6000" }, /* 0x03 */ |
48 | { "MIPS", "R6000" }, /* 0x03 */ |
47 | { "MIPS", " R4000/R4400" }, /* 0x04 */ |
49 | { "MIPS", " R4000/R4400" }, /* 0x04 */ |
Line 76... | Line 78... | ||
76 | { "Sony", "R3000" }, /* 0x21 */ |
78 | { "Sony", "R3000" }, /* 0x21 */ |
77 | { "Toshiba", "R3000" }, /* 0x22 */ |
79 | { "Toshiba", "R3000" }, /* 0x22 */ |
78 | { "NKK", "R3000" } /* 0x23 */ |
80 | { "NKK", "R3000" } /* 0x23 */ |
79 | }; |
81 | }; |
80 | 82 | ||
- | 83 | static struct data_t imp_data80[] = { |
|
- | 84 | { "MIPS", "4Kc" }, /* 0x80 */ |
|
- | 85 | {"Invalid","Invalid"}, /* 0x81 */ |
|
- | 86 | {"Invalid","Invalid"}, /* 0x82 */ |
|
- | 87 | {"MIPS","4Km & 4Kp"} /* 0x83 */ |
|
- | 88 | }; |
|
- | 89 | ||
81 | void cpu_arch_init(void) |
90 | void cpu_arch_init(void) |
82 | { |
91 | { |
83 | } |
92 | } |
84 | 93 | ||
85 | void cpu_identify(void) |
94 | void cpu_identify(void) |
Line 88... | Line 97... | ||
88 | CPU->arch.imp_num = (cp0_prid_read() >> 8) & 0xff; |
97 | CPU->arch.imp_num = (cp0_prid_read() >> 8) & 0xff; |
89 | } |
98 | } |
90 | 99 | ||
91 | void cpu_print_report(cpu_t *m) |
100 | void cpu_print_report(cpu_t *m) |
92 | { |
101 | { |
- | 102 | struct data_t *data; |
|
- | 103 | ||
- | 104 | if (m->arch.imp_num & 0x80) { |
|
- | 105 | data = &imp_data80[m->arch.imp_num & 0x7f]; |
|
- | 106 | } else |
|
- | 107 | data = &imp_data[m->arch.imp_num]; |
|
- | 108 | ||
93 | printf("cpu%d: %s %s (rev=%d.%d, imp=%d)\n", |
109 | printf("cpu%d: %s %s (rev=%d.%d, imp=%d)\n", |
94 | m->id, imp_data[m->arch.imp_num].vendor, imp_data[m->arch.imp_num].model, m->arch.rev_num >> 4, m->arch.rev_num & 0xf, m->arch.imp_num); |
110 | m->id, data->vendor, data->model, m->arch.rev_num >> 4, |
- | 111 | m->arch.rev_num & 0xf, m->arch.imp_num); |
|
95 | } |
112 | } |