coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
acpi_bert_storage.c File Reference
#include <bootstate.h>
#include <cbmem.h>
#include <console/console.h>
#include <cpu/x86/name.h>
#include <cpu/x86/msr.h>
#include <cpu/x86/lapic.h>
#include <acpi/acpi.h>
#include <arch/bert_storage.h>
#include <string.h>
#include <types.h>
Include dependency graph for acpi_bert_storage.c:

Go to the source code of this file.

Functions

size_t bert_storage_remaining (void)
 
bool bert_errors_present (void)
 
void bert_errors_region (void **start, size_t *size)
 
static voidbert_allocate_storage (size_t size)
 
static voidacpi_hest_generic_data_nth (acpi_generic_error_status_t *status, int num)
 
static void revise_error_sizes (acpi_generic_error_status_t *status, size_t size)
 
static acpi_generic_error_status_tnew_bert_status (void)
 
static acpi_hest_generic_data_v300_tnew_generic_error_entry (acpi_generic_error_status_t *status)
 
static size_t sizeof_error_section (guid_t *guid)
 
voidnew_cper_fw_error_crashlog (acpi_generic_error_status_t *status, size_t cl_size)
 
acpi_hest_generic_data_v300_tbert_append_fw_err (acpi_generic_error_status_t *status)
 
acpi_hest_generic_data_v300_tbert_append_error_datasection (acpi_generic_error_status_t *status, guid_t *guid)
 
acpi_hest_generic_data_v300_tbert_append_genproc (acpi_generic_error_status_t *status)
 
cper_ia32x64_context_tnew_cper_ia32x64_ctx (acpi_generic_error_status_t *status, cper_ia32x64_proc_error_section_t *x86err, int type, int num)
 
cper_ia32x64_proc_error_info_tnew_cper_ia32x64_check (acpi_generic_error_status_t *status, cper_ia32x64_proc_error_section_t *x86err, enum cper_x86_check_type type)
 
acpi_hest_generic_data_v300_tbert_append_ia32x64 (acpi_generic_error_status_t *status)
 
static const char * generic_error_name (guid_t *guid)
 
acpi_generic_error_status_tbert_new_event (guid_t *guid)
 
cper_ia32x64_context_tcper_new_ia32x64_context_msr (acpi_generic_error_status_t *status, cper_ia32x64_proc_error_section_t *x86err, u32 addr, int num)
 
__weak void bert_reserved_region (void **start, size_t *size)
 
static void bert_storage_setup (void *unused)
 
 BOOT_STATE_INIT_ENTRY (BS_PRE_DEVICE, BS_ON_EXIT, bert_storage_setup, NULL)
 

Variables

static bool bert_region_broken
 
static voidbert_region_base
 
static size_t bert_region_size
 
static size_t bert_region_used
 
static const char *const generic_error_types []
 

Function Documentation

◆ acpi_hest_generic_data_nth()

static void* acpi_hest_generic_data_nth ( acpi_generic_error_status_t status,
int  num 
)
static

Definition at line 76 of file acpi_bert_storage.c.

References bert_entry_count(), acpi_hest_generic_data_v300::data_length, HEST_GENERIC_ENTRY_V300, NULL, and acpi_hest_generic_data_v300::revision.

Referenced by revise_error_sizes().

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

◆ bert_allocate_storage()

static void* bert_allocate_storage ( size_t  size)
static

◆ bert_append_error_datasection()

acpi_hest_generic_data_v300_t* bert_append_error_datasection ( acpi_generic_error_status_t status,
guid_t *  guid 
)

Definition at line 242 of file acpi_bert_storage.c.

References bert_allocate_storage(), bert_storage_remaining(), guidcpy(), new_generic_error_entry(), NULL, revise_error_sizes(), acpi_hest_generic_data_v300::section_type, and sizeof_error_section().

Referenced by bert_append_fw_err(), bert_append_genproc(), and bert_append_ia32x64().

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

◆ bert_append_fw_err()

◆ bert_append_genproc()

◆ bert_append_ia32x64()

◆ bert_errors_present()

bool bert_errors_present ( void  )

Definition at line 37 of file acpi_bert_storage.c.

References bert_region_broken, and bert_region_used.

Referenced by bert_should_generate_acpi_table().

Here is the caller graph for this function:

◆ bert_errors_region()

void bert_errors_region ( void **  start,
size_t size 
)

