[−][src]Struct sunrise_kernel::devices::ioapic::IoApic
Fields
internal: &'static UnsafeCell<IoApicInternal>
Pointer to the IO-APIC device registers.
interrupt_base: u32
Start of the IRQ range handled by this IO-APIC device. Systems may have more than one IO-APIC if they need to handle more than 24 IRQs.
redirection_entry_count: u32
Number of entries this IO-APIC device can handled. Cached.
Implementations
impl IoApic
[src]
pub unsafe fn new(
address: PhysicalAddress,
interrupt_base: u32,
root_cpu_id: u32
) -> IoApic
[src]
address: PhysicalAddress,
interrupt_base: u32,
root_cpu_id: u32
) -> IoApic
Creates a new IO-APIC device at the given Physical Address, mapping
interrupts (typically 24) starting from interrupt_base
.
The IOAPIC will be initialized with sane values: every redirection entry
will be masked, their interrupt vector set to 0x20 + interrupt_idx, and
their destination CPU to root_cpu_id
.
Safety
Address should point to an IO-APIC, and must not be shared.
fn read(&self, offset: u32) -> u32
[src]
Reads an u32 at the specified DWORD offset.
fn write(&self, offset: u32, data: u32)
[src]
Writes an u32 at the specified DWORD offset.
pub fn ioapic_id(&self) -> u32
[src]
This register contains the 4-bit APIC ID. The ID serves as a physical name of the IOAPIC. All APIC devices using the APIC bus should have a unique APIC ID.
pub fn version(&self) -> u8
[src]
Gets the version number of this IO-APIC device. This is expected to be 0x11 or 0x20.
pub fn interrupt_base(&self) -> u32
[src]
Start of the IRQ range handled by this IO-APIC device. Systems may have more than one IO-APIC if they need to handle more than 24 IRQs.
pub fn redirection_entry_count(&self) -> u32
[src]
Gets the number of redirection entries in the I/O Redirection Table. This is expected to be 24, although more recent I/O-APIC devices may have more.
pub fn arbitration_id(&self) -> u32
[src]
Gets the bus arbitration priority for the IOAPIC. This register is loaded when the IOAPIC ID Register is written.
The APIC uses a one wire arbitration to win bus ownership. A rotating priority scheme is used for arbitration. The winner of the arbitration becomes the lowest priority agent and assumes an arbitration ID of 0.
All other agents, except the agent whose arbitration ID is 15, increment their arbitration IDs by one. The agent whose ID was 15 takes the winner's arbitration ID and increments it by one. Arbitration IDs are changed (incremented or asssumed) only for messages that are transmitted successfully (except, in the case of low priority messages where Arbitration ID is changed even if message was not successfully transmitted). A message is transmitted successfully if no checksum error or acceptance error is reported for that message. The register is always loaded with IOAPIC ID during a "level triggered INIT with de-assert" message.
pub fn redirection_entry(&self, entry: u8) -> RedirectionEntry
[src]
Gets the RedirectionEntry configuration of the specified pin.
pub fn set_redirection_entry(&self, entry: u8, data: RedirectionEntry)
[src]
Configure the given pin with a RedirectionEntry.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,