coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
smihandler.c File Reference
Include dependency graph for smihandler.c:

Go to the source code of this file.

Macros

#define LAPIC_ID   0xfee00020
 

Enumerations

enum  smi_semaphore { SMI_LOCKED , SMI_UNLOCKED , SMI_LOCKED , SMI_UNLOCKED }
 

Functions

static int smi_obtain_lock (void)
 
static void smi_release_lock (void)
 
static __always_inline unsigned long nodeid (void)
 
void io_trap_handler (int smif)
 
static void smi_set_eos (void)
 Set the EOS bit. More...
 
static void smi_backup_pci_address (void)
 Backup PCI address to make sure we do not mess up the OS. More...
 
static void smi_restore_pci_address (void)
 Restore PCI address previously backed up. More...
 
static voidsmm_save_state (uintptr_t base, int arch_offset, int node)
 
uint32_t smm_revision (void)
 
voidsmm_get_save_state (int cpu)
 
bool smm_region_overlaps_handler (const struct region *r)
 
void smi_handler (void)
 Interrupt handler for SMI#. More...
 
int __weak mainboard_io_trap_handler (int smif)
 
void __weak southbridge_smi_handler (void)
 
void __weak mainboard_smi_gpi (u32 gpi_sts)
 
int __weak mainboard_smi_apmc (u8 data)
 
void __weak mainboard_smi_sleep (u8 slp_typ)
 
void __weak mainboard_smi_finalize (void)
 

Variables

static int do_driver_init = 1
 
static volatile smi_semaphore smi_handler_status = SMI_UNLOCKED
 
static u32 pci_orig
 

Macro Definition Documentation

◆ LAPIC_ID

#define LAPIC_ID   0xfee00020

Definition at line 52 of file smihandler.c.

Enumeration Type Documentation

◆ smi_semaphore

Enumerator
SMI_LOCKED 
SMI_UNLOCKED 
SMI_LOCKED 
SMI_UNLOCKED 

Definition at line 19 of file smihandler.c.

Function Documentation

◆ io_trap_handler()

void io_trap_handler ( int  smif)

Definition at line 58 of file smihandler.c.

References BIOS_DEBUG, mainboard_io_trap_handler(), printk, and southbridge_io_trap_handler().

Referenced by smihandler_southbridge_monitor(), and southbridge_smi_monitor().

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

◆ mainboard_io_trap_handler()

int __weak mainboard_io_trap_handler ( int  smif)

Definition at line 206 of file smihandler.c.

Referenced by io_trap_handler(), and mainboard_smi_handle_ec_sci().

Here is the caller graph for this function:

◆ mainboard_smi_apmc()

int __weak mainboard_smi_apmc ( u8  data)

Definition at line 209 of file smihandler.c.

Referenced by fch_apmc_smi_handler(), hudson_apmc_smi_handler(), smihandler_southbridge_apmc(), and southbridge_smi_apmc().

Here is the caller graph for this function:

◆ mainboard_smi_finalize()

void __weak mainboard_smi_finalize ( void  )

Definition at line 211 of file smihandler.c.

Referenced by finalize().

Here is the caller graph for this function:

◆ mainboard_smi_gpi()

void __weak mainboard_smi_gpi ( u32  gpi_sts)

Definition at line 208 of file smihandler.c.

Referenced by process_gpe_smi(), process_smi_sources(), southbridge_smi_gpi(), and southbridge_smi_handler().

Here is the caller graph for this function:

◆ mainboard_smi_sleep()

void __weak mainboard_smi_sleep ( u8  slp_typ)

Definition at line 210 of file smihandler.c.

Referenced by fch_slp_typ_handler(), smihandler_southbridge_sleep(), and southbridge_smi_sleep().

Here is the caller graph for this function:

◆ nodeid()

◆ smi_backup_pci_address()

static void smi_backup_pci_address ( void  )
static

Backup PCI address to make sure we do not mess up the OS.

