#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(transparent)]
pub struct DeviceLeaseId(u64);
impl DeviceLeaseId {
#[must_use]
pub const fn new(id: u64) -> Self {
Self(id)
}
#[must_use]
pub const fn as_u64(self) -> u64 {
self.0
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[repr(u8)]
pub enum DeviceClass {
Network = 0,
Storage = 1,
Graphics = 2,
Serial = 3,
Timer = 4,
InterruptController = 5,
Generic = 255,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(u8)]
pub enum GpuMemoryType {
DeviceLocal = 0,
HostVisible = 1,
Unified = 2,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
#[repr(u8)]
pub enum GpuQueuePriority {
Low = 0,
Normal = 1,
High = 2,
Realtime = 3,
}
#[derive(Debug, Clone, Copy)]
pub struct DeviceLease {
pub id: DeviceLeaseId,
pub class: DeviceClass,
pub mmio_base: u64,
pub mmio_size: u64,
pub expiry_ns: u64,
pub epoch: u32,
}