forked from M-Labs/zynq-rs
1
0
Fork 0
zynq-rs/libcortex_a9/src/fpu.rs

15 lines
322 B
Rust
Raw Normal View History

2020-07-03 16:02:34 +08:00
/// Enable FPU in the current core.
pub fn enable_fpu() {
unsafe {
llvm_asm!("
mrc p15, 0, r1, c1, c0, 2
orr r1, r1, (0b1111<<20)
mcr p15, 0, r1, c1, c0, 2
vmrs r1, fpexc
orr r1, r1, (1<<30)
vmsr fpexc, r1
":::"r1");
}
}