runtime/kernel/core1: reset rtio after interrupted

This commit is contained in:
pca006132 2020-08-24 16:19:59 +08:00
parent 0fb278f7cb
commit 321a8e1522
1 changed files with 8 additions and 4 deletions

View File

@ -14,7 +14,7 @@ use libcortex_a9::{
use libboard_zynq::{mpcore, gic}; use libboard_zynq::{mpcore, gic};
use libsupport_zynq::ram; use libsupport_zynq::ram;
use dyld::{self, Library}; use dyld::{self, Library};
use crate::eh_artiq; use crate::{eh_artiq, rtio};
use super::{ use super::{
api::resolve, api::resolve,
rpc::rpc_send_async, rpc::rpc_send_async,
@ -137,10 +137,8 @@ impl KernelImage {
#[no_mangle] #[no_mangle]
pub fn main_core1() { pub fn main_core1() {
debug!("Core1 started");
enable_fpu(); enable_fpu();
debug!("FPU enabled on Core1"); debug!("Core1 started");
ram::init_alloc_core1(); ram::init_alloc_core1();
gic::InterruptController::gic(mpcore::RegisterBlock::mpcore()).enable_interrupts(); gic::InterruptController::gic(mpcore::RegisterBlock::mpcore()).enable_interrupts();
@ -151,6 +149,12 @@ pub fn main_core1() {
INIT_LOCK.lock(); INIT_LOCK.lock();
core0_tx.reset(); core0_tx.reset();
core1_tx.reset(); core1_tx.reset();
if !KERNEL_IMAGE.is_null() {
// indicates forceful termination of previous kernel
KERNEL_IMAGE = core::ptr::null();
debug!("rtio init");
rtio::init();
}
dma::init_dma_recorder(); dma::init_dma_recorder();
} }
*CHANNEL_0TO1.lock() = Some(core0_tx); *CHANNEL_0TO1.lock() = Some(core0_tx);