drivers/firmware/efi/cper.c
Source file repositories/reference/linux-study-clean/drivers/firmware/efi/cper.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/firmware/efi/cper.c- Extension
.c- Size
- 24760 bytes
- Lines
- 780
- Domain
- Driver Families
- Bucket
- drivers/firmware
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitmap.hlinux/kernel.hlinux/module.hlinux/time.hlinux/cper.hlinux/dmi.hlinux/acpi.hlinux/pci.hlinux/aer.hlinux/printk.hlinux/bcd.hacpi/ghes.hras/ras_event.hcxl/event.h
Detected Declarations
struct ignore_sectionfunction Recordfunction cper_print_bitsfunction cper_bits_to_strfunction for_each_set_bitfunction cper_print_proc_genericfunction cper_mem_err_locationfunction cper_dimm_err_locationfunction cper_mem_err_packfunction cper_print_memfunction cper_print_pciefunction __ghes_panicfunction cper_print_fw_errfunction definedfunction cper_print_tstampfunction cper_estatus_print_sectionfunction cper_estatus_printfunction apei_estatus_for_each_sectionfunction cper_estatus_check_headerfunction cper_estatus_checkfunction apei_estatus_for_each_sectionexport cper_next_record_idexport cper_severity_strexport cper_bits_to_strexport cper_mem_err_type_strexport cper_mem_err_status_strexport cper_mem_err_locationexport cper_dimm_err_locationexport cper_mem_err_packexport cper_estatus_printexport cper_estatus_check_headerexport cper_estatus_check
Annotated Snippet
struct ignore_section {
guid_t guid;
const char *name;
};
static const struct ignore_section ignore_sections[] = {
{ .guid = CPER_SEC_CXL_GEN_MEDIA_GUID, .name = "CXL General Media Event" },
{ .guid = CPER_SEC_CXL_DRAM_GUID, .name = "CXL DRAM Event" },
{ .guid = CPER_SEC_CXL_MEM_MODULE_GUID, .name = "CXL Memory Module Event" },
};
static void
cper_estatus_print_section(const char *pfx, struct acpi_hest_generic_data *gdata,
int sec_no)
{
guid_t *sec_type = (guid_t *)gdata->section_type;
__u16 severity;
char newpfx[64];
if (acpi_hest_get_version(gdata) >= 3)
cper_print_tstamp(pfx, (struct acpi_hest_generic_data_v300 *)gdata);
severity = gdata->error_severity;
printk("%s""Error %d, type: %s\n", pfx, sec_no,
cper_severity_str(severity));
if (gdata->validation_bits & CPER_SEC_VALID_FRU_ID)
printk("%s""fru_id: %pUl\n", pfx, gdata->fru_id);
if (gdata->validation_bits & CPER_SEC_VALID_FRU_TEXT)
printk("%s""fru_text: %.20s\n", pfx, gdata->fru_text);
snprintf(newpfx, sizeof(newpfx), "%s ", pfx);
for (int i = 0; i < ARRAY_SIZE(ignore_sections); i++) {
if (guid_equal(sec_type, &ignore_sections[i].guid)) {
printk("%ssection_type: %s\n", newpfx, ignore_sections[i].name);
return;
}
}
if (guid_equal(sec_type, &CPER_SEC_PROC_GENERIC)) {
struct cper_sec_proc_generic *proc_err = acpi_hest_get_payload(gdata);
printk("%s""section_type: general processor error\n", newpfx);
if (gdata->error_data_length >= sizeof(*proc_err))
cper_print_proc_generic(newpfx, proc_err);
else
goto err_section_too_small;
} else if (guid_equal(sec_type, &CPER_SEC_PLATFORM_MEM)) {
struct cper_sec_mem_err *mem_err = acpi_hest_get_payload(gdata);
printk("%s""section_type: memory error\n", newpfx);
if (gdata->error_data_length >=
sizeof(struct cper_sec_mem_err_old))
cper_print_mem(newpfx, mem_err,
gdata->error_data_length);
else
goto err_section_too_small;
} else if (guid_equal(sec_type, &CPER_SEC_PCIE)) {
struct cper_sec_pcie *pcie = acpi_hest_get_payload(gdata);
printk("%s""section_type: PCIe error\n", newpfx);
if (gdata->error_data_length >= sizeof(*pcie))
cper_print_pcie(newpfx, pcie, gdata);
else
goto err_section_too_small;
#if defined(CONFIG_ARM64) || defined(CONFIG_ARM)
} else if (guid_equal(sec_type, &CPER_SEC_PROC_ARM)) {
struct cper_sec_proc_arm *arm_err = acpi_hest_get_payload(gdata);
printk("%ssection_type: ARM processor error\n", newpfx);
if (gdata->error_data_length >= sizeof(*arm_err))
cper_print_proc_arm(newpfx, arm_err,
gdata->error_data_length);
else
goto err_section_too_small;
#endif
#if defined(CONFIG_UEFI_CPER_X86)
} else if (guid_equal(sec_type, &CPER_SEC_PROC_IA)) {
struct cper_sec_proc_ia *ia_err = acpi_hest_get_payload(gdata);
printk("%ssection_type: IA32/X64 processor error\n", newpfx);
if (gdata->error_data_length >= sizeof(*ia_err))
cper_print_proc_ia(newpfx, ia_err);
else
goto err_section_too_small;
#endif
} else if (guid_equal(sec_type, &CPER_SEC_FW_ERR_REC_REF)) {
struct cper_sec_fw_err_rec_ref *fw_err = acpi_hest_get_payload(gdata);
printk("%ssection_type: Firmware Error Record Reference\n",
Annotation
- Immediate include surface: `linux/bitmap.h`, `linux/kernel.h`, `linux/module.h`, `linux/time.h`, `linux/cper.h`, `linux/dmi.h`, `linux/acpi.h`, `linux/pci.h`.
- Detected declarations: `struct ignore_section`, `function Record`, `function cper_print_bits`, `function cper_bits_to_str`, `function for_each_set_bit`, `function cper_print_proc_generic`, `function cper_mem_err_location`, `function cper_dimm_err_location`, `function cper_mem_err_pack`, `function cper_print_mem`.
- Atlas domain: Driver Families / drivers/firmware.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.