From 285514f87d1b2602a997069ac5c0b8c1742345d0 Mon Sep 17 00:00:00 2001 From: Raghuram Subramani Date: Sun, 25 May 2025 21:44:34 +0530 Subject: interrupts: use constants for IDT_ENTRY attributes --- kernel/include/boot/interrupts.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'kernel/include/boot/interrupts.h') diff --git a/kernel/include/boot/interrupts.h b/kernel/include/boot/interrupts.h index 42a0ba9..165b2d6 100644 --- a/kernel/include/boot/interrupts.h +++ b/kernel/include/boot/interrupts.h @@ -32,6 +32,16 @@ (isr >> 16) /* isr_high */ \ } +/* Attributes */ +#define IDT_PRESENT (1 << 7) +#define IDT_KERNEL_PRIVILEGE_LEVEL (0) +#define IDT_USER_PRIVILEGE_LEVEL (3 << 5) +#define IDT_TASK_GATE (0b0101) +#define IDT_16BIT_INTERRUPT_GATE (0b0110) +#define IDT_16BIT_TRAP_GATE (0b0111) +#define IDT_32BIT_INTERRUPT_GATE (0b1110) +#define IDT_32BIT_TRAP_GATE (0b1111) + namespace Interrupts { -- cgit v1.2.3