forked from M-Labs/artiq-zynq
Compare commits
No commits in common. "851ed095df714730d9f59845924929d9f002275e" and "64fecf09b7cc994269a6905eb140576539a6b482" have entirely different histories.
851ed095df
...
64fecf09b7
|
@ -224,14 +224,13 @@ async fn handle_run_kernel(stream: Option<&TcpStream>, control: &Rc<RefCell<kern
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
kernel::Message::KernelFinished { async_errors } => {
|
kernel::Message::KernelFinished => {
|
||||||
if let Some(stream) = stream {
|
if let Some(stream) = stream {
|
||||||
write_header(stream, Reply::KernelFinished).await?;
|
write_header(stream, Reply::KernelFinished).await?;
|
||||||
write_i8(stream, async_errors as i8).await?;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
},
|
},
|
||||||
kernel::Message::KernelException(exception, backtrace, async_errors) => {
|
kernel::Message::KernelException(exception, backtrace) => {
|
||||||
match stream {
|
match stream {
|
||||||
Some(stream) => {
|
Some(stream) => {
|
||||||
// only send the exception data to host if there is host,
|
// only send the exception data to host if there is host,
|
||||||
|
@ -250,7 +249,6 @@ async fn handle_run_kernel(stream: Option<&TcpStream>, control: &Rc<RefCell<kern
|
||||||
for &addr in backtrace {
|
for &addr in backtrace {
|
||||||
write_i32(stream, addr as i32).await?;
|
write_i32(stream, addr as i32).await?;
|
||||||
}
|
}
|
||||||
write_i8(stream, async_errors as i8).await?;
|
|
||||||
},
|
},
|
||||||
None => {
|
None => {
|
||||||
error!("Uncaught kernel exception: {:?}", exception);
|
error!("Uncaught kernel exception: {:?}", exception);
|
||||||
|
|
|
@ -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, get_async_errors, rtio};
|
use crate::{eh_artiq, rtio};
|
||||||
use super::{
|
use super::{
|
||||||
api::resolve,
|
api::resolve,
|
||||||
rpc::rpc_send_async,
|
rpc::rpc_send_async,
|
||||||
|
@ -192,8 +192,7 @@ pub extern "C" fn main_core1() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
info!("kernel finished");
|
info!("kernel finished");
|
||||||
let async_errors = unsafe { get_async_errors() };
|
core1_tx.send(Message::KernelFinished);
|
||||||
core1_tx.send(Message::KernelFinished { async_errors });
|
|
||||||
}
|
}
|
||||||
_ => error!("Core1 received unexpected message: {:?}", message),
|
_ => error!("Core1 received unexpected message: {:?}", message),
|
||||||
}
|
}
|
||||||
|
@ -217,8 +216,7 @@ pub fn terminate(exception: &'static eh_artiq::Exception<'static>, backtrace: &'
|
||||||
|
|
||||||
{
|
{
|
||||||
let core1_tx = unsafe { KERNEL_CHANNEL_1TO0.as_mut().unwrap() };
|
let core1_tx = unsafe { KERNEL_CHANNEL_1TO0.as_mut().unwrap() };
|
||||||
let errors = unsafe { get_async_errors() };
|
core1_tx.send(Message::KernelException(exception, &backtrace[..cursor]));
|
||||||
core1_tx.send(Message::KernelException(exception, &backtrace[..cursor], errors));
|
|
||||||
}
|
}
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,10 +30,8 @@ pub enum Message {
|
||||||
LoadCompleted,
|
LoadCompleted,
|
||||||
LoadFailed,
|
LoadFailed,
|
||||||
StartRequest,
|
StartRequest,
|
||||||
KernelFinished {
|
KernelFinished,
|
||||||
async_errors: u8
|
KernelException(&'static eh_artiq::Exception<'static>, &'static [usize]),
|
||||||
},
|
|
||||||
KernelException(&'static eh_artiq::Exception<'static>, &'static [usize], u8),
|
|
||||||
RpcSend { is_async: bool, data: Vec<u8> },
|
RpcSend { is_async: bool, data: Vec<u8> },
|
||||||
RpcRecvRequest(*mut ()),
|
RpcRecvRequest(*mut ()),
|
||||||
RpcRecvReply(Result<usize, RPCException>),
|
RpcRecvReply(Result<usize, RPCException>),
|
||||||
|
|
|
@ -42,13 +42,6 @@ mod analyzer;
|
||||||
mod irq;
|
mod irq;
|
||||||
mod i2c;
|
mod i2c;
|
||||||
|
|
||||||
static mut SEEN_ASYNC_ERRORS: u8 = 0;
|
|
||||||
|
|
||||||
pub unsafe fn get_async_errors() -> u8 {
|
|
||||||
let errors = SEEN_ASYNC_ERRORS;
|
|
||||||
SEEN_ASYNC_ERRORS = 0;
|
|
||||||
errors
|
|
||||||
}
|
|
||||||
|
|
||||||
fn wait_for_async_rtio_error() -> nb::Result<(), Void> {
|
fn wait_for_async_rtio_error() -> nb::Result<(), Void> {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -77,7 +70,6 @@ async fn report_async_rtio_errors() {
|
||||||
error!("RTIO sequence error involving channel {}",
|
error!("RTIO sequence error involving channel {}",
|
||||||
pl::csr::rtio_core::sequence_error_channel_read());
|
pl::csr::rtio_core::sequence_error_channel_read());
|
||||||
}
|
}
|
||||||
SEEN_ASYNC_ERRORS = errors;
|
|
||||||
pl::csr::rtio_core::async_error_write(errors);
|
pl::csr::rtio_core::async_error_write(errors);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue