1a416ec93SLawrence Tang #ifndef CPER_SECTION_PCI_DEV_H 2a416ec93SLawrence Tang #define CPER_SECTION_PCI_DEV_H 3a416ec93SLawrence Tang 4a416ec93SLawrence Tang #include "json.h" 5a416ec93SLawrence Tang #include "../edk/Cper.h" 6a416ec93SLawrence Tang 7a416ec93SLawrence Tang #define PCI_DEV_ERROR_VALID_BITFIELD_NAMES (const char*[]) {"errorStatusValid", "idInfoValid", "memoryNumberValid", \ 8cef2a592SLawrence Tang "ioNumberValid", "registerDataPairsValid"} 9a416ec93SLawrence Tang 10a416ec93SLawrence Tang /// 11a416ec93SLawrence Tang /// PCI/PCI-X Device Error Section 12a416ec93SLawrence Tang /// 13a416ec93SLawrence Tang typedef struct { 14d7e8ca34SLawrence Tang UINT64 VendorId : 16; 15d7e8ca34SLawrence Tang UINT64 DeviceId : 16; 16d7e8ca34SLawrence Tang UINT64 ClassCode : 24; 17d7e8ca34SLawrence Tang UINT64 FunctionNumber : 8; 18d7e8ca34SLawrence Tang UINT64 DeviceNumber : 8; 19d7e8ca34SLawrence Tang UINT64 BusNumber : 8; 20d7e8ca34SLawrence Tang UINT64 SegmentNumber : 8; 21d7e8ca34SLawrence Tang UINT64 Reserved : 40; 22a416ec93SLawrence Tang } EFI_PCI_PCIX_DEVICE_ID_INFO; 23a416ec93SLawrence Tang 24a416ec93SLawrence Tang typedef struct { 25a416ec93SLawrence Tang UINT64 ValidFields; 26a416ec93SLawrence Tang EFI_GENERIC_ERROR_STATUS ErrorStatus; 27a416ec93SLawrence Tang EFI_PCI_PCIX_DEVICE_ID_INFO IdInfo; 28a416ec93SLawrence Tang UINT32 MemoryNumber; 29a416ec93SLawrence Tang UINT32 IoNumber; 30*efe17e2cSLawrence Tang } __attribute__((packed, aligned(1))) EFI_PCI_PCIX_DEVICE_ERROR_DATA; 31a416ec93SLawrence Tang 32a416ec93SLawrence Tang json_object* cper_section_pci_dev_to_ir(void* section, EFI_ERROR_SECTION_DESCRIPTOR* descriptor); 33205dd1d7SLawrence Tang void ir_section_pci_dev_to_cper(json_object* section, FILE* out); 34a416ec93SLawrence Tang 35a416ec93SLawrence Tang #endif