diff options
author | AlmuHS <liberamenso10000@gmail.com> | 2018-07-07 20:55:37 +0200 |
---|---|---|
committer | AlmuHS <liberamenso10000@gmail.com> | 2018-07-07 20:55:37 +0200 |
commit | 0fb80d231bbbb5f06c79c9b852032ac14a69c1d4 (patch) | |
tree | 065b77daae6deb35bc59f8f9c9e2728579beae95 | |
parent | 247afe02d5d732048d5abae7bf62bcd2389db707 (diff) |
changed vector size
-rw-r--r-- | kern/cpu_number.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kern/cpu_number.c b/kern/cpu_number.c index 0b2e2f1c..aa092c00 100644 --- a/kern/cpu_number.c +++ b/kern/cpu_number.c @@ -1,4 +1,6 @@ -int apic2kernel[255]; +#define MAX_CPUS 32 /* (8*sizeof(long)) */ + +int apic2kernel[MAX_CPUS]; int cpu_number_start = 0, cpu_number_counter = 0; int cpu_number(void) { @@ -7,7 +9,7 @@ int cpu_number(void) { int apic_id = 0; if (!cpu_number_start) { - for (i = 0; i < 255; i++) { + for (i = 0; i < MAX_CPUS; i++) { apic2kernel[i] = -1; } cpu_number_start = 1; @@ -15,7 +17,6 @@ int cpu_number(void) { asm("cpuid" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (eax)); apic_id = (char) (ebx >> 24) & 0xff; - //printf("apic_id = %d\n", apic_id); if (apic2kernel[apic_id] != -1) { return apic2kernel[apic_id]; |