use crate::types::*;
#[derive(Debug, Clone, Copy)]
pub enum Context {
Boot,
Thd,
Isr(XwIrq),
Bh,
Idle,
}
extern "C" {
fn xwrustffi_skd_get_context_lc(ctxbuf: *mut XwSq, irqnbuf: *mut XwIrq);
fn xwrustffi_skd_dspmpt_lc();
fn xwrustffi_skd_enpmpt_lc();
}
pub fn context() -> Context
{
let mut ctx: XwSq = 0;
let mut irq: XwIrq = 0;
unsafe { xwrustffi_skd_get_context_lc(&mut ctx, &mut irq); }
match ctx {
0 => Context::Boot,
1 => Context::Thd,
2 => Context::Isr(irq),
3 => Context::Bh,
_ => Context::Idle,
}
}
pub fn dspmpt() {
unsafe { xwrustffi_skd_dspmpt_lc(); }
}
pub fn enpmpt() {
unsafe { xwrustffi_skd_enpmpt_lc(); }
}