Definition at line 87 of file smihandler.c.

References inl(), and pci_orig.

Referenced by smi_handler().

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

◆ smi_handler()

void smi_handler ( void  )

Interrupt handler for SMI#.

Parameters
smm_revisionrevision of the smm state save map

Definition at line 145 of file smihandler.c.

References BIOS_SPEW, BIOS_WARNING, console_init(), do_driver_init, nodeid(), NULL, printk, smi_backup_pci_address(), smi_handler_status, SMI_LOCKED, smi_obtain_lock(), smi_release_lock(), smi_restore_pci_address(), smi_set_eos(), smm_get_save_state(), smm_revision(), southbridge_smi_handler(), and spi_init().

Here is the call graph for this function:

◆ smi_obtain_lock()

static int smi_obtain_lock ( void  )
static

Definition at line 25 of file smihandler.c.

References smi_handler_status, SMI_LOCKED, and SMI_UNLOCKED.

Referenced by smi_handler(), and smm_handler_start().

Here is the caller graph for this function:

◆ smi_release_lock()

static void smi_release_lock ( void  )
static

Definition at line 41 of file smihandler.c.

References smi_handler_status, and SMI_UNLOCKED.

Referenced by smi_handler().

Here is the caller graph for this function:

◆ smi_restore_pci_address()

static void smi_restore_pci_address ( void  )
static

Restore PCI address previously backed up.

Definition at line 95 of file smihandler.c.

References outl(), and pci_orig.

Referenced by smi_handler().

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

◆ smi_set_eos()

static void smi_set_eos ( void  )
static

Set the EOS bit.

Definition at line 77 of file smihandler.c.

References southbridge_smi_set_eos().

Referenced by smi_handler().

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

◆ smm_get_save_state()

void* smm_get_save_state ( int  cpu)

Definition at line 114 of file smihandler.c.

References NULL, SMM_AMD64_ARCH_OFFSET, SMM_BASE, SMM_EM64T100_ARCH_OFFSET, SMM_EM64T101_ARCH_OFFSET, SMM_LEGACY_ARCH_OFFSET, smm_revision(), and smm_save_state().

Referenced by find_save_state(), smi_apmc_find_state_save(), and smi_handler().

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

◆ smm_region_overlaps_handler()

bool smm_region_overlaps_handler ( const struct region r)

Definition at line 132 of file smihandler.c.

References region_overlap(), SMM_BASE, and SMM_DEFAULT_SIZE.

Here is the call graph for this function:

◆ smm_revision()

uint32_t smm_revision ( void  )

Definition at line 109 of file smihandler.c.

References SMM_BASE, SMM_ENTRY_OFFSET, and SMM_REVISION_OFFSET_FROM_TOP.

Referenced by init_save_state(), smi_handler(), and smm_get_save_state().

Here is the caller graph for this function:

◆ smm_save_state()

static void* smm_save_state ( uintptr_t  base,
int  arch_offset,
int  node 
)
inlinestatic

Definition at line 100 of file smihandler.c.

References base, and SMM_SAVE_STATE_BEGIN.

Referenced by smm_get_save_state().

Here is the caller graph for this function:

◆ southbridge_smi_handler()

void __weak southbridge_smi_handler ( void  )

Definition at line 207 of file smihandler.c.

Referenced by smi_handler().

Here is the caller graph for this function:

Variable Documentation

◆ do_driver_init

int do_driver_init = 1
static

Definition at line 17 of file smihandler.c.

Referenced by smi_handler().

◆ pci_orig

u32 pci_orig
static

Definition at line 82 of file smihandler.c.

Referenced by smi_backup_pci_address(), and smi_restore_pci_address().

◆ smi_handler_status

volatile smi_semaphore smi_handler_status = SMI_UNLOCKED
static

Definition at line 22 of file smihandler.c.

Referenced by smi_handler(), smi_obtain_lock(), and smi_release_lock().