enable FPU on Core1

This commit is contained in:
Sebastien Bourdeauducq 2020-06-07 15:12:34 +08:00
parent 7216e9c4be
commit 1f23a1b86c
2 changed files with 14 additions and 0 deletions

View File

@ -128,6 +128,19 @@ fn resolve(required: &[u8]) -> Option<u32> {
pub fn main_core1() {
debug!("Core1 started");
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");
}
debug!("FPU enabled on Core1");
let mut core1_tx = None;
while core1_tx.is_none() {
core1_tx = CHANNEL_1TO0.lock().take();

View File

@ -1,6 +1,7 @@
#![no_std]
#![no_main]
#![recursion_limit="1024"] // for futures_util::select!
#![feature(llvm_asm)]
extern crate alloc;