remove bug by searching lapci on a 64bit system

This commit is contained in:
Stefan Lankes 2012-07-10 22:43:02 +02:00
parent 32aee76655
commit 764134bd18

View file

@ -738,11 +738,21 @@ check_lapic:
lapic = 0xFEE00000;
}
#else
if (apic_config->lapic == 0xFEE00000) {
// On a x64 system, we already map the lapic below the kernel
lapic = (size_t)&kernel_start - 0x1000;
if (apic_config) {
if (apic_config->lapic == 0xFEE00000) {
// On a x64 system, we already map the lapic below the kernel
lapic = (size_t)&kernel_start - 0x1000;
} else {
lapic = apic_config->lapic;
}
} else {
lapic = apic_config->lapic;
uint32_t edx, dummy=0;
cpuid(0x1, &dummy, &dummy, &dummy, &edx);
if (edx & (1 << 9)) {
// On a x64 system, we already map the lapic below the kernel
lapic = (size_t)&kernel_start - 0x1000;
}
}
#endif