From 68d27ca2ee42e99c86f445fe6349c8fe0a7ae3e7 Mon Sep 17 00:00:00 2001 From: pca006132 Date: Fri, 10 Jul 2020 17:17:37 +0800 Subject: [PATCH] comms: removed core1 restart --- src/runtime/src/comms.rs | 1 - src/runtime/src/kernel/control.rs | 18 +----------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/runtime/src/comms.rs b/src/runtime/src/comms.rs index 929d5a8..94d8842 100644 --- a/src/runtime/src/comms.rs +++ b/src/runtime/src/comms.rs @@ -231,7 +231,6 @@ async fn handle_run_kernel(stream: Option<&TcpStream>, control: &Rc, control: &Rc>, stream: Option<&TcpStream>) -> Result<()> { let mut control = control.borrow_mut(); - control.restart(); control.tx.async_send(kernel::Message::LoadRequest(Arc::new(buffer))).await; let reply = control.rx.async_recv().await; match *reply { diff --git a/src/runtime/src/kernel/control.rs b/src/runtime/src/kernel/control.rs index 95593de..fb40abf 100644 --- a/src/runtime/src/kernel/control.rs +++ b/src/runtime/src/kernel/control.rs @@ -4,14 +4,13 @@ use libsupport_zynq::boot::Core1; use super::{CHANNEL_0TO1, CHANNEL_1TO0, Message}; pub struct Control { - core1: Core1, pub tx: sync_channel::Sender, pub rx: sync_channel::Receiver, } impl Control { pub fn start() -> Self { - let core1 = Core1::start(true); + Core1::start(true); let (core0_tx, core1_rx) = sync_channel(4); let (core1_tx, core0_rx) = sync_channel(4); @@ -19,23 +18,8 @@ impl Control { *CHANNEL_1TO0.lock() = Some(core1_tx); Control { - core1, tx: core0_tx, rx: core0_rx, } } - - pub fn restart(&mut self) { - *CHANNEL_0TO1.lock() = None; - *CHANNEL_1TO0.lock() = None; - - self.core1.restart(); - - let (core0_tx, core1_rx) = sync_channel(4); - let (core1_tx, core0_rx) = sync_channel(4); - *CHANNEL_0TO1.lock() = Some(core1_rx); - *CHANNEL_1TO0.lock() = Some(core1_tx); - self.tx = core0_tx; - self.rx = core0_rx; - } }