pub type InterruptTrigger = axvm_types::InterruptTriggerMode;
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
#[repr(transparent)]
pub struct InterruptControllerId(usize);
impl InterruptControllerId {
pub const fn new(value: usize) -> Self {
Self(value)
}
pub const fn value(self) -> usize {
self.0
}
}
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
#[repr(transparent)]
pub struct ControllerInputId(usize);
impl ControllerInputId {
pub const fn new(value: usize) -> Self {
Self(value)
}
pub const fn value(self) -> usize {
self.0
}
}
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
#[repr(transparent)]
pub struct HostIrqId(usize);
impl HostIrqId {
pub const fn new(value: usize) -> Self {
Self(value)
}
pub const fn value(self) -> usize {
self.0
}
}
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
#[repr(transparent)]
pub struct ItsId(u32);
impl ItsId {
pub const fn new(value: u32) -> Self {
Self(value)
}
pub const fn value(self) -> u32 {
self.0
}
}
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
#[repr(transparent)]
pub struct LpiId(u32);
impl LpiId {
pub const fn new(value: u32) -> Self {
Self(value)
}
pub const fn value(self) -> u32 {
self.0
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum InterruptSharing {
Exclusive,
Shared,
}
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
#[repr(transparent)]
pub struct InterruptSourceId(u64);
impl InterruptSourceId {
pub(crate) const fn new(value: u64) -> Self {
Self(value)
}
pub const fn value(self) -> u64 {
self.0
}
}
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
#[repr(transparent)]
pub struct MsiDeviceId(u32);
impl MsiDeviceId {
pub const fn new(value: u32) -> Self {
Self(value)
}
pub const fn value(self) -> u32 {
self.0
}
}
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
#[repr(transparent)]
pub struct MsiEventId(u32);
impl MsiEventId {
pub const fn new(value: u32) -> Self {
Self(value)
}
pub const fn value(self) -> u32 {
self.0
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum InterruptEndpoint {
Controller(InterruptControllerId),
Wired {
controller: InterruptControllerId,
input: ControllerInputId,
},
Message {
controller: InterruptControllerId,
its: ItsId,
device: MsiDeviceId,
event: MsiEventId,
lpi: LpiId,
},
}