From 32a88e354f6936ae0e2ab9c564293a09c6d77902 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 18 Nov 2025 16:04:19 -0500 Subject: kern/amd64: idt: Make idt.h includable in ASM This also moves the interrupt gate defines to the idt.h header so that they can be used within C code Signed-off-by: Ian Moffett --- sys/inc/arch/amd64/idt.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sys/inc/arch/amd64') diff --git a/sys/inc/arch/amd64/idt.h b/sys/inc/arch/amd64/idt.h index 69ca30a..1099310 100644 --- a/sys/inc/arch/amd64/idt.h +++ b/sys/inc/arch/amd64/idt.h @@ -30,11 +30,18 @@ #ifndef _MACHINE_IDT_H_ #define _MACHINE_IDT_H_ 1 +#define INT_GATE 0x8E +#define TRAP_GATE 0x8F + +#if !defined(__ASSEMBLER__) #include +#endif /* __ASSEMBLER__ */ +#if !defined(__ASSEMBLER__) /* * Set an interrupt gate */ void idt_set_gate(uint8_t vector, uint8_t type, uintptr_t isr, uint8_t ist); +#endif /* !__ASSEMBLER__ */ #endif /* !_MACHINE_IDT_H_ */ -- cgit v1.2.3