From b262bb6b956bc044144d47a5e037d4af98a19a30 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sun, 6 Oct 2024 15:00:30 -0400 Subject: smaller stack; complete vector table --- src/interrupt.zig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/interrupt.zig') 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); -- cgit v1.2.3