Xen Test Framework
Macros | Functions
io-apic.h File Reference

x86 IO-APIC register definitions and utility functions. More...

#include <xtf/numbers.h>
#include <xtf/types.h>
+ Include dependency graph for io-apic.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define IOAPIC_REGSEL   0x00
 
#define IOAPIC_IOWIN   0x10
 
#define IOAPIC_ID   0x0
 
#define IOAPIC_VERSION   0x1
 
#define IOAPIC_MAXREDIR_MASK   0xff0000
 
#define IOAPIC_REDIR_ENTRY(e)   (0x10 + (e) * 2)
 
#define IOAPIC_REDIR_MASK_SHIFT   16
 
#define IOAPIC_DEFAULT_BASE   0xfec00000
 

Functions

int ioapic_init (void)
 Discover and initialise the IO-APIC. More...
 
static uint32_t ioapic_read32 (unsigned int reg)
 
static uint64_t ioapic_read64 (unsigned int reg)
 
static void ioapic_write32 (unsigned int reg, uint32_t val)
 
static void ioapic_write64 (unsigned int reg, uint64_t val)
 
int ioapic_set_mask (unsigned int entry, bool mask)
 Set the mask bit on a redirection entry. More...
 

Detailed Description

x86 IO-APIC register definitions and utility functions.

The IO-APIC MMIO window is expected to be in its default location for the benefit of unpaged environments.

Definition in file io-apic.h.

Macro Definition Documentation

◆ IOAPIC_REGSEL

#define IOAPIC_REGSEL   0x00

Definition at line 17 of file io-apic.h.

◆ IOAPIC_IOWIN

#define IOAPIC_IOWIN   0x10

Definition at line 18 of file io-apic.h.

◆ IOAPIC_ID

#define IOAPIC_ID   0x0

Definition at line 21 of file io-apic.h.

◆ IOAPIC_VERSION

#define IOAPIC_VERSION   0x1

Definition at line 23 of file io-apic.h.

◆ IOAPIC_MAXREDIR_MASK

#define IOAPIC_MAXREDIR_MASK   0xff0000

Definition at line 24 of file io-apic.h.

◆ IOAPIC_REDIR_ENTRY

#define IOAPIC_REDIR_ENTRY (   e)    (0x10 + (e) * 2)

Definition at line 26 of file io-apic.h.

◆ IOAPIC_REDIR_MASK_SHIFT

#define IOAPIC_REDIR_MASK_SHIFT   16

Definition at line 27 of file io-apic.h.

◆ IOAPIC_DEFAULT_BASE

#define IOAPIC_DEFAULT_BASE   0xfec00000

Definition at line 29 of file io-apic.h.

Function Documentation

◆ ioapic_init()

int ioapic_init ( void  )

Discover and initialise the IO-APIC.

May fail if there is no IO-APIC.

Definition at line 15 of file io-apic.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ioapic_read32()

static uint32_t ioapic_read32 ( unsigned int  reg)
inlinestatic

Definition at line 36 of file io-apic.h.

+ Here is the caller graph for this function:

◆ ioapic_read64()

static uint64_t ioapic_read64 ( unsigned int  reg)
inlinestatic

Definition at line 43 of file io-apic.h.

+ Here is the call graph for this function:

◆ ioapic_write32()

static void ioapic_write32 ( unsigned int  reg,
uint32_t  val 
)
inlinestatic

Definition at line 48 of file io-apic.h.

+ Here is the caller graph for this function:

◆ ioapic_write64()

static void ioapic_write64 ( unsigned int  reg,
uint64_t  val 
)
inlinestatic

Definition at line 54 of file io-apic.h.

+ Here is the call graph for this function:

◆ ioapic_set_mask()

int ioapic_set_mask ( unsigned int  entry,
bool  mask 
)

Set the mask bit on a redirection entry.

Definition at line 29 of file io-apic.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: