diff --git a/arch/cortex-m/src/scb.rs b/arch/cortex-m/src/scb.rs index 8107f16..a271db9 100644 --- a/arch/cortex-m/src/scb.rs +++ b/arch/cortex-m/src/scb.rs @@ -9,7 +9,7 @@ use kernel::common::StaticRef; struct ScbRegisters { cpuid: VolatileCell, icsr: VolatileCell, - vtor: VolatileCell, + vtor: VolatileCell<*const ()>, aircr: VolatileCell, scr: VolatileCell, ccr: VolatileCell, @@ -54,3 +54,8 @@ pub unsafe fn reset() { let reset = (0x5FA << 16) | (aircr & (0x7 << 8)) | (1 << 2); SCB.aircr.set(reset); } + +/// relocate interrupt vector table +pub unsafe fn set_vector_table_offset(offset: *const ()) { + SCB.vtor.set(offset); +}