File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -412,7 +412,8 @@ fn parse_fadt(fadt: AcpiTable<'_>) {
412412
413413 // Map the "Differentiated System Description Table" (DSDT).
414414 // TODO: This must not require "unsafe", see https://github.com/rust-lang/rust/issues/46043#issuecomment-393072398
415- let x_dsdt_field_address = unsafe { & fadt_table. x_dsdt as * const _ as usize } ;
415+ let x_dsdt = core:: ptr:: addr_of!( fadt_table. x_dsdt) ;
416+ let x_dsdt_field_address = unsafe { x_dsdt. read_unaligned ( ) as usize } ;
416417 let dsdt_address = if x_dsdt_field_address < fadt. table_end_address ( ) && fadt_table. x_dsdt > 0 {
417418 PhysAddr ( fadt_table. x_dsdt )
418419 } else {
Original file line number Diff line number Diff line change @@ -233,13 +233,14 @@ fn detect_from_acpi() -> Result<PhysAddr, ()> {
233233 1 => {
234234 // I/O APIC
235235 let ioapic_record = unsafe { & * ( current_address as * const IoApicRecord ) } ;
236+ let ioapic_addr = core:: ptr:: addr_of!( ioapic_record. address) ;
236237 debug ! ( "Found I/O APIC record: {}" , ioapic_record) ;
237238
238239 unsafe {
239240 IOAPIC_ADDRESS = virtualmem:: allocate ( BasePageSize :: SIZE ) . unwrap ( ) ;
240241 debug ! (
241242 "Mapping IOAPIC at {:#X} to virtual address {:#X}" ,
242- ioapic_record . address , IOAPIC_ADDRESS
243+ ioapic_addr . read_unaligned ( ) , IOAPIC_ADDRESS
243244 ) ;
244245
245246 let mut flags = PageTableEntryFlags :: empty ( ) ;
You can’t perform that action at this time.
0 commit comments