Add hardware_exception for setting exception handlers at runtime (#380)

This commit is contained in:
Graham Sanderson
2021-05-05 11:45:39 -05:00
committed by GitHub
parent 7fc75d8c90
commit 53f1915a6b
9 changed files with 185 additions and 1 deletions

View File

@ -74,6 +74,11 @@ __vectors:
.word isr_irq30
.word isr_irq31
// all default exception handlers do nothing, and we can check for them being set to our
// default values by them pointing to between __defaults_isrs_start and __default_isrs_end
.global __default_isrs_start
__default_isrs_start:
// Declare a weak symbol for each ISR.
// By default, they will fall through to the undefined IRQ handler below (breakpoint),
// but can be overridden by C functions with correct name.
@ -94,6 +99,9 @@ decl_isr_bkpt isr_svcall
decl_isr_bkpt isr_pendsv
decl_isr_bkpt isr_systick
.global __default_isrs_end
__default_isrs_end:
.macro decl_isr name
.weak \name
.type \name,%function