2016-10-17 00:24:25 +08:00
|
|
|
#![allow(dead_code)]
|
2016-10-01 12:20:27 +08:00
|
|
|
|
2016-10-17 00:24:25 +08:00
|
|
|
use core::marker::PhantomData;
|
|
|
|
use core::fmt;
|
|
|
|
|
2016-11-01 02:13:15 +08:00
|
|
|
pub const KERNELCPU_EXEC_ADDRESS: usize = 0x40800000;
|
2016-10-30 05:34:25 +08:00
|
|
|
pub const KERNELCPU_PAYLOAD_ADDRESS: usize = 0x40840000;
|
2016-10-17 00:24:25 +08:00
|
|
|
pub const KERNELCPU_LAST_ADDRESS: usize = 0x4fffffff;
|
|
|
|
pub const KSUPPORT_HEADER_SIZE: usize = 0x80;
|
|
|
|
|
|
|
|
#[repr(C)]
|
|
|
|
#[derive(Debug, Clone)]
|
2016-10-01 12:20:27 +08:00
|
|
|
pub struct Exception<'a> {
|
2016-10-17 00:24:25 +08:00
|
|
|
pub name: *const u8,
|
|
|
|
pub file: *const u8,
|
2016-10-01 12:20:27 +08:00
|
|
|
pub line: u32,
|
|
|
|
pub column: u32,
|
2016-10-17 00:24:25 +08:00
|
|
|
pub function: *const u8,
|
|
|
|
pub message: *const u8,
|
2016-11-22 01:09:58 +08:00
|
|
|
pub param: [i64; 3],
|
2016-10-17 00:24:25 +08:00
|
|
|
pub phantom: PhantomData<&'a str>
|
2016-10-01 12:20:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
pub enum Message<'a> {
|
|
|
|
LoadRequest(&'a [u8]),
|
2016-10-17 00:24:25 +08:00
|
|
|
LoadReply(Result<(), &'a str>),
|
2016-10-01 12:20:27 +08:00
|
|
|
|
|
|
|
NowInitRequest,
|
|
|
|
NowInitReply(u64),
|
|
|
|
NowSave(u64),
|
|
|
|
|
|
|
|
RunFinished,
|
|
|
|
RunException {
|
|
|
|
exception: Exception<'a>,
|
2016-10-06 21:42:35 +08:00
|
|
|
backtrace: &'a [usize]
|
2016-10-01 12:20:27 +08:00
|
|
|
},
|
2016-10-17 00:24:25 +08:00
|
|
|
RunAborted,
|
2016-10-01 12:20:27 +08:00
|
|
|
|
|
|
|
WatchdogSetRequest { ms: u64 },
|
|
|
|
WatchdogSetReply { id: usize },
|
|
|
|
WatchdogClear { id: usize },
|
|
|
|
|
|
|
|
RpcSend {
|
2016-10-30 05:34:25 +08:00
|
|
|
async: bool,
|
2016-10-01 12:20:27 +08:00
|
|
|
service: u32,
|
|
|
|
tag: &'a [u8],
|
|
|
|
data: *const *const ()
|
|
|
|
},
|
2016-10-17 00:24:25 +08:00
|
|
|
RpcRecvRequest(*mut ()),
|
|
|
|
RpcRecvReply(Result<usize, Exception<'a>>),
|
2016-10-01 12:20:27 +08:00
|
|
|
|
|
|
|
CacheGetRequest { key: &'a str },
|
|
|
|
CacheGetReply { value: &'static [u32] },
|
|
|
|
CachePutRequest { key: &'a str, value: &'static [u32] },
|
|
|
|
CachePutReply { succeeded: bool },
|
|
|
|
|
2016-10-17 00:24:25 +08:00
|
|
|
Log(fmt::Arguments<'a>),
|
|
|
|
LogSlice(&'a str)
|
2016-10-01 12:20:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
pub use self::Message::*;
|