hardware 0.0.9

A no_std bare-metal hardware abstraction layer — all port I/O, memory and swap allocations are guarded at runtime. Do not consider this dependency stable before x.1.x
Documentation
#[derive(Copy, Clone)]
pub struct Command {
    pub opcode: u32,
    pub data_ptr: *const u8,
    pub data_len: usize,
}

unsafe impl Send for Command {}
unsafe impl Sync for Command {}

impl Command {
    pub fn new(op: u32, data: *const u8, len: usize) -> Self {
        Command {
            opcode: op,
            data_ptr: data,
            data_len: len,
        }
    }

    pub fn nop() -> Self {
        Command {
            opcode: 0,
            data_ptr: core::ptr::null(),
            data_len: 0,
        }
    }

    pub fn is_nop(&self) -> bool {
        self.opcode == 0
    }

    pub fn submit(&self, sched: &crate::gpu::scheduler::GpuScheduler) -> bool {
        sched.submit(*self)
    }
}