feat(kernel): add vectors.S and Exceptions.h/c as a stub for future exceptions handling

This commit is contained in:
karina
2026-04-23 22:03:18 +04:00
parent 502413b9ab
commit 93bce5a46d
6 changed files with 171 additions and 1 deletions
+67
View File
@@ -0,0 +1,67 @@
#pragma once
#include <types.h>
typedef struct ExceptionsContext {
UInt64 x0;
UInt64 x1;
UInt64 x2;
UInt64 x3;
UInt64 x4;
UInt64 x5;
UInt64 x6;
UInt64 x7;
UInt64 x8;
UInt64 x9;
UInt64 x10;
UInt64 x11;
UInt64 x12;
UInt64 x13;
UInt64 x14;
UInt64 x15;
UInt64 x16;
UInt64 x17;
UInt64 x18;
UInt64 x19;
UInt64 x20;
UInt64 x21;
UInt64 x22;
UInt64 x23;
UInt64 x24;
UInt64 x25;
UInt64 x26;
UInt64 x27;
UInt64 x28;
UInt64 x29; // fp
UInt64 x30; // lr
UInt64 elr_el1; // pc
UInt64 spsr_el1; // cpu status
UInt64 esr_el1; // error reason
} ExceptionsContext;
typedef enum ExceptionsType {
// curr el with sp0 (EL1t)
// usually dont happen cuz we switch to sp_el1, but just in case
ExceptionsSyncEl1t,
ExceptionsIRQEl1t,
ExceptionsFIQEl1t,
ExceptionsSErrorEl1t,
// curr el with sp1 (EL1h)
// exception in kernel space
ExceptionsSyncEl1h,
ExceptionsIRQEl1h,
ExceptionsFIQEl1h,
ExceptionsSErrorEl1h,
// lower EL 64-bit from userspace
ExceptionsSyncEl064,
ExceptionsIRQEl064,
ExceptionsFIQEl064,
ExceptionsSErrorEl064,
// lower EL 32-bit from userspace
ExceptionsSyncEl032,
ExceptionsIRQEl032,
ExceptionsFIQEl032,
ExceptionsSErrorEl032,
} ExceptionsType;