use core::ptr; use alloc::{vec::Vec, sync::Arc, string::String}; use dyld::Library; use libcortex_a9::{mutex::Mutex, sync_channel}; use crate::eh_artiq; mod control; pub use control::Control; pub mod core1; mod api; mod rpc; mod dma; #[derive(Debug)] pub struct RPCException { pub name: String, pub message: String, pub param: [i64; 3], pub file: String, pub line: i32, pub column: i32, pub function: String } #[derive(Debug)] pub enum Message { LoadRequest(Arc>), LoadCompleted, LoadFailed, StartRequest, KernelFinished, KernelException(&'static eh_artiq::Exception<'static>, &'static [usize]), RpcSend { is_async: bool, data: Arc> }, RpcRecvRequest(*mut ()), RpcRecvReply(Result), } static CHANNEL_0TO1: Mutex>> = Mutex::new(None); static CHANNEL_1TO0: Mutex>> = Mutex::new(None); static mut KERNEL_CHANNEL_0TO1: *mut () = ptr::null_mut(); static mut KERNEL_CHANNEL_1TO0: *mut () = ptr::null_mut(); static mut KERNEL_LIBRARY: *mut Library = ptr::null_mut();