[][src]Struct sunrise_kernel::devices::lapic::LocalApic

pub struct LocalApic {
    internal: &'static UnsafeCell<LocalApicInternal>,
}

LocalApic driver.

Fields

internal: &'static UnsafeCell<LocalApicInternal>

Pointer to the LocalApic registers.

Implementations

impl LocalApic[src]

pub unsafe fn new(address: PhysicalAddress) -> Self[src]

Create a new LocalApic at the specified address.

Panics

Panics if address is not page-aligned.

Safety

address should be the physical address of a LocalApic device, and should not be shared.

pub fn enable(&self)[src]

10.4.3 Enabling or Disabling the Local APIC

The local APIC can be enabled or disabled in either of two ways:

  • Using the APIC global enable/disable flag in the IA32_APIC_BASE MSR (MSR address 1BH; see Figure 10-5)
  • Using the APIC software enable/disable flag in the spurious-interrupt vector register (see Figure 10-23)

pub fn acknowledge(&self)[src]

Acknowledge the last interrupt, signaling an end of interrupt.

See chapter 10.8: Handling Interrupts

pub fn local_apic_id(&self) -> u32[src]

Unique ID of this Local APIC. May also be used as a way to uniquely identify a CPU.

pub fn in_service(&self) -> [u32; 8][src]

The ISR contains interrupt requests that have been dispatched to the processor for servicing, but not yet acknowledged by said processor.

See chapter 10.8.4: Interrupt Acceptance for Fixed Interrupts.

pub fn trigger_mode(&self) -> [u32; 8][src]

The trigger mode register (TMR) indicates the trigger mode of the interrupt. Upon acceptance of an interrupt into the IRR, the corresponding TMR bit is cleared for edge-triggered interrupts and set for level-triggered interrupts. If a TMR bit is set when an EOI cycle for its corresponding interrupt vector is generated, an EOI message is sent to all I/O APICs.

See chapter 10.8.4: Interrupt Acceptance for Fixed Interrupts.

pub fn interrupt_request_register(&self) -> [u32; 8][src]

The IRR contains the active interrupt requests that have been accepted, but not yet dispatched to the processor for servicing.

See chapter 10.8.4: Interrupt Acceptance for Fixed Interrupts.

pub fn send_interrupt_command(&mut self, val: u64)[src]

Sends an IPI.

See 10.6 Issuing Interprocessor Interrupts

Trait Implementations

impl Debug for LocalApic[src]

impl Send for LocalApic[src]

impl Sync for LocalApic[src]

Auto Trait Implementations

impl !RefUnwindSafe for LocalApic

impl Unpin for LocalApic

impl !UnwindSafe for LocalApic

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.