clean up vtor set

main
Clyne 3 months ago
parent c539462ef7
commit 64df2e9f31
Signed by: clyne
GPG Key ID: 3267C8EBF3F9AFC7

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

Loading…
Cancel
Save