From 38852ef7c7fee9ee7019fd734994294a3c74ab0f Mon Sep 17 00:00:00 2001 From: Simon Renblad Date: Mon, 6 Jan 2025 11:17:13 +0800 Subject: [PATCH] add isb after cpacr update --- libcortex_a9/src/fpu.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libcortex_a9/src/fpu.rs b/libcortex_a9/src/fpu.rs index c4dd568..6daa144 100644 --- a/libcortex_a9/src/fpu.rs +++ b/libcortex_a9/src/fpu.rs @@ -1,12 +1,14 @@ use core::arch::asm; /// Enable FPU in the current core. +/// You must execute an ISB immediately after an update of the CPACR. +/// https://developer.arm.com/documentation/ddi0388/i/system-control/register-descriptions/coprocessor-access-control-register pub fn enable_fpu() { unsafe { asm!(" mrc p15, 0, r1, c1, c0, 2 orr r1, r1, (0b1111<<20) mcr p15, 0, r1, c1, c0, 2 - + isb vmrs r1, fpexc orr r1, r1, (1<<30) vmsr fpexc, r1