forked from M-Labs/zynq-rs
add isb after cpacr update
This commit is contained in:
parent
12cb5c0651
commit
38852ef7c7
@ -1,12 +1,14 @@
|
|||||||
use core::arch::asm;
|
use core::arch::asm;
|
||||||
/// Enable FPU in the current core.
|
/// 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() {
|
pub fn enable_fpu() {
|
||||||
unsafe {
|
unsafe {
|
||||||
asm!("
|
asm!("
|
||||||
mrc p15, 0, r1, c1, c0, 2
|
mrc p15, 0, r1, c1, c0, 2
|
||||||
orr r1, r1, (0b1111<<20)
|
orr r1, r1, (0b1111<<20)
|
||||||
mcr p15, 0, r1, c1, c0, 2
|
mcr p15, 0, r1, c1, c0, 2
|
||||||
|
isb
|
||||||
vmrs r1, fpexc
|
vmrs r1, fpexc
|
||||||
orr r1, r1, (1<<30)
|
orr r1, r1, (1<<30)
|
||||||
vmsr fpexc, r1
|
vmsr fpexc, r1
|
||||||
|
Loading…
Reference in New Issue
Block a user