diff options
| -rw-r--r-- | arch/x86/boot/cpu.c | 17 | ||||
| -rw-r--r-- | arch/x86/boot/mkcpustr.c | 38 |
2 files changed, 28 insertions, 27 deletions
diff --git a/arch/x86/boot/cpu.c b/arch/x86/boot/cpu.c index 75298fe2edca..6ec6bb6e9957 100644 --- a/arch/x86/boot/cpu.c +++ b/arch/x86/boot/cpu.c | |||
| @@ -59,17 +59,18 @@ int validate_cpu(void) | |||
| 59 | u32 e = err_flags[i]; | 59 | u32 e = err_flags[i]; |
| 60 | 60 | ||
| 61 | for (j = 0; j < 32; j++) { | 61 | for (j = 0; j < 32; j++) { |
| 62 | int n = (i << 5)+j; | 62 | if (msg_strs[0] < i || |
| 63 | if (*msg_strs < n) { | 63 | (msg_strs[0] == i && msg_strs[1] < j)) { |
| 64 | /* Skip to the next string */ | 64 | /* Skip to the next string */ |
| 65 | do { | 65 | msg_strs += 2; |
| 66 | msg_strs++; | 66 | while (*msg_strs++) |
| 67 | } while (*msg_strs); | 67 | ; |
| 68 | msg_strs++; | ||
| 69 | } | 68 | } |
| 70 | if (e & 1) { | 69 | if (e & 1) { |
| 71 | if (*msg_strs == n && msg_strs[1]) | 70 | if (msg_strs[0] == i && |
| 72 | printf("%s ", msg_strs+1); | 71 | msg_strs[1] == j && |
| 72 | msg_strs[2]) | ||
| 73 | printf("%s ", msg_strs+2); | ||
| 73 | else | 74 | else |
| 74 | printf("%d:%d ", i, j); | 75 | printf("%d:%d ", i, j); |
| 75 | } | 76 | } |
diff --git a/arch/x86/boot/mkcpustr.c b/arch/x86/boot/mkcpustr.c index 4589caa3e9d1..8ef60f20b371 100644 --- a/arch/x86/boot/mkcpustr.c +++ b/arch/x86/boot/mkcpustr.c | |||
| @@ -17,31 +17,31 @@ | |||
| 17 | 17 | ||
| 18 | #include "../kernel/cpu/capflags.c" | 18 | #include "../kernel/cpu/capflags.c" |
| 19 | 19 | ||
| 20 | #if NCAPFLAGS > 8 | ||
| 21 | # error "Need to adjust the boot code handling of CPUID strings" | ||
| 22 | #endif | ||
| 23 | |||
| 24 | int main(void) | 20 | int main(void) |
| 25 | { | 21 | { |
| 26 | int i; | 22 | int i, j; |
| 27 | const char *str; | 23 | const char *str; |
| 28 | 24 | ||
| 29 | printf("static const char x86_cap_strs[] = \n"); | 25 | printf("static const char x86_cap_strs[] = \n"); |
| 30 | 26 | ||
| 31 | for (i = 0; i < NCAPINTS*32; i++) { | 27 | for (i = 0; i < NCAPINTS; i++) { |
| 32 | str = x86_cap_flags[i]; | 28 | for (j = 0; j < 32; j++) { |
| 33 | 29 | str = x86_cap_flags[i*32+j]; | |
| 34 | if (i == NCAPINTS*32-1) { | 30 | |
| 35 | /* The last entry must be unconditional; this | 31 | if (i == NCAPINTS-1 && j == 31) { |
| 36 | also consumes the compiler-added null character */ | 32 | /* The last entry must be unconditional; this |
| 37 | if (!str) | 33 | also consumes the compiler-added null |
| 38 | str = ""; | 34 | character */ |
| 39 | printf("\t\"\\x%02x\"\"%s\"\n", i, str); | 35 | if (!str) |
| 40 | } else if (str) { | 36 | str = ""; |
| 41 | printf("#if REQUIRED_MASK%d & (1 << %d)\n" | 37 | printf("\t\"\\x%02x\\x%02x\"\"%s\"\n", |
| 42 | "\t\"\\x%02x\"\"%s\\0\"\n" | 38 | i, j, str); |
| 43 | "#endif\n", | 39 | } else if (str) { |
| 44 | i >> 5, i & 31, i, str); | 40 | printf("#if REQUIRED_MASK%d & (1 << %d)\n" |
| 41 | "\t\"\\x%02x\\x%02x\"\"%s\\0\"\n" | ||
| 42 | "#endif\n", | ||
| 43 | i, j, i, j, str); | ||
| 44 | } | ||
| 45 | } | 45 | } |
| 46 | } | 46 | } |
| 47 | printf("\t;\n"); | 47 | printf("\t;\n"); |
