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 | |
Karthik Rajagopalan | 255bd81 | 2024-09-06 14:36:34 -0700 | [diff] [blame^] | 4 | #ifdef __cplusplus |
| 5 | extern "C" { |
| 6 | #endif |
| 7 | |
Lawrence Tang | 5202bbb | 2022-08-12 14:54:36 +0100 | [diff] [blame] | 8 | #include <json.h> |
Lawrence Tang | a416ec9 | 2022-07-06 14:34:40 +0100 | [diff] [blame] | 9 | #include "../edk/Cper.h" |
| 10 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 11 | #define PCI_DEV_ERROR_VALID_BITFIELD_NAMES \ |
| 12 | (const char *[]) \ |
| 13 | { \ |
| 14 | "errorStatusValid", "idInfoValid", "memoryNumberValid", \ |
| 15 | "ioNumberValid", "registerDataPairsValid" \ |
| 16 | } |
Lawrence Tang | a416ec9 | 2022-07-06 14:34:40 +0100 | [diff] [blame] | 17 | |
| 18 | /// |
| 19 | /// PCI/PCI-X Device Error Section |
| 20 | /// |
| 21 | typedef struct { |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 22 | UINT64 VendorId : 16; |
| 23 | UINT64 DeviceId : 16; |
| 24 | UINT64 ClassCode : 24; |
| 25 | UINT64 FunctionNumber : 8; |
| 26 | UINT64 DeviceNumber : 8; |
| 27 | UINT64 BusNumber : 8; |
| 28 | UINT64 SegmentNumber : 8; |
| 29 | UINT64 Reserved : 40; |
Lawrence Tang | a416ec9 | 2022-07-06 14:34:40 +0100 | [diff] [blame] | 30 | } EFI_PCI_PCIX_DEVICE_ID_INFO; |
| 31 | |
| 32 | typedef struct { |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 33 | UINT64 ValidFields; |
| 34 | EFI_GENERIC_ERROR_STATUS ErrorStatus; |
| 35 | EFI_PCI_PCIX_DEVICE_ID_INFO IdInfo; |
| 36 | UINT32 MemoryNumber; |
| 37 | UINT32 IoNumber; |
Lawrence Tang | efe17e2 | 2022-08-08 09:16:23 +0100 | [diff] [blame] | 38 | } __attribute__((packed, aligned(1))) EFI_PCI_PCIX_DEVICE_ERROR_DATA; |
Lawrence Tang | a416ec9 | 2022-07-06 14:34:40 +0100 | [diff] [blame] | 39 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 40 | json_object *cper_section_pci_dev_to_ir(void *section); |
| 41 | void ir_section_pci_dev_to_cper(json_object *section, FILE *out); |
Lawrence Tang | a416ec9 | 2022-07-06 14:34:40 +0100 | [diff] [blame] | 42 | |
Karthik Rajagopalan | 255bd81 | 2024-09-06 14:36:34 -0700 | [diff] [blame^] | 43 | #ifdef __cplusplus |
| 44 | } |
| 45 | #endif |
| 46 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 47 | #endif |