mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:57:34 +00:00
Kernel: Tweak some suspicious casts in InterruptManagement
This code needs a closer looking-into at some point. It doesn't seem entirely safe to be casting u32's to pointers like it does.
This commit is contained in:
parent
7c278eb970
commit
8ec8304d74
1 changed files with 3 additions and 2 deletions
|
@ -215,7 +215,8 @@ void InterruptManagement::locate_apic_data()
|
||||||
auto* ioapic_entry = (const ACPI::Structures::MADTEntries::IOAPIC*)madt_entry;
|
auto* ioapic_entry = (const ACPI::Structures::MADTEntries::IOAPIC*)madt_entry;
|
||||||
dbg() << "IOAPIC found @ MADT entry " << entry_index << ", MMIO Registers @ Px" << String::format("%x", ioapic_entry->ioapic_address);
|
dbg() << "IOAPIC found @ MADT entry " << entry_index << ", MMIO Registers @ Px" << String::format("%x", ioapic_entry->ioapic_address);
|
||||||
m_interrupt_controllers.resize(1 + irq_controller_count);
|
m_interrupt_controllers.resize(1 + irq_controller_count);
|
||||||
m_interrupt_controllers[irq_controller_count] = adopt(*new IOAPIC(*(ioapic_mmio_regs*)ioapic_entry->ioapic_address, ioapic_entry->gsi_base));
|
// FIXME: Casting ioapic_entry->ioapic_address below looks suspicious!
|
||||||
|
m_interrupt_controllers[irq_controller_count] = adopt(*new IOAPIC(*(ioapic_mmio_regs*)(FlatPtr)ioapic_entry->ioapic_address, ioapic_entry->gsi_base));
|
||||||
irq_controller_count++;
|
irq_controller_count++;
|
||||||
}
|
}
|
||||||
if (madt_entry->type == (u8)ACPI::Structures::MADTEntryType::InterruptSourceOverride) {
|
if (madt_entry->type == (u8)ACPI::Structures::MADTEntryType::InterruptSourceOverride) {
|
||||||
|
@ -227,7 +228,7 @@ void InterruptManagement::locate_apic_data()
|
||||||
interrupt_override_entry->flags);
|
interrupt_override_entry->flags);
|
||||||
dbg() << "Interrupts: Overriding INT 0x" << String::format("%x", interrupt_override_entry->source) << " with GSI " << interrupt_override_entry->global_system_interrupt << ", for bus 0x" << String::format("%x", interrupt_override_entry->bus);
|
dbg() << "Interrupts: Overriding INT 0x" << String::format("%x", interrupt_override_entry->source) << " with GSI " << interrupt_override_entry->global_system_interrupt << ", for bus 0x" << String::format("%x", interrupt_override_entry->bus);
|
||||||
}
|
}
|
||||||
madt_entry = (ACPI::Structures::MADTEntryHeader*)(VirtualAddress((u32)madt_entry).offset(entry_length).get());
|
madt_entry = (ACPI::Structures::MADTEntryHeader*)(VirtualAddress(madt_entry).offset(entry_length).get());
|
||||||
entries_length -= entry_length;
|
entries_length -= entry_length;
|
||||||
entry_index++;
|
entry_index++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue