aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kernel/include/boot/gdt.h6
-rw-r--r--kernel/include/common.h1
2 files changed, 5 insertions, 2 deletions
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 <stdint.h>
+#include <common.h>
+
/* 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)