Definition at line 42 of file acpi_bert_storage.c.

References bert_region_base, bert_region_broken, bert_region_used, and NULL.

Referenced by acpi_soc_get_bert_region().

Here is the caller graph for this function:

◆ bert_new_event()

acpi_generic_error_status_t* bert_new_event ( guid_t *  guid)

◆ bert_reserved_region()

__weak void bert_reserved_region ( void **  start,
size_t size 
)

Definition at line 573 of file acpi_bert_storage.c.

References BIOS_ERR, NULL, and printk.

Referenced by bert_storage_setup().

Here is the caller graph for this function:

◆ bert_storage_remaining()

size_t bert_storage_remaining ( void  )

Definition at line 32 of file acpi_bert_storage.c.

References bert_region_broken, bert_region_size, and bert_region_used.

Referenced by bert_append_error_datasection(), bert_new_event(), and build_bert_mca_error().

Here is the caller graph for this function:

◆ bert_storage_setup()

static void bert_storage_setup ( void unused)
static

Definition at line 581 of file acpi_bert_storage.c.

References bert_region_base, bert_region_broken, bert_region_size, bert_region_used, bert_reserved_region(), BIOS_ERR, memset(), and printk.

Here is the call graph for this function:

◆ BOOT_STATE_INIT_ENTRY()

BOOT_STATE_INIT_ENTRY ( BS_PRE_DEVICE  ,
BS_ON_EXIT  ,
bert_storage_setup  ,
NULL   
)

◆ cper_new_ia32x64_context_msr()

cper_ia32x64_context_t* cper_new_ia32x64_context_msr ( acpi_generic_error_status_t status,
cper_ia32x64_proc_error_section_t x86err,
u32  addr,
int  num 
)

Definition at line 547 of file acpi_bert_storage.c.

References addr, cper_ia32x64_context::array_size, CPER_IA32X64_CTX_MSR, cper_ia32x64_context::msr_addr, new_cper_ia32x64_ctx(), NULL, and rdmsr().

Referenced by build_bert_mca_error().

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

◆ generic_error_name()

static const char* generic_error_name ( guid_t *  guid)
static

◆ new_bert_status()

static acpi_generic_error_status_t* new_bert_status ( void  )
static

Definition at line 124 of file acpi_bert_storage.c.

References ACPI_GENERROR_SEV_NONE, bert_allocate_storage(), BIOS_ERR, acpi_generic_error_status::error_severity, NULL, and printk.

Referenced by bert_new_event().

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

◆ new_cper_fw_error_crashlog()

void* new_cper_fw_error_crashlog ( acpi_generic_error_status_t status,
size_t  cl_size 
)

Definition at line 199 of file acpi_bert_storage.c.

References bert_allocate_storage(), BIOS_ERR, NULL, printk, and revise_error_sizes().

Here is the call graph for this function:

◆ new_cper_ia32x64_check()

◆ new_cper_ia32x64_ctx()

◆ new_generic_error_entry()

◆ revise_error_sizes()

static void revise_error_sizes ( acpi_generic_error_status_t status,
size_t  size 
)
static

◆ sizeof_error_section()

static size_t sizeof_error_section ( guid_t *  guid)
static

Definition at line 185 of file acpi_bert_storage.c.

References BIOS_ERR, CPER_SEC_FW_ERR_REC_REF_GUID, CPER_SEC_PROC_GENERIC_GUID, CPER_SEC_PROC_IA32X64_GUID, guidcmp(), and printk.

Referenced by bert_append_error_datasection(), and bert_new_event().

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

Variable Documentation

◆ bert_region_base

void* bert_region_base
static

◆ bert_region_broken

◆ bert_region_size

size_t bert_region_size
static

◆ bert_region_used

◆ generic_error_types

const char* const generic_error_types[]
static
Initial value:
= {
"PROCESSOR_GENERIC",
"PROCESSOR_SPECIFIC_X86",
"PROCESSOR_SPECIFIC_ARM",
"PLATFORM_MEMORY",
"PLATFORM_MEMORY2",
"PCIE",
"FW_ERROR_RECORD",
"PCI_PCIX_BUS",
"PCI_DEVICE",
"DMAR_GENERIC",
"DIRECTED_IO_DMAR",
"IOMMU_DMAR",
"UNRECOGNIZED"
}

Definition at line 462 of file acpi_bert_storage.c.

Referenced by generic_error_name().