From 87f8040eb2f0361782b6eda4af15161ba6b4c4a0 Mon Sep 17 00:00:00 2001 From: Kat Richey Date: Sat, 29 Oct 2022 10:03:37 -0500 Subject: [PATCH] Added some packing stuff for GCC --- include/kernel/interrupt.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/kernel/interrupt.h b/include/kernel/interrupt.h index 781a599..caf6d9c 100644 --- a/include/kernel/interrupt.h +++ b/include/kernel/interrupt.h @@ -1,6 +1,15 @@ #ifndef _KERNEL_INTERRUPT #define _KERNEL_INTERRUPT +#ifdef __GNUC__ +struct IDT_entry { + unsigned short int offset_lowerbits; + unsigned short int selector; + unsigned char zero; + unsigned char type_attr; + unsigned short int offset_higherbits; +} __attribute__((packed)); +#else struct IDT_entry { unsigned short int offset_lowerbits; unsigned short int selector; @@ -8,7 +17,11 @@ struct IDT_entry { unsigned char type_attr; unsigned short int offset_higherbits; }; +#endif +#ifdef __GNUC__ +__attribute((aligned(0x10))) +#endif struct IDT_entry IDT[256]; void idt_init(void);