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