From c1f61b5673af051b4a9db3e8616e816ddbec5bbf Mon Sep 17 00:00:00 2001 From: pca006132 Date: Mon, 3 Aug 2020 11:21:38 +0800 Subject: [PATCH] libcortex_a9/boot: enable IRQ on reset. --- libcortex_a9/src/asm.rs | 6 ++++++ libsupport_zynq/src/boot.rs | 2 ++ 2 files changed, 8 insertions(+) diff --git a/libcortex_a9/src/asm.rs b/libcortex_a9/src/asm.rs index 5c2019b..b552028 100644 --- a/libcortex_a9/src/asm.rs +++ b/libcortex_a9/src/asm.rs @@ -33,3 +33,9 @@ pub fn dsb() { pub fn isb() { unsafe { llvm_asm!("isb" :::: "volatile") } } + +/// Enable IRQ +#[inline] +pub unsafe fn enable_irq() { + llvm_asm!("cpsie i":::: "volatile"); +} diff --git a/libsupport_zynq/src/boot.rs b/libsupport_zynq/src/boot.rs index 6960859..67e6834 100644 --- a/libsupport_zynq/src/boot.rs +++ b/libsupport_zynq/src/boot.rs @@ -57,6 +57,7 @@ unsafe fn boot_core0() -> ! { asm::dmb(); asm::dsb(); + asm::enable_irq(); main_core0(); panic!("return from main"); }); @@ -77,6 +78,7 @@ unsafe fn boot_core1() -> ! { asm::dmb(); asm::dsb(); + asm::enable_irq(); main_core1(); panic!("return from main_core1"); });