diff options
author | Linus Groh <mail@linusgroh.de> | 2020-12-30 22:44:54 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-12-31 21:51:00 +0100 |
commit | bbe787a0afd51307cdac2c023895c19df31519ca (patch) | |
tree | 44dc80cf50b22b461c27c1e9d99fa2c9ff00e22e /Kernel/ACPI | |
parent | 2568a93b5dd29d2b06d613a4ece502ee696f189a (diff) | |
download | serenity-bbe787a0afd51307cdac2c023895c19df31519ca.zip |
Everywhere: Re-format with clang-format-11
Compared to version 10 this fixes a bunch of formatting issues, mostly
around structs/classes with attributes like [[gnu::packed]], and
incorrect insertion of spaces in parameter types ("T &"/"T &&").
I also removed a bunch of // clang-format off/on and FIXME comments that
are no longer relevant - on the other hand it tried to destroy a couple of
neatly formatted comments, so I had to add some as well.
Diffstat (limited to 'Kernel/ACPI')
-rw-r--r-- | Kernel/ACPI/Definitions.h | 54 | ||||
-rw-r--r-- | Kernel/ACPI/MultiProcessorParser.h | 36 |
2 files changed, 30 insertions, 60 deletions
diff --git a/Kernel/ACPI/Definitions.h b/Kernel/ACPI/Definitions.h index 899781f560..2ac99cc37c 100644 --- a/Kernel/ACPI/Definitions.h +++ b/Kernel/ACPI/Definitions.h @@ -70,8 +70,7 @@ enum class IA_PC_Flags : u8 { CMOS_RTC_Not_Present = 1 << 5 }; -struct [[gnu::packed]] HardwareFeatures -{ +struct [[gnu::packed]] HardwareFeatures { bool wbinvd : 1; bool wbinvd_flush : 1; bool processor_c1 : 1; @@ -95,8 +94,7 @@ struct [[gnu::packed]] HardwareFeatures bool hardware_reduced_acpi : 1; bool low_power_s0_idle_capable : 1; }; -struct [[gnu::packed]] x86_Specific_Flags -{ +struct [[gnu::packed]] x86_Specific_Flags { bool legacy_devices : 1; bool keyboard_8042 : 1; bool vga_not_present : 1; @@ -132,8 +130,7 @@ enum class BitWidth { } namespace Structures { -struct [[gnu::packed]] RSDPDescriptor -{ +struct [[gnu::packed]] RSDPDescriptor { char sig[8]; u8 checksum; char oem_id[6]; @@ -141,8 +138,7 @@ struct [[gnu::packed]] RSDPDescriptor u32 rsdt_ptr; }; -struct [[gnu::packed]] RSDPDescriptor20 -{ +struct [[gnu::packed]] RSDPDescriptor20 { RSDPDescriptor base; u32 length; u64 xsdt_ptr; @@ -150,8 +146,7 @@ struct [[gnu::packed]] RSDPDescriptor20 u8 reserved[3]; }; -struct [[gnu::packed]] SDTHeader -{ +struct [[gnu::packed]] SDTHeader { char sig[4]; u32 length; u8 revision; @@ -163,20 +158,17 @@ struct [[gnu::packed]] SDTHeader u32 creator_revision; }; -struct [[gnu::packed]] RSDT -{ +struct [[gnu::packed]] RSDT { SDTHeader h; u32 table_ptrs[]; }; -struct [[gnu::packed]] XSDT -{ +struct [[gnu::packed]] XSDT { SDTHeader h; u64 table_ptrs[]; }; -struct [[gnu::packed]] GenericAddressStructure -{ +struct [[gnu::packed]] GenericAddressStructure { u8 address_space; u8 bit_width; u8 bit_offset; @@ -184,8 +176,7 @@ struct [[gnu::packed]] GenericAddressStructure u64 address; }; -struct [[gnu::packed]] HPET -{ +struct [[gnu::packed]] HPET { SDTHeader h; u8 hardware_revision_id; u8 attributes; @@ -196,8 +187,7 @@ struct [[gnu::packed]] HPET u8 page_protection; }; -struct [[gnu::packed]] FADT -{ +struct [[gnu::packed]] FADT { SDTHeader h; u32 firmware_ctrl; u32 dsdt_ptr; @@ -274,15 +264,13 @@ enum class MADTEntryType { GIC_Interrupt_Translation = 0xF }; -struct [[gnu::packed]] MADTEntryHeader -{ +struct [[gnu::packed]] MADTEntryHeader { u8 type; u8 length; }; namespace MADTEntries { -struct [[gnu::packed]] IOAPIC -{ +struct [[gnu::packed]] IOAPIC { MADTEntryHeader h; u8 ioapic_id; u8 reserved; @@ -290,16 +278,14 @@ struct [[gnu::packed]] IOAPIC u32 gsi_base; }; -struct [[gnu::packed]] ProcessorLocalAPIC -{ +struct [[gnu::packed]] ProcessorLocalAPIC { MADTEntryHeader h; u8 acpi_processor_id; u8 apic_id; u32 flags; }; -struct [[gnu::packed]] InterruptSourceOverride -{ +struct [[gnu::packed]] InterruptSourceOverride { MADTEntryHeader h; u8 bus; u8 source; @@ -308,22 +294,19 @@ struct [[gnu::packed]] InterruptSourceOverride }; } -struct [[gnu::packed]] MADT -{ +struct [[gnu::packed]] MADT { SDTHeader h; u32 lapic_address; u32 flags; MADTEntryHeader entries[]; }; -struct [[gnu::packed]] AMLTable -{ +struct [[gnu::packed]] AMLTable { SDTHeader h; char aml_code[]; }; -struct [[gnu::packed]] PCI_MMIO_Descriptor -{ +struct [[gnu::packed]] PCI_MMIO_Descriptor { u64 base_addr; u16 seg_group_number; u8 start_pci_bus; @@ -331,8 +314,7 @@ struct [[gnu::packed]] PCI_MMIO_Descriptor u32 reserved; }; -struct [[gnu::packed]] MCFG -{ +struct [[gnu::packed]] MCFG { SDTHeader header; u64 reserved; PCI_MMIO_Descriptor descriptors[]; diff --git a/Kernel/ACPI/MultiProcessorParser.h b/Kernel/ACPI/MultiProcessorParser.h index 19177896b4..f85f5c8fbb 100644 --- a/Kernel/ACPI/MultiProcessorParser.h +++ b/Kernel/ACPI/MultiProcessorParser.h @@ -34,8 +34,7 @@ namespace Kernel { namespace MultiProcessor { -struct [[gnu::packed]] FloatingPointer -{ +struct [[gnu::packed]] FloatingPointer { char sig[4]; u32 physical_address_ptr; u8 length; @@ -44,13 +43,11 @@ struct [[gnu::packed]] FloatingPointer u8 feature_info[5]; }; -struct [[gnu::packed]] EntryHeader -{ +struct [[gnu::packed]] EntryHeader { u8 entry_type; }; -struct [[gnu::packed]] ConfigurationTableHeader -{ +struct [[gnu::packed]] ConfigurationTableHeader { char sig[4]; u16 length; u8 specification_revision; @@ -78,14 +75,12 @@ enum class ConfigurationTableEntryType { CompatibilityBusAddressSpaceModifier = 130 }; -struct [[gnu::packed]] ExtEntryHeader -{ +struct [[gnu::packed]] ExtEntryHeader { u8 entry_type; u8 entry_length; }; -struct [[gnu::packed]] ProcessorEntry -{ +struct [[gnu::packed]] ProcessorEntry { EntryHeader h; u8 local_apic_id; u8 local_apic_version; @@ -95,15 +90,13 @@ struct [[gnu::packed]] ProcessorEntry u8 reserved[8]; }; -struct [[gnu::packed]] BusEntry -{ +struct [[gnu::packed]] BusEntry { EntryHeader h; u8 bus_id; char bus_type[6]; }; -struct [[gnu::packed]] IOAPICEntry -{ +struct [[gnu::packed]] IOAPICEntry { EntryHeader h; u8 ioapic_id; u8 ioapic_version; @@ -118,8 +111,7 @@ enum class InterruptType { ExtINT = 3, }; -struct [[gnu::packed]] IOInterruptAssignmentEntry -{ +struct [[gnu::packed]] IOInterruptAssignmentEntry { EntryHeader h; u8 interrupt_type; u8 polarity; @@ -130,8 +122,7 @@ struct [[gnu::packed]] IOInterruptAssignmentEntry u8 destination_ioapic_intin_pin; }; -struct [[gnu::packed]] LocalInterruptAssignmentEntry -{ +struct [[gnu::packed]] LocalInterruptAssignmentEntry { EntryHeader h; u8 interrupt_type; u8 polarity; @@ -148,8 +139,7 @@ enum class SystemAddressType { Prefetch = 2, }; -struct [[gnu::packed]] SystemAddressSpaceMappingEntry -{ +struct [[gnu::packed]] SystemAddressSpaceMappingEntry { ExtEntryHeader h; u8 bus_id; u8 address_type; @@ -157,8 +147,7 @@ struct [[gnu::packed]] SystemAddressSpaceMappingEntry u64 length; }; -struct [[gnu::packed]] BusHierarchyDescriptorEntry -{ +struct [[gnu::packed]] BusHierarchyDescriptorEntry { ExtEntryHeader h; u8 bus_id; u8 bus_info; @@ -166,8 +155,7 @@ struct [[gnu::packed]] BusHierarchyDescriptorEntry u8 reserved[3]; }; -struct [[gnu::packed]] CompatibilityBusAddressSpaceModifierEntry -{ +struct [[gnu::packed]] CompatibilityBusAddressSpaceModifierEntry { ExtEntryHeader h; u8 bus_id; u8 address_modifier; |