FPU: moved enable function to zc706
This commit is contained in:
parent
f0697c3ec3
commit
90e33f688a
14
libcortex_a9/src/fpu.rs
Normal file
14
libcortex_a9/src/fpu.rs
Normal file
@ -0,0 +1,14 @@
|
||||
/// 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");
|
||||
}
|
||||
}
|
@ -11,6 +11,8 @@ pub mod mmu;
|
||||
pub mod mutex;
|
||||
pub mod sync_channel;
|
||||
mod uncached;
|
||||
mod fpu;
|
||||
pub use uncached::UncachedSlice;
|
||||
pub use fpu::enable_fpu;
|
||||
|
||||
global_asm!(include_str!("exceptions.s"));
|
||||
|
Loading…
Reference in New Issue
Block a user