coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
smm_module_handler.c File Reference
#include <arch/io.h>
#include <console/cbmem_console.h>
#include <console/console.h>
#include <commonlib/region.h>
#include <cpu/x86/smm.h>
#include <rmodule.h>
Include dependency graph for smm_module_handler.c:

Go to the source code of this file.

Enumerations

enum  smi_semaphore { SMI_LOCKED , SMI_UNLOCKED , SMI_LOCKED , SMI_UNLOCKED }
 

Functions

static const volatile __attribute ((aligned(4), __section__(".module_parameters")))
 
static void smi_release_lock (void)
 
void smm_get_cbmemc_buffer (void **buffer_out, size_t *size_out)
 
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...
 
voidsmm_get_save_state (int cpu)
 
uint32_t smm_revision (void)
 
bool smm_region_overlaps_handler (const struct region *r)
 
asmlinkage void smm_handler_start (void *arg)
 
 RMODULE_ENTRY (smm_handler_start)
 
int __weak mainboard_io_trap_handler (int smif)
 
void __weak cpu_smi_handler (void)
 
void __weak northbridge_smi_handler (void)
 
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)
 
void __weak smm_soc_early_init (void)
 
void __weak smm_soc_exit (void)
 

Variables

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

Enumeration Type Documentation

◆ smi_semaphore

Enumerator
SMI_LOCKED 
SMI_UNLOCKED 
SMI_LOCKED 
SMI_UNLOCKED 

Definition at line 16 of file smm_module_handler.c.

Function Documentation

◆ __attribute()

static const volatile __attribute ( (aligned(4), __section__(".module_parameters"))  )
static

Definition at line 23 of file smm_module_handler.c.

References smi_handler_status, SMI_LOCKED, and SMI_UNLOCKED.

◆ cpu_smi_handler()

void __weak cpu_smi_handler ( void  )

Definition at line 206 of file smm_module_handler.c.

Referenced by smm_handler_start().

Here is the caller graph for this function:

◆ io_trap_handler()

void io_trap_handler ( int  smif)

Definition at line 58 of file smm_module_handler.c.

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

Here is the call graph for this function:

◆ mainboard_io_trap_handler()

int __weak mainboard_io_trap_handler ( int  smif)

Definition at line 205 of file smm_module_handler.c.

Referenced by io_trap_handler().

Here is the caller graph for this function:

◆ mainboard_smi_apmc()

int __weak mainboard_smi_apmc ( u8  data)

Definition at line 210 of file smm_module_handler.c.

◆ mainboard_smi_finalize()

void __weak mainboard_smi_finalize ( void  )

Definition at line 212 of file smm_module_handler.c.

◆ mainboard_smi_gpi()

void __weak mainboard_smi_gpi ( u32  gpi_sts)

Definition at line 209 of file smm_module_handler.c.

◆ mainboard_smi_sleep()

void __weak mainboard_smi_sleep ( u8  slp_typ)

Definition at line 211 of file smm_module_handler.c.

◆ northbridge_smi_handler()

void __weak northbridge_smi_handler ( void  )

Definition at line 207 of file smm_module_handler.c.

Referenced by smm_handler_start().

Here is the caller graph for this function:

◆ RMODULE_ENTRY()

RMODULE_ENTRY ( smm_handler_start  )

◆ 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 smm_module_handler.c.

References inl(), and pci_orig.

Referenced by smm_handler_start().

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

◆ smi_release_lock()

static void smi_release_lock ( void  )
static

Definition at line 41 of file smm_module_handler.c.

References smi_handler_status, and SMI_UNLOCKED.

Referenced by smm_handler_start().

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 smm_module_handler.c.

References outl(), and pci_orig.

Referenced by smm_handler_start().

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 smm_module_handler.c.

References southbridge_smi_set_eos().

Referenced by smm_handler_start().

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

◆ smm_get_cbmemc_buffer()

void smm_get_cbmemc_buffer ( void **  buffer_out,
size_t size_out 
)

Definition at line 52 of file smm_module_handler.c.

References smm_runtime::cbmemc, and smm_runtime::cbmemc_size.

Referenced by cbmemc_init().

Here is the caller graph for this function:

◆ smm_get_save_state()

void* smm_get_save_state ( int  cpu)

Definition at line 102 of file smm_module_handler.c.

References NULL, smm_runtime::num_cpus, smm_runtime::save_state_size, and smm_runtime::save_state_top.

Referenced by smm_revision().

Here is the caller graph for this function:

◆ smm_handler_start()

◆ smm_region_overlaps_handler()

bool smm_region_overlaps_handler ( const struct region r)

Definition at line 118 of file smm_module_handler.c.

References region_overlap(), smm_runtime::smbase, SMM_BASE, SMM_DEFAULT_SIZE, and smm_runtime::smm_size.

Referenced by smm_points_to_smram().

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

◆ smm_revision()

uint32_t smm_revision ( void  )

Definition at line 110 of file smm_module_handler.c.

References save_state, smm_runtime::save_state_size, smm_get_save_state(), and SMM_REVISION_OFFSET_FROM_TOP.

Here is the call graph for this function:

◆ smm_soc_early_init()

void __weak smm_soc_early_init ( void  )

Definition at line 214 of file smm_module_handler.c.

Referenced by smm_handler_start().

Here is the caller graph for this function:

◆ smm_soc_exit()

void __weak smm_soc_exit ( void  )

Definition at line 215 of file smm_module_handler.c.

Referenced by smm_handler_start().

Here is the caller graph for this function:

◆ southbridge_smi_handler()

void __weak southbridge_smi_handler ( void  )

Definition at line 208 of file smm_module_handler.c.

Referenced by smm_handler_start().

Here is the caller graph for this function:

Variable Documentation

◆ do_driver_init

int do_driver_init = 1
static

Definition at line 14 of file smm_module_handler.c.

Referenced by smm_handler_start().

◆ gnvs

◆ pci_orig

u32 pci_orig
static

Definition at line 82 of file smm_module_handler.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 20 of file smm_module_handler.c.

Referenced by __attribute(), smi_release_lock(), and smm_handler_start().