remove bug by searching lapci on a 64bit system
This commit is contained in:
parent
32aee76655
commit
764134bd18
1 changed files with 14 additions and 4 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue