2022-03-25 18:35:38 +00:00
|
|
|
/// Do not modify the discriminants in this structure. They are used in `libstd` directly.
|
2021-03-28 10:14:41 +00:00
|
|
|
#[derive(num_derive::FromPrimitive, num_derive::ToPrimitive, Debug)]
|
|
|
|
|
pub(crate) enum Opcode {
|
2020-10-12 11:08:16 +00:00
|
|
|
/// Get the elapsed time in milliseconds
|
2021-05-20 04:47:02 +00:00
|
|
|
ElapsedMs = 0,
|
2020-11-11 08:07:55 +00:00
|
|
|
|
|
|
|
|
/// Sleep for the specified numer of milliseconds
|
2021-05-20 04:47:02 +00:00
|
|
|
SleepMs = 1,
|
2020-11-11 08:07:55 +00:00
|
|
|
|
|
|
|
|
/// Recalculate the sleep time
|
2021-05-20 04:47:02 +00:00
|
|
|
RecalculateSleep = 2,
|
2021-04-28 18:56:53 +00:00
|
|
|
|
|
|
|
|
/// Suspend/resume callback
|
2021-05-20 04:47:02 +00:00
|
|
|
SuspendResume = 3,
|
2021-07-15 15:00:50 +00:00
|
|
|
|
|
|
|
|
/// force a WDT update
|
|
|
|
|
PingWdt = 4,
|
2022-01-31 15:02:32 +00:00
|
|
|
|
2022-03-03 13:28:20 +00:00
|
|
|
/// Return the version string of Xous. We bury it here because this is a small, lightweight server we can rebuild on every run.
|
2022-01-31 15:02:32 +00:00
|
|
|
GetVersion = 5,
|
2022-03-03 13:28:20 +00:00
|
|
|
|
2022-03-11 12:39:42 +00:00
|
|
|
/// Lock the given Mutex, blocking if it is already locked.
|
2022-03-25 18:35:38 +00:00
|
|
|
///
|
2022-03-11 12:39:42 +00:00
|
|
|
/// # Arguments
|
2022-03-25 18:35:38 +00:00
|
|
|
///
|
2022-03-11 12:39:42 +00:00
|
|
|
/// *arg1*: An integer of some sort, such as the address of the Mutex
|
2022-03-03 13:28:20 +00:00
|
|
|
LockMutex = 6,
|
|
|
|
|
|
|
|
|
|
/// Unlock the given Mutex
|
2022-03-25 18:35:38 +00:00
|
|
|
///
|
2022-03-11 12:39:42 +00:00
|
|
|
/// # Arguments
|
2022-03-25 18:35:38 +00:00
|
|
|
///
|
2022-03-11 12:39:42 +00:00
|
|
|
/// *arg1*: An integer of some sort, such as the address of the Mutex
|
2022-03-03 13:28:20 +00:00
|
|
|
UnlockMutex = 7,
|
2022-03-11 12:39:42 +00:00
|
|
|
|
|
|
|
|
/// Wait for a given condition to be signalled
|
2022-03-25 18:35:38 +00:00
|
|
|
///
|
2022-03-11 12:39:42 +00:00
|
|
|
/// # Arguments
|
2022-03-25 18:35:38 +00:00
|
|
|
///
|
2022-03-11 12:39:42 +00:00
|
|
|
/// *arg1*: An integer of some sort, such as the address of the Condvar
|
|
|
|
|
/// *arg2*: The number of milliseconds to wait, or 0 to wait forever
|
|
|
|
|
WaitForCondition = 8,
|
|
|
|
|
|
|
|
|
|
/// Notify a condition
|
2022-03-25 18:35:38 +00:00
|
|
|
///
|
2022-03-11 12:39:42 +00:00
|
|
|
/// # Arguments
|
2022-03-25 18:35:38 +00:00
|
|
|
///
|
2022-03-11 12:39:42 +00:00
|
|
|
/// *arg1*: An integer of some sort, such as the address of the Condvar
|
|
|
|
|
/// *arg2*: The number of conditions to notify
|
|
|
|
|
NotifyCondition = 9,
|
2020-10-12 11:08:16 +00:00
|
|
|
}
|
2022-01-31 15:02:32 +00:00
|
|
|
|
|
|
|
|
#[derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)]
|
|
|
|
|
pub struct VersionString {
|
|
|
|
|
pub version: xous_ipc::String::<512>,
|
|
|
|
|
}
|