From 9eb956111bed4f414345f936af83395044f719b0 Mon Sep 17 00:00:00 2001
From: Ian Moffett <ian@osmora.org>
Date: Wed, 13 Dec 2023 12:40:56 -0500
Subject: kernel/amd64: trap: Add TRAP_NONE define

This commit introduces the trap type TRAP_NONE to allow for general
interrupts as they also use the `trap_frame' but are not interrupts that
will occur during instruction execution.

Signed-off-by: Ian Moffett <ian@osmora.org>
---
 sys/include/arch/amd64/trap.h | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

(limited to 'sys')

diff --git a/sys/include/arch/amd64/trap.h b/sys/include/arch/amd64/trap.h
index 8574929..8cd7ca1 100644
--- a/sys/include/arch/amd64/trap.h
+++ b/sys/include/arch/amd64/trap.h
@@ -35,17 +35,18 @@
 #include <machine/frame.h>
 #endif      /* !defined(__ASSEMBLER__) */
 
-#define TRAP_BREAKPOINT     0       /* Breakpoint */
-#define TRAP_ARITH_ERR      1       /* Arithmetic error (e.g division by 0) */
-#define TRAP_OVERFLOW       2       /* Overflow */
-#define TRAP_BOUND_RANGE    3       /* BOUND range exceeded */
-#define TRAP_INVLOP         4       /* Invalid opcode */
-#define TRAP_DOUBLE_FAULT   5       /* Double fault */
-#define TRAP_INVLTSS        6       /* Invalid TSS */
-#define TRAP_SEGNP          7       /* Segment not present */
-#define TRAP_PROTFLT        8       /* General protection */
-#define TRAP_PAGEFLT        9       /* Page fault */
-#define TRAP_NMI            10      /* Non-maskable interrupt */
+#define TRAP_NONE           0       /* Used for general interrupts */
+#define TRAP_BREAKPOINT     1       /* Breakpoint */
+#define TRAP_ARITH_ERR      2       /* Arithmetic error (e.g division by 0) */
+#define TRAP_OVERFLOW       3       /* Overflow */
+#define TRAP_BOUND_RANGE    4       /* BOUND range exceeded */
+#define TRAP_INVLOP         5       /* Invalid opcode */
+#define TRAP_DOUBLE_FAULT   6       /* Double fault */
+#define TRAP_INVLTSS        7       /* Invalid TSS */
+#define TRAP_SEGNP          8       /* Segment not present */
+#define TRAP_PROTFLT        9       /* General protection */
+#define TRAP_PAGEFLT        10      /* Page fault */
+#define TRAP_NMI            11      /* Non-maskable interrupt */
 
 /* Trap is coming from user mode */
 #define TRAP_USER           0x100
-- 
cgit v1.2.3