MOS Source Code
Loading...
Searching...
No Matches
apic.h File Reference
#include <mos/types.h>
+ Include dependency graph for apic.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define APIC_REG_LAPIC_ID   0x20
 

Enumerations

enum  lapic_delivery_mode_t {
  APIC_DELIVER_MODE_NORMAL = 0 , APIC_DELIVER_MODE_LOWEST_PRIORITY = 1 , APIC_DELIVER_MODE_SMI = 2 , APIC_DELIVER_MODE_NMI = 4 ,
  APIC_DELIVER_MODE_INIT = 5 , APIC_DELIVER_MODE_INIT_DEASSERT = APIC_DELIVER_MODE_INIT , APIC_DELIVER_MODE_STARTUP = 6
}
 
enum  lapic_dest_mode_t { LAPIC_DEST_MODE_PHYSICAL = 0 , LAPIC_DEST_MODE_LOGICAL = 1 }
 
enum  lapic_shorthand_t { LAPIC_SHORTHAND_NONE = 0 , LAPIC_SHORTHAND_SELF = 1 , LAPIC_SHORTHAND_ALL = 2 , LAPIC_SHORTHAND_ALL_EXCLUDING_SELF = 3 }
 
enum  ioapic_trigger_mode_t { IOAPIC_TRIGGER_MODE_EDGE = 0 , IOAPIC_TRIGGER_MODE_LEVEL = 1 }
 
enum  ioapic_polarity_t { IOAPIC_POLARITY_ACTIVE_HIGH = 0 , IOAPIC_POLARITY_ACTIVE_LOW = 1 }
 

Functions

void lapic_enable (void)
 
void lapic_interrupt (u8 vec, u8 dest, lapic_delivery_mode_t delivery_mode, lapic_dest_mode_t dest_mode, lapic_shorthand_t shorthand)
 
void lapic_interrupt_full (u8 vec, u8 dest, lapic_delivery_mode_t dliv_mode, lapic_dest_mode_t dstmode, bool lvl, bool trigger, lapic_shorthand_t sh)
 
u32 lapic_read32 (u32 offset)
 
u64 lapic_read64 (u32 offset)
 
void lapic_write32 (u32 offset, u32 value)
 
void lapic_write64 (u32 offset, u64 value)
 
void lapic_eoi (void)
 
should_inline u8 lapic_get_id (void)
 
void ioapic_init (void)
 
void ioapic_enable_with_mode (u32 irq, u32 cpu, ioapic_trigger_mode_t trigger_mode, ioapic_polarity_t polarity)
 
void ioapic_disable (u32 irq)
 
void lapic_set_timer (u32 initial_count)
 
should_inline void ioapic_enable_interrupt (u32 irq, u32 lapic_id)
 

Macro Definition Documentation

◆ APIC_REG_LAPIC_ID

#define APIC_REG_LAPIC_ID   0x20

Definition at line 8 of file apic.h.

Referenced by lapic_get_id().

Enumeration Type Documentation

◆ lapic_delivery_mode_t

Enumerator
APIC_DELIVER_MODE_NORMAL 
APIC_DELIVER_MODE_LOWEST_PRIORITY 
APIC_DELIVER_MODE_SMI 
APIC_DELIVER_MODE_NMI 
APIC_DELIVER_MODE_INIT 
APIC_DELIVER_MODE_INIT_DEASSERT 
APIC_DELIVER_MODE_STARTUP 

Definition at line 9 of file apic.h.

◆ lapic_dest_mode_t

Enumerator
LAPIC_DEST_MODE_PHYSICAL 
LAPIC_DEST_MODE_LOGICAL 

Definition at line 20 of file apic.h.

◆ lapic_shorthand_t

Enumerator
LAPIC_SHORTHAND_NONE 
LAPIC_SHORTHAND_SELF 
LAPIC_SHORTHAND_ALL 
LAPIC_SHORTHAND_ALL_EXCLUDING_SELF 

Definition at line 26 of file apic.h.

◆ ioapic_trigger_mode_t

Enumerator
IOAPIC_TRIGGER_MODE_EDGE 
IOAPIC_TRIGGER_MODE_LEVEL 

Definition at line 53 of file apic.h.

◆ ioapic_polarity_t

Enumerator
IOAPIC_POLARITY_ACTIVE_HIGH 
IOAPIC_POLARITY_ACTIVE_LOW 

Definition at line 59 of file apic.h.

Function Documentation

◆ lapic_enable()

void lapic_enable ( void )

Definition at line 136 of file lapic.c.

Referenced by platform_ap_entry(), and platform_startup_late().

+ Here is the call graph for this function:

◆ lapic_interrupt()

void lapic_interrupt ( u8 vec,
u8 dest,
lapic_delivery_mode_t delivery_mode,
lapic_dest_mode_t dest_mode,
lapic_shorthand_t shorthand )

Definition at line 111 of file lapic.c.

Referenced by platform_ipi_send().

+ Here is the call graph for this function:

◆ lapic_interrupt_full()

void lapic_interrupt_full ( u8 vec,
u8 dest,
lapic_delivery_mode_t dliv_mode,
lapic_dest_mode_t dstmode,
bool lvl,
bool trigger,
lapic_shorthand_t sh )

Definition at line 94 of file lapic.c.

Referenced by lapic_interrupt().

+ Here is the call graph for this function:

◆ lapic_read32()

u32 lapic_read32 ( u32 offset)

Definition at line 56 of file lapic.c.

Referenced by lapic_enable(), lapic_get_id(), and lapic_wait_sent().

◆ lapic_read64()

u64 lapic_read64 ( u32 offset)

Definition at line 63 of file lapic.c.

◆ lapic_write32()

void lapic_write32 ( u32 offset,
u32 value )

Definition at line 72 of file lapic.c.

Referenced by lapic_enable(), lapic_eoi(), lapic_interrupt_full(), and lapic_set_timer().

◆ lapic_write64()

void lapic_write64 ( u32 offset,
u64 value )

Definition at line 79 of file lapic.c.

Referenced by lapic_interrupt_full().

◆ lapic_eoi()

void lapic_eoi ( void )

Definition at line 158 of file lapic.c.

Referenced by x86_handle_irq(), and x86_interrupt_entry().

+ Here is the call graph for this function:

◆ lapic_get_id()

should_inline u8 lapic_get_id ( void )

Definition at line 45 of file apic.h.

Referenced by platform_ap_entry(), platform_startup_late(), x86_handle_exception(), and x86_handle_nmi().

+ Here is the call graph for this function:

◆ ioapic_init()

void ioapic_init ( void )

Definition at line 93 of file ioapic.c.

Referenced by platform_startup_late().

+ Here is the call graph for this function:

◆ ioapic_enable_with_mode()

void ioapic_enable_with_mode ( u32 irq,
u32 cpu,
ioapic_trigger_mode_t trigger_mode,
ioapic_polarity_t polarity )

Definition at line 125 of file ioapic.c.

Referenced by ioapic_enable_interrupt().

+ Here is the call graph for this function:

◆ ioapic_disable()

void ioapic_disable ( u32 irq)

Definition at line 139 of file ioapic.c.

Referenced by ioapic_init().

+ Here is the call graph for this function:

◆ lapic_set_timer()

void lapic_set_timer ( u32 initial_count)

Definition at line 151 of file lapic.c.

Referenced by x86_setup_lapic_timer().

+ Here is the call graph for this function:

◆ ioapic_enable_interrupt()

should_inline void ioapic_enable_interrupt ( u32 irq,
u32 lapic_id )

Definition at line 71 of file apic.h.

Referenced by platform_startup_late().

+ Here is the call graph for this function: