38,9 → 38,12 |
#include <print.h> |
|
|
/** Number of indexes left out in the #imp_data array */ |
#define IMP_DATA_START_OFFSET 0x40 |
|
/** Implementators (vendor) names */ |
static char * imp_data[] = { |
"?", |
"?", /* IMP_DATA_START_OFFSET */ |
"ARM Ltd", /* 0x41 */ |
"", /* 0x42 */ |
"", /* 0x43 */ |
51,7 → 54,7 |
"Intel Corporation" /* 0x69 */ |
}; |
|
/** Length of imp_data array */ |
/** Length of the #imp_data array */ |
static int imp_data_length = sizeof(imp_data)/sizeof(char *); |
|
/** Architecture names */ |
66,20 → 69,13 |
"6" /* 0x7 */ |
}; |
|
/** Length of arch_data array */ |
/** Length of the #arch_data array */ |
static int arch_data_length = sizeof(arch_data)/sizeof(char *); |
|
|
|
void cpu_arch_init(void) |
{ |
/* TODO */ |
} |
|
/** |
* Retrieves processor identification from CP15 register 0. |
/** Retrieves processor identification from CP15 register 0. |
* |
* @param cpu structure for storing identification |
* @param cpu Structure for storing CPU identification. |
*/ |
static void arch_cpu_identify(cpu_arch_t * cpu) |
{ |
97,6 → 93,11 |
} |
|
|
void cpu_arch_init(void) |
{ |
} |
|
|
void cpu_identify(void) |
{ |
arch_cpu_identify(&CPU->arch); |
109,8 → 110,8 |
char * architecture = arch_data[0]; |
cpu_arch_t * cpu_arch = &m->arch; |
|
if ( (cpu_arch->imp_num) > 0 && (cpu_arch->imp_num < (imp_data_length + 0x40)) ) { |
vendor = imp_data[cpu_arch->imp_num - 0x40]; |
if ( (cpu_arch->imp_num) > 0 && (cpu_arch->imp_num < (imp_data_length + IMP_DATA_START_OFFSET)) ) { |
vendor = imp_data[cpu_arch->imp_num - IMP_DATA_START_OFFSET]; |
} |
|
if ( (cpu_arch->arch_num) > 0 && (cpu_arch->arch_num < arch_data_length) ) { |
119,7 → 120,6 |
|
printf("vendor: %s, architecture: ARM %s, part number: %x, variant: %x, revision: %x\n", |
vendor, architecture, cpu_arch->prim_part_num, cpu_arch->variant_num, cpu_arch->rev_num); |
|
} |
|
/** @} |