diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2024-10-06 15:00:30 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2024-10-06 15:00:30 -0400 |
commit | b262bb6b956bc044144d47a5e037d4af98a19a30 (patch) | |
tree | 03dc328dc63c9e63fd3bf0b0bc18434394fb1e35 /src/interrupt.zig | |
parent | 07fdd6c1dd26fae3a1e0b93b3877483c87d81f2a (diff) |
smaller stack; complete vector table
Diffstat (limited to 'src/interrupt.zig')
-rw-r--r-- | src/interrupt.zig | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/interrupt.zig b/src/interrupt.zig index 024efc5..f00fa22 100644 --- a/src/interrupt.zig +++ b/src/interrupt.zig @@ -1,8 +1,10 @@ -const vector_table_type = [256] *const fn () void; +extern const init_vector_table: [2]u32; + +const vector_table_type = [128] *const fn () void; // up to 256 var vector_table: vector_table_type align(256) = undefined; var vtor: **volatile vector_table_type = @ptrFromInt(0xE000ED08); -pub const vector = enum(u8) { +pub const vector = enum(u7) { NMI = 2, HardFault, MemManage, @@ -20,6 +22,8 @@ pub const vector = enum(u8) { }; pub fn initialize() void { + vector_table[0] = @ptrFromInt(init_vector_table[0]); + vector_table[1] = @ptrFromInt(init_vector_table[1]); register(.NMI, nmi); register(.HardFault, hardfault); register(.MemManage, memmanage); |