Skip to content

Commit

Permalink
minor changes to avoid issue 82523
Browse files Browse the repository at this point in the history
  • Loading branch information
stlankes committed Apr 25, 2021
1 parent 90f3274 commit 87a9d3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/arch/x86_64/kernel/acpi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,8 @@ fn parse_fadt(fadt: AcpiTable<'_>) {

// Map the "Differentiated System Description Table" (DSDT).
// TODO: This must not require "unsafe", see https://github.com/rust-lang/rust/issues/46043#issuecomment-393072398
let x_dsdt_field_address = unsafe { &fadt_table.x_dsdt as *const _ as usize };
let x_dsdt = core::ptr::addr_of!(fadt_table.x_dsdt);
let x_dsdt_field_address = unsafe { x_dsdt.read_unaligned() as usize };
let dsdt_address = if x_dsdt_field_address < fadt.table_end_address() && fadt_table.x_dsdt > 0 {
PhysAddr(fadt_table.x_dsdt)
} else {
Expand Down
3 changes: 2 additions & 1 deletion src/arch/x86_64/kernel/apic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,14 @@ fn detect_from_acpi() -> Result<PhysAddr, ()> {
1 => {
// I/O APIC
let ioapic_record = unsafe { &*(current_address as *const IoApicRecord) };
let ioapic_addr = core::ptr::addr_of!(ioapic_record.address);
debug!("Found I/O APIC record: {}", ioapic_record);

unsafe {
IOAPIC_ADDRESS = virtualmem::allocate(BasePageSize::SIZE).unwrap();
debug!(
"Mapping IOAPIC at {:#X} to virtual address {:#X}",
ioapic_record.address, IOAPIC_ADDRESS
ioapic_addr.read_unaligned(), IOAPIC_ADDRESS
);

let mut flags = PageTableEntryFlags::empty();
Expand Down

0 comments on commit 87a9d3f

Please sign in to comment.