| Lawrence Tang | 580423f | 2022-08-24 09:37:53 +0100 | [diff] [blame] | 1 | /** | 
|  | 2 | * Describes available sections to the CPER parser. | 
| Ed Tanous | fedd457 | 2024-07-12 13:56:00 -0700 | [diff] [blame] | 3 | * | 
| Lawrence Tang | 580423f | 2022-08-24 09:37:53 +0100 | [diff] [blame] | 4 | * Author: Lawrence.Tang@arm.com | 
|  | 5 | **/ | 
|  | 6 | #include "../edk/Cper.h" | 
|  | 7 | #include "cper-section.h" | 
|  | 8 | #include "cper-section-arm.h" | 
|  | 9 | #include "cper-section-generic.h" | 
|  | 10 | #include "cper-section-ia32x64.h" | 
|  | 11 | #include "cper-section-ipf.h" | 
|  | 12 | #include "cper-section-memory.h" | 
|  | 13 | #include "cper-section-pcie.h" | 
|  | 14 | #include "cper-section-firmware.h" | 
|  | 15 | #include "cper-section-pci-bus.h" | 
|  | 16 | #include "cper-section-pci-dev.h" | 
|  | 17 | #include "cper-section-dmar-generic.h" | 
|  | 18 | #include "cper-section-dmar-vtd.h" | 
|  | 19 | #include "cper-section-dmar-iommu.h" | 
|  | 20 | #include "cper-section-ccix-per.h" | 
|  | 21 | #include "cper-section-cxl-protocol.h" | 
|  | 22 | #include "cper-section-cxl-component.h" | 
| Karthik Rajagopalan | 683e055 | 2024-03-07 12:30:43 -0800 | [diff] [blame] | 23 | #include "cper-section-nvidia.h" | 
| Dung Cao | 04f5771 | 2024-08-29 08:03:59 +0000 | [diff] [blame] | 24 | #include "cper-section-ampere.h" | 
| Lawrence Tang | 580423f | 2022-08-24 09:37:53 +0100 | [diff] [blame] | 25 |  | 
|  | 26 | //Definitions of all sections available to the CPER parser. | 
|  | 27 | CPER_SECTION_DEFINITION section_definitions[] = { | 
| John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 28 | { &gEfiProcessorGenericErrorSectionGuid, "Processor Generic", | 
| Ed Tanous | b07061a | 2024-09-22 10:33:29 -0700 | [diff] [blame^] | 29 | "GenericProcessor", cper_section_generic_to_ir, | 
|  | 30 | ir_section_generic_to_cper }, | 
|  | 31 | { &gEfiIa32X64ProcessorErrorSectionGuid, "IA32/X64", "Ia32x64Processor", | 
| John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 32 | cper_section_ia32x64_to_ir, ir_section_ia32x64_to_cper }, | 
| Ed Tanous | b07061a | 2024-09-22 10:33:29 -0700 | [diff] [blame^] | 33 | { &gEfiIpfProcessorErrorSectionGuid, "IPF", "IPF", NULL, NULL }, | 
|  | 34 | { &gEfiArmProcessorErrorSectionGuid, "ARM", "ArmProcessor", | 
|  | 35 | cper_section_arm_to_ir, ir_section_arm_to_cper }, | 
|  | 36 | { &gEfiPlatformMemoryErrorSectionGuid, "Platform Memory", "Memory", | 
| John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 37 | cper_section_platform_memory_to_ir, ir_section_memory_to_cper }, | 
| Ed Tanous | b07061a | 2024-09-22 10:33:29 -0700 | [diff] [blame^] | 38 | { &gEfiPlatformMemoryError2SectionGuid, "Platform Memory 2", "Memory2", | 
| John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 39 | cper_section_platform_memory2_to_ir, ir_section_memory2_to_cper }, | 
| Ed Tanous | b07061a | 2024-09-22 10:33:29 -0700 | [diff] [blame^] | 40 | { &gEfiPcieErrorSectionGuid, "PCIe", "Pcie", cper_section_pcie_to_ir, | 
| John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 41 | ir_section_pcie_to_cper }, | 
|  | 42 | { &gEfiFirmwareErrorSectionGuid, "Firmware Error Record Reference", | 
| Ed Tanous | b07061a | 2024-09-22 10:33:29 -0700 | [diff] [blame^] | 43 | "Firmware", cper_section_firmware_to_ir, | 
|  | 44 | ir_section_firmware_to_cper }, | 
|  | 45 | { &gEfiPciBusErrorSectionGuid, "PCI/PCI-X Bus", "PciBus", | 
| John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 46 | cper_section_pci_bus_to_ir, ir_section_pci_bus_to_cper }, | 
| Ed Tanous | b07061a | 2024-09-22 10:33:29 -0700 | [diff] [blame^] | 47 | { &gEfiPciDevErrorSectionGuid, "PCI Component/Device", "PciComponent", | 
| John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 48 | cper_section_pci_dev_to_ir, ir_section_pci_dev_to_cper }, | 
| Ed Tanous | b07061a | 2024-09-22 10:33:29 -0700 | [diff] [blame^] | 49 | { &gEfiDMArGenericErrorSectionGuid, "DMAr Generic", "GenericDmar", | 
| John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 50 | cper_section_dmar_generic_to_ir, ir_section_dmar_generic_to_cper }, | 
|  | 51 | { &gEfiDirectedIoDMArErrorSectionGuid, | 
| Ed Tanous | b07061a | 2024-09-22 10:33:29 -0700 | [diff] [blame^] | 52 | "Intel VT for Directed I/O Specific DMAr", "VtdDmar", | 
| John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 53 | cper_section_dmar_vtd_to_ir, ir_section_dmar_vtd_to_cper }, | 
| Ed Tanous | b07061a | 2024-09-22 10:33:29 -0700 | [diff] [blame^] | 54 | { &gEfiIommuDMArErrorSectionGuid, "IOMMU Specific DMAr", "IommuDmar", | 
| John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 55 | cper_section_dmar_iommu_to_ir, ir_section_dmar_iommu_to_cper }, | 
| Ed Tanous | b07061a | 2024-09-22 10:33:29 -0700 | [diff] [blame^] | 56 | { &gEfiCcixPerLogErrorSectionGuid, "CCIX PER Log Error", "CcixPer", | 
| John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 57 | cper_section_ccix_per_to_ir, ir_section_ccix_per_to_cper }, | 
| Ed Tanous | b07061a | 2024-09-22 10:33:29 -0700 | [diff] [blame^] | 58 | { &gEfiCxlProtocolErrorSectionGuid, "CXL Protocol Error", "CxlProtocol", | 
| John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 59 | cper_section_cxl_protocol_to_ir, ir_section_cxl_protocol_to_cper }, | 
|  | 60 | { &gEfiCxlGeneralMediaErrorSectionGuid, | 
| Ed Tanous | b07061a | 2024-09-22 10:33:29 -0700 | [diff] [blame^] | 61 | "CXL General Media Component Error", "CxlComponent", | 
| John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 62 | cper_section_cxl_component_to_ir, ir_section_cxl_component_to_cper }, | 
| Ed Tanous | b07061a | 2024-09-22 10:33:29 -0700 | [diff] [blame^] | 63 | { &gEfiCxlDramEventErrorSectionGuid, "CXL DRAM Component Error", | 
|  | 64 | "CxlComponent", cper_section_cxl_component_to_ir, | 
| John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 65 | ir_section_cxl_component_to_cper }, | 
| Ed Tanous | b07061a | 2024-09-22 10:33:29 -0700 | [diff] [blame^] | 66 | { &gEfiCxlMemoryModuleErrorSectionGuid, | 
|  | 67 | "CXL Memory Module Component Error", "CxlComponent", | 
|  | 68 | cper_section_cxl_component_to_ir, ir_section_cxl_component_to_cper }, | 
| John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 69 | { &gEfiCxlPhysicalSwitchErrorSectionGuid, | 
| Ed Tanous | b07061a | 2024-09-22 10:33:29 -0700 | [diff] [blame^] | 70 | "CXL Physical Switch Component Error", "CxlComponent", | 
| John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 71 | cper_section_cxl_component_to_ir, ir_section_cxl_component_to_cper }, | 
|  | 72 | { &gEfiCxlVirtualSwitchErrorSectionGuid, | 
| Ed Tanous | b07061a | 2024-09-22 10:33:29 -0700 | [diff] [blame^] | 73 | "CXL Virtual Switch Component Error", "CxlComponent", | 
| John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 74 | cper_section_cxl_component_to_ir, ir_section_cxl_component_to_cper }, | 
|  | 75 | { &gEfiCxlMldPortErrorSectionGuid, "CXL MLD Port Component Error", | 
| Ed Tanous | b07061a | 2024-09-22 10:33:29 -0700 | [diff] [blame^] | 76 | "CxlComponent", cper_section_cxl_component_to_ir, | 
|  | 77 | ir_section_cxl_component_to_cper }, | 
|  | 78 | { &gEfiNvidiaErrorSectionGuid, "NVIDIA", "Nvidia", | 
|  | 79 | cper_section_nvidia_to_ir, ir_section_nvidia_to_cper }, | 
|  | 80 | { &gEfiAmpereErrorSectionGuid, "Ampere", "Ampere", | 
|  | 81 | cper_section_ampere_to_ir, ir_section_ampere_to_cper }, | 
| Lawrence Tang | 580423f | 2022-08-24 09:37:53 +0100 | [diff] [blame] | 82 | }; | 
| John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 83 | const size_t section_definitions_len = | 
|  | 84 | sizeof(section_definitions) / sizeof(CPER_SECTION_DEFINITION); |