summaryrefslogtreecommitdiff
path: root/Kernel/ACPI
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-05-23 13:11:51 +0200
committerAndreas Kling <kling@serenityos.org>2020-05-23 15:25:43 +0200
commitb8af5cd8da74645945c8ab7b63846f051c185f50 (patch)
tree0b65f1ccbb83fcecf01ee5783faa87821460f541 /Kernel/ACPI
parent7379c589c796ba1d0d16791daaea5d2c02160d56 (diff)
downloadserenity-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')
-rw-r--r--Kernel/ACPI/MultiProcessorParser.cpp16
-rw-r--r--Kernel/ACPI/MultiProcessorParser.h11
2 files changed, 8 insertions, 19 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();
diff --git a/Kernel/ACPI/MultiProcessorParser.h b/Kernel/ACPI/MultiProcessorParser.h
index 9f3a05b385..19177896b4 100644
--- a/Kernel/ACPI/MultiProcessorParser.h
+++ b/Kernel/ACPI/MultiProcessorParser.h
@@ -78,17 +78,6 @@ enum class ConfigurationTableEntryType {
CompatibilityBusAddressSpaceModifier = 130
};
-enum class ConfigurationTableEntryLength {
- Processor = 20,
- Bus = 8,
- IOAPIC = 8,
- IO_Interrupt_Assignment = 8,
- Local_Interrupt_Assignment = 8,
- SystemAddressSpaceMapping = 20,
- BusHierarchyDescriptor = 8,
- CompatibilityBusAddressSpaceModifier = 8
-};
-
struct [[gnu::packed]] ExtEntryHeader
{
u8 entry_type;