Replace __attribute__ with a macro from types.h

This commit is contained in:
Alex
2023-04-07 05:22:14 +03:00
parent 7fa3e91a53
commit 98c137566d
22 changed files with 69 additions and 69 deletions

View File

@ -36,7 +36,7 @@
namespace ACPI
{
__attribute__((always_inline)) inline bool IsCanonical(uint64_t Address)
__always_inline inline bool IsCanonical(uint64_t Address)
{
return ((Address <= 0x00007FFFFFFFFFFF) || ((Address >= 0xFFFF800000000000) && (Address <= 0xFFFFFFFFFFFFFFFF)));
}

View File

@ -41,7 +41,7 @@ namespace ACPI
uint32_t OEMRevision;
uint32_t CreatorID;
uint32_t CreatorRevision;
} __attribute__((packed));
} __packed;
struct GenericAddressStructure
{
@ -50,13 +50,13 @@ namespace ACPI
uint8_t BitOffset;
uint8_t AccessSize;
uint64_t Address;
} __attribute__((packed));
} __packed;
struct MCFGHeader
{
struct ACPIHeader Header;
uint64_t Reserved;
} __attribute__((packed));
} __packed;
struct HPETHeader
{
@ -71,7 +71,7 @@ namespace ACPI
uint8_t HPETNumber;
uint16_t MinimumTick;
uint8_t PageProtection;
} __attribute__((packed));
} __packed;
struct FADTHeader
{
@ -127,7 +127,7 @@ namespace ACPI
struct GenericAddressStructure X_PMTimerBlock;
struct GenericAddressStructure X_GPE0Block;
struct GenericAddressStructure X_GPE1Block;
} __attribute__((packed));
} __packed;
struct BGRTHeader
{
@ -181,7 +181,7 @@ namespace ACPI
uint32_t LocalControllerAddress;
uint32_t Flags;
char Entries[];
} __attribute__((packed));
} __packed;
ACPIHeader *XSDT = nullptr;
MCFGHeader *MCFG = nullptr;
@ -209,7 +209,7 @@ namespace ACPI
{
uint8_t Type;
uint8_t Length;
} __attribute__((packed));
} __packed;
struct MADTIOApic
{
@ -218,7 +218,7 @@ namespace ACPI
uint8_t reserved;
uint32_t Address;
uint32_t GSIBase;
} __attribute__((packed));
} __packed;
struct MADTIso
{
@ -227,7 +227,7 @@ namespace ACPI
uint8_t IRQSource;
uint32_t GSI;
uint16_t Flags;
} __attribute__((packed));
} __packed;
struct MADTNmi
{
@ -235,7 +235,7 @@ namespace ACPI
uint8_t processor;
uint16_t flags;
uint8_t lint;
} __attribute__((packed));
} __packed;
struct LocalAPIC
{
@ -243,7 +243,7 @@ namespace ACPI
uint8_t ACPIProcessorId;
uint8_t APICId;
uint32_t Flags;
} __attribute__((packed));
} __packed;
struct LAPIC
{

View File

@ -170,7 +170,7 @@ namespace APIC
uint64_t Reserved2 : 14;
};
uint64_t raw;
} __attribute__((packed)) LVTTimer;
} __packed LVTTimer;
typedef union
{
@ -190,7 +190,7 @@ namespace APIC
uint64_t Reserved1 : 19;
};
uint64_t raw;
} __attribute__((packed)) Spurious;
} __packed Spurious;
typedef union
{
@ -239,7 +239,7 @@ namespace APIC
uint64_t Reserved2 : 12;
};
uint64_t raw;
} __attribute__((packed)) InterruptCommandRegisterLow;
} __packed InterruptCommandRegisterLow;
typedef union
{
@ -251,7 +251,7 @@ namespace APIC
uint64_t Destination : 8;
};
uint64_t raw;
} __attribute__((packed)) InterruptCommandRegisterHigh;
} __packed InterruptCommandRegisterHigh;
typedef union
{
@ -298,7 +298,7 @@ namespace APIC
uint64_t High;
} split;
uint64_t raw;
} __attribute__((packed)) IOAPICRedirectEntry;
} __packed IOAPICRedirectEntry;
typedef union
{
@ -310,7 +310,7 @@ namespace APIC
uint64_t Reserved2 : 8;
};
uint64_t raw;
} __attribute__((packed)) IOAPICVersion;
} __packed IOAPICVersion;
class APIC
{

View File

@ -68,7 +68,7 @@ namespace GlobalDescriptorTable
* @details This bit must be 1 for all valid descriptors.
*/
uint8_t P : 1;
} __attribute__((packed));
} __packed;
uint8_t Raw;
};
@ -85,7 +85,7 @@ namespace GlobalDescriptorTable
* @details If the long mode bit is set, the segment is in 64-bit long mode.
*/
uint8_t L : 1;
} __attribute__((packed));
} __packed;
uint8_t Raw;
};
@ -101,18 +101,18 @@ namespace GlobalDescriptorTable
/* HIGH */
uint32_t BaseUpper;
uint32_t Reserved;
} __attribute__((packed)) TaskStateSegmentEntry;
} __packed TaskStateSegmentEntry;
typedef struct _TaskStateSegment
{
uint32_t Reserved0 __attribute__((aligned(16)));
uint32_t Reserved0 __aligned(0x10);
uint64_t StackPointer[3];
uint64_t Reserved1;
uint64_t InterruptStackTable[7];
uint64_t Reserved2;
uint16_t Reserved3;
uint16_t IOMapBaseAddressOffset;
} __attribute__((packed)) TaskStateSegment;
} __packed TaskStateSegment;
typedef struct _GlobalDescriptorTableEntry
{
@ -128,7 +128,7 @@ namespace GlobalDescriptorTable
GlobalDescriptorTableFlags Flags;
/** @brief High Base */
uint8_t BaseHigh;
} __attribute__((packed)) GlobalDescriptorTableEntry;
} __packed GlobalDescriptorTableEntry;
typedef struct _GlobalDescriptorTableEntries
{
@ -138,7 +138,7 @@ namespace GlobalDescriptorTable
GlobalDescriptorTableEntry UserData;
GlobalDescriptorTableEntry UserCode;
TaskStateSegmentEntry TaskStateSegment;
} __attribute__((packed)) GlobalDescriptorTableEntries;
} __packed GlobalDescriptorTableEntries;
typedef struct _GlobalDescriptorTableDescriptor
{
@ -146,7 +146,7 @@ namespace GlobalDescriptorTable
uint16_t Length;
/** @brief GDT entries address */
GlobalDescriptorTableEntries *Entries;
} __attribute__((packed)) GlobalDescriptorTableDescriptor;
} __packed GlobalDescriptorTableDescriptor;
extern void *CPUStackPointer[];
extern TaskStateSegment tss[];

View File

@ -48,13 +48,13 @@ namespace InterruptDescriptorTable
uint64_t Present : 1;
uint64_t BaseHigh : 48;
uint64_t Reserved3 : 32;
} __attribute__((packed)) InterruptDescriptorTableEntry;
} __packed InterruptDescriptorTableEntry;
typedef struct _InterruptDescriptorTableDescriptor
{
uint16_t Length;
InterruptDescriptorTableEntry *Entries;
} __attribute__((packed)) InterruptDescriptorTableDescriptor;
} __packed InterruptDescriptorTableDescriptor;
void SetEntry(uint8_t Index, void (*Base)(), InterruptDescriptorTableFlags Attribute, uint8_t InterruptStackTable, InterruptDescriptorTableFlags Ring, uint16_t SegmentSelector);
void Init(int Core);