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