summaryrefslogtreecommitdiff
path: root/sys/include/arch/aarch64/frame.h
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-06-19 00:53:55 -0400
committerIan Moffett <ian@osmora.org>2025-06-19 00:53:55 -0400
commitcaad8df87d20c5949ef4c1190bc5a63ccf75dc05 (patch)
tree9aa3abd04a4797dfbeb1a82820a2367bfb5a9371 /sys/include/arch/aarch64/frame.h
parent1a3e39cd28f90754c3927dabe32a37836db3f8d5 (diff)
kernel/aarch64: Add exception code + frame fixups
- Add handle_exception() as higher level logic to handle the exceptions - Simplify frame.h - Call C handler in vector.S - Clean up stack after creating frame - Add register dump on exception Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include/arch/aarch64/frame.h')
-rw-r--r--sys/include/arch/aarch64/frame.h80
1 files changed, 36 insertions, 44 deletions
diff --git a/sys/include/arch/aarch64/frame.h b/sys/include/arch/aarch64/frame.h
index f14fa01..143f4d0 100644
--- a/sys/include/arch/aarch64/frame.h
+++ b/sys/include/arch/aarch64/frame.h
@@ -31,46 +31,11 @@
#define _MACHINE_FRAME_H_
#include <sys/types.h>
+#include <sys/cdefs.h>
typedef uint64_t lreg_t;
typedef uint64_t frament_t;
-/* General purpose registers */
-struct gpregs {
- frament_t trapno;
- lreg_t x0;
- lreg_t x1;
- lreg_t x2;
- lreg_t x3;
- lreg_t x4;
- lreg_t x5;
- lreg_t x6;
- lreg_t x7;
- lreg_t x8;
- lreg_t x9;
- lreg_t x10;
- lreg_t x11;
- lreg_t x12;
- lreg_t x13;
- lreg_t x14;
- lreg_t x15;
- lreg_t x16;
- lreg_t x17;
- lreg_t x18;
- lreg_t x19;
- lreg_t x20;
- lreg_t x21;
- lreg_t x22;
- lreg_t x23;
- lreg_t x24;
- lreg_t x25;
- lreg_t x26;
- lreg_t x27;
- lreg_t x28;
- lreg_t x29;
- lreg_t x30;
-};
-
/* Stack regs */
struct sregs {
lreg_t sp_el0;
@@ -85,14 +50,41 @@ struct pstat {
lreg_t spsr_el3;
};
-struct trapframe {
- struct gpregs gp;
- struct sregs stack;
- struct pstat status;
- lreg_t elr_el1;
- lreg_t elr_el2;
- lreg_t elr_el3;
- lreg_t pc;
+struct __aligned(16) trapframe {
+ lreg_t x30;
+ lreg_t x29;
+ lreg_t x28;
+ lreg_t x27;
+ lreg_t x26;
+ lreg_t x25;
+ lreg_t x24;
+ lreg_t x23;
+ lreg_t x22;
+ lreg_t x21;
+ lreg_t x20;
+ lreg_t x19;
+ lreg_t x18;
+ lreg_t x17;
+ lreg_t x16;
+ lreg_t x15;
+ lreg_t x14;
+ lreg_t x13;
+ lreg_t x12;
+ lreg_t x11;
+ lreg_t x10;
+ lreg_t x9;
+ lreg_t x8;
+ lreg_t x7;
+ lreg_t x6;
+ lreg_t x5;
+ lreg_t x4;
+ lreg_t x3;
+ lreg_t x2;
+ lreg_t x1;
+ lreg_t x0;
+ lreg_t elr;
+ lreg_t esr;
+ frament_t trapno;
};
#define TF_IP(TFP) ((TFP)->pc)