diff options
author | Andreas Kling <kling@serenityos.org> | 2020-05-23 13:11:51 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-05-23 15:25:43 +0200 |
commit | b8af5cd8da74645945c8ab7b63846f051c185f50 (patch) | |
tree | 0b65f1ccbb83fcecf01ee5783faa87821460f541 /Kernel/ACPI/MultiProcessorParser.cpp | |
parent | 7379c589c796ba1d0d16791daaea5d2c02160d56 (diff) | |
download | serenity-b8af5cd8da74645945c8ab7b63846f051c185f50.zip |
Kernel: Simplify MP table parser a little bit more
Get rid of the ConfigurationTableEntryLength enum and just look at the
sizeof() for each entry type.
Diffstat (limited to 'Kernel/ACPI/MultiProcessorParser.cpp')
-rw-r--r-- | Kernel/ACPI/MultiProcessorParser.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Kernel/ACPI/MultiProcessorParser.cpp b/Kernel/ACPI/MultiProcessorParser.cpp index a292e8be60..80076181bc 100644 --- a/Kernel/ACPI/MultiProcessorParser.cpp +++ b/Kernel/ACPI/MultiProcessorParser.cpp @@ -73,30 +73,30 @@ void MultiProcessorParser::parse_configuration_table() #endif switch (entry->entry_type) { case ((u8)MultiProcessor::ConfigurationTableEntryType::Processor): - entry = (MultiProcessor::EntryHeader*)(u32)entry + (u8)MultiProcessor::ConfigurationTableEntryLength::Processor; + entry = (MultiProcessor::EntryHeader*)(FlatPtr)entry + sizeof(MultiProcessor::ProcessorEntry); break; case ((u8)MultiProcessor::ConfigurationTableEntryType::Bus): m_bus_entries.append(*(const MultiProcessor::BusEntry*)entry); - entry = (MultiProcessor::EntryHeader*)(u32)entry + (u8)MultiProcessor::ConfigurationTableEntryLength::Bus; + entry = (MultiProcessor::EntryHeader*)(FlatPtr)entry + sizeof(MultiProcessor::BusEntry); break; case ((u8)MultiProcessor::ConfigurationTableEntryType::IOAPIC): - entry = (MultiProcessor::EntryHeader*)(u32)entry + (u8)MultiProcessor::ConfigurationTableEntryLength::IOAPIC; + entry = (MultiProcessor::EntryHeader*)(FlatPtr)entry + sizeof(MultiProcessor::IOAPICEntry); break; case ((u8)MultiProcessor::ConfigurationTableEntryType::IO_Interrupt_Assignment): m_io_interrupt_assignment_entries.append(*(const MultiProcessor::IOInterruptAssignmentEntry*)entry); - entry = (MultiProcessor::EntryHeader*)(u32)entry + (u8)MultiProcessor::ConfigurationTableEntryLength::IO_Interrupt_Assignment; + entry = (MultiProcessor::EntryHeader*)(FlatPtr)entry + sizeof(MultiProcessor::IOInterruptAssignmentEntry); break; case ((u8)MultiProcessor::ConfigurationTableEntryType::Local_Interrupt_Assignment): - entry = (MultiProcessor::EntryHeader*)(u32)entry + (u8)MultiProcessor::ConfigurationTableEntryLength::Local_Interrupt_Assignment; + entry = (MultiProcessor::EntryHeader*)(FlatPtr)entry + sizeof(MultiProcessor::LocalInterruptAssignmentEntry); break; case ((u8)MultiProcessor::ConfigurationTableEntryType::SystemAddressSpaceMapping): - entry = (MultiProcessor::EntryHeader*)(u32)entry + (u8)MultiProcessor::ConfigurationTableEntryLength::SystemAddressSpaceMapping; + entry = (MultiProcessor::EntryHeader*)(FlatPtr)entry + sizeof(MultiProcessor::SystemAddressSpaceMappingEntry); break; case ((u8)MultiProcessor::ConfigurationTableEntryType::BusHierarchyDescriptor): - entry = (MultiProcessor::EntryHeader*)(u32)entry + (u8)MultiProcessor::ConfigurationTableEntryLength::BusHierarchyDescriptor; + entry = (MultiProcessor::EntryHeader*)(FlatPtr)entry + sizeof(MultiProcessor::BusHierarchyDescriptorEntry); break; case ((u8)MultiProcessor::ConfigurationTableEntryType::CompatibilityBusAddressSpaceModifier): - entry = (MultiProcessor::EntryHeader*)(u32)entry + (u8)MultiProcessor::ConfigurationTableEntryLength::CompatibilityBusAddressSpaceModifier; + entry = (MultiProcessor::EntryHeader*)(FlatPtr)entry + sizeof(MultiProcessor::CompatibilityBusAddressSpaceModifierEntry); break; default: ASSERT_NOT_REACHED(); |