smaller stack; complete vector table

main
Clyne 3 months ago
parent 07fdd6c1dd
commit b262bb6b95
Signed by: clyne
GPG Key ID: 3267C8EBF3F9AFC7

@ -46,7 +46,7 @@ SECTIONS {
.stack : {
. = ALIGN(4);
_bstack = .;
. += 2048;
. += 1024;
_tstack = .;
} > RAM
}

@ -5,6 +5,8 @@
.extern _tstack
.section .vector_table
.global init_vector_table
init_vector_table:
.word _tstack
.word _start
.skip 4 * 14

@ -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);

Loading…
Cancel
Save