From 75609c32bc1eabefd878563df7a2e088c8c2976c Mon Sep 17 00:00:00 2001 From: Raghuram Subramani Date: Sun, 5 Jan 2025 08:05:50 -0500 Subject: kernel: gdt: Use macro for packed attribute --- kernel/include/boot/gdt.h | 6 ++++-- kernel/include/common.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'kernel/include') diff --git a/kernel/include/boot/gdt.h b/kernel/include/boot/gdt.h index 316c359..a32bce6 100644 --- a/kernel/include/boot/gdt.h +++ b/kernel/include/boot/gdt.h @@ -21,6 +21,8 @@ #include +#include + /* Access Flags: * 7 PRESENT * 6 PRIVILEGE @@ -93,12 +95,12 @@ typedef struct { uint8_t access_flags; uint8_t flags_limit_high; uint8_t base_high; -} __attribute__((packed)) GDT_entry; +} PACKED GDT_entry; typedef struct { uint16_t limit; /* sizeof(GDT) - 1 */ GDT_entry *ptr; /* Address of GDT */ -} __attribute__((packed)) GDT_descriptor; +} PACKED GDT_descriptor; extern void _GDT_flush(GDT_descriptor *); void GDT_load(void); diff --git a/kernel/include/common.h b/kernel/include/common.h index cd60fdf..c0f34b5 100644 --- a/kernel/include/common.h +++ b/kernel/include/common.h @@ -20,6 +20,7 @@ #define __common_h #define ALWAYS_INLINE __attribute__((always_inline)) inline +#define PACKED __attribute__((packed)) #define KiB 1024 #define MiB (KiB * KiB) -- cgit v1.2.3