diff --git a/src/interrupt.zig b/src/interrupt.zig index 60faec6..2fe1671 100644 --- a/src/interrupt.zig +++ b/src/interrupt.zig @@ -1,5 +1,6 @@ -var vector_table: [256] *const fn () void = undefined; -var vtor: *u32 = @ptrFromInt(0xE000ED08); +const vector_table_type = [256] *const fn () void; +var vector_table: vector_table_type = undefined; +var vtor: **volatile vector_table_type = @ptrFromInt(0xE000ED08); pub const vector = enum(u8) { NMI = 2, @@ -25,7 +26,7 @@ pub fn initialize() void { register(.BusFault, busfault); register(.UsageFault, usagefault); - vtor.* = @as(u32, @intFromPtr(&vector_table)); + vtor.* = &vector_table; } pub fn register(index: vector, handler: *const fn () void) void {