Fix compilation on x86_64
This commit is contained in:
@@ -236,11 +236,10 @@ pub unsafe fn handle_ioapic(mapper: &mut KernelMapper, madt_ioapic: &'static Mad
|
||||
// map the I/O APIC registers
|
||||
|
||||
let frame = Frame::containing_address(PhysicalAddress::new(madt_ioapic.address as usize));
|
||||
let page = Page::containing_address(if cfg!(target_arch = "x86") {
|
||||
VirtualAddress::new(crate::IOAPIC_OFFSET)
|
||||
} else {
|
||||
RmmA::phys_to_virt(frame.start_address())
|
||||
});
|
||||
#[cfg(target_arch = "x86")]
|
||||
let page = Page::containing_address(VirtualAddress::new(crate::IOAPIC_OFFSET));
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
let page = Page::containing_address(RmmA::phys_to_virt(frame.start_address()));
|
||||
|
||||
assert!(mapper.translate(page.start_address()).is_none());
|
||||
|
||||
|
||||
@@ -49,11 +49,10 @@ impl LocalApic {
|
||||
.expect("expected KernelMapper not to be locked re-entrant while initializing LAPIC");
|
||||
|
||||
let physaddr = PhysicalAddress::new(rdmsr(IA32_APIC_BASE) as usize & 0xFFFF_0000);
|
||||
let virtaddr = if cfg!(target_arch = "x86") {
|
||||
VirtualAddress::new(crate::LAPIC_OFFSET)
|
||||
} else {
|
||||
RmmA::phys_to_virt(physaddr)
|
||||
};
|
||||
#[cfg(target_arch = "x86")]
|
||||
let virtaddr = VirtualAddress::new(crate::LAPIC_OFFSET);
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
let virtaddr = RmmA::phys_to_virt(physaddr);
|
||||
|
||||
self.address = virtaddr.data();
|
||||
self.x2 = cpuid().map_or(false, |cpuid| {
|
||||
|
||||
Reference in New Issue
Block a user