Changes in kernel/arch/arm32/src/cpu/cpu.c [1bd99214:a000878c] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/src/cpu/cpu.c
r1bd99214 ra000878c 44 44 /** Implementators (vendor) names */ 45 45 static const char *imp_data[] = { 46 "?", /* IMP_DATA_START_OFFSET */ 47 "ARM Limited", /* 0x41 */ 48 "", "", /* 0x42 - 0x43 */ 49 "Digital Equipment Corporation", /* 0x44 */ 50 "", "", "", "", "", "", "", "", /* 0x45 - 0x4c */ 51 "Motorola, Freescale Semicondutor Inc.", /* 0x4d */ 52 "", "", "", /* 0x4e - 0x50 */ 53 "Qualcomm Inc.", /* 0x51 */ 54 "", "", "", "", /* 0x52 - 0x55 */ 55 "Marvell Semiconductor", /* 0x56 */ 56 "", "", "", "", "", "", "", "", "", "", /* 0x57 - 0x60 */ 57 "", "", "", "", "", "", "", "", /* 0x61 - 0x68 */ 58 "Intel Corporation" /* 0x69 */ 46 "?", /* IMP_DATA_START_OFFSET */ 47 "ARM Ltd", /* 0x41 */ 48 "", /* 0x42 */ 49 "", /* 0x43 */ 50 "Digital Equipment Corporation", /* 0x44 */ 51 "", "", "", "", "", "", "", "", "", "", /* 0x45 - 0x4e */ 52 "", "", "", "", "", "", "", "", "", "", /* 0x4f - 0x58 */ 53 "", "", "", "", "", "", "", "", "", "", /* 0x59 - 0x62 */ 54 "", "", "", "", "", "", /* 0x63 - 0x68 */ 55 "Intel Corporation" /* 0x69 */ 59 56 }; 60 57 … … 100 97 void cpu_arch_init(void) 101 98 { 102 #if defined(PROCESSOR_armv7)103 uint32_t control_reg = 0;104 asm volatile (105 "mrc p15, 0, %[control_reg], c1, c0"106 : [control_reg] "=r" (control_reg)107 );108 109 /* Turn off tex remap */110 control_reg &= ~CP15_R1_TRE_BIT;111 /* Turn off accessed flag */112 control_reg &= ~(CP15_R1_AFE_BIT | CP15_R1_HA_ENABLE_BIT);113 /* Enable caching */114 control_reg |= CP15_R1_CACHE_ENABLE_BIT;115 116 asm volatile (117 "mcr p15, 0, %[control_reg], c1, c0"118 :: [control_reg] "r" (control_reg)119 );120 #endif121 99 } 122 100 … … 134 112 cpu_arch_t * cpu_arch = &m->arch; 135 113 136 const unsigned imp_offset = cpu_arch->imp_num - IMP_DATA_START_OFFSET; 137 138 if (imp_offset < imp_data_length) { 114 if ((cpu_arch->imp_num) > 0 && 115 (cpu_arch->imp_num < (imp_data_length + IMP_DATA_START_OFFSET))) { 139 116 vendor = imp_data[cpu_arch->imp_num - IMP_DATA_START_OFFSET]; 140 117 } 141 118 142 // TODO CPUs with arch_num == 0xf use CPUID scheme for identification143 if (cpu_arch->arch_num < arch_data_length) {119 if ((cpu_arch->arch_num) > 0 && 120 (cpu_arch->arch_num < arch_data_length)) { 144 121 architecture = arch_data[cpu_arch->arch_num]; 145 122 }
Note:
See TracChangeset
for help on using the changeset viewer.