Lawrence Tang | d7e8ca3 | 2022-07-07 10:25:53 +0100 | [diff] [blame] | 1 | #ifndef CPER_SECTION_CXL_COMPONENT_H |
| 2 | #define CPER_SECTION_CXL_COMPONENT_H |
| 3 | |
Lawrence Tang | 5202bbb | 2022-08-12 14:54:36 +0100 | [diff] [blame] | 4 | #include <json.h> |
Lawrence Tang | d7e8ca3 | 2022-07-07 10:25:53 +0100 | [diff] [blame] | 5 | #include "../edk/Cper.h" |
| 6 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 7 | #define CXL_COMPONENT_ERROR_VALID_BITFIELD_NAMES \ |
| 8 | (const char *[]) \ |
| 9 | { \ |
| 10 | "deviceIDValid", "deviceSerialValid", \ |
| 11 | "cxlComponentEventLogValid" \ |
| 12 | } |
Lawrence Tang | 2721739 | 2022-07-07 11:55:39 +0100 | [diff] [blame] | 13 | |
Lawrence Tang | d7e8ca3 | 2022-07-07 10:25:53 +0100 | [diff] [blame] | 14 | /// |
| 15 | /// CXL Generic Component Error Section |
| 16 | /// |
| 17 | typedef struct { |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 18 | UINT64 VendorId : 16; |
| 19 | UINT64 DeviceId : 16; |
| 20 | UINT64 FunctionNumber : 8; |
| 21 | UINT64 DeviceNumber : 8; |
| 22 | UINT64 BusNumber : 8; |
| 23 | UINT64 SegmentNumber : 16; |
| 24 | UINT64 Resv1 : 3; |
| 25 | UINT64 SlotNumber : 13; |
| 26 | UINT64 Resv2 : 8; |
Lawrence Tang | 0a4b3f2 | 2022-07-21 10:40:10 +0100 | [diff] [blame] | 27 | } __attribute__((packed, aligned(1))) EFI_CXL_DEVICE_ID_INFO; |
Lawrence Tang | d7e8ca3 | 2022-07-07 10:25:53 +0100 | [diff] [blame] | 28 | |
| 29 | typedef struct { |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 30 | UINT32 Length; |
| 31 | UINT64 ValidBits; |
| 32 | EFI_CXL_DEVICE_ID_INFO DeviceId; |
| 33 | UINT64 DeviceSerial; |
Lawrence Tang | 0a4b3f2 | 2022-07-21 10:40:10 +0100 | [diff] [blame] | 34 | } __attribute__((packed, aligned(1))) EFI_CXL_COMPONENT_EVENT_HEADER; |
Lawrence Tang | d7e8ca3 | 2022-07-07 10:25:53 +0100 | [diff] [blame] | 35 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 36 | json_object *cper_section_cxl_component_to_ir(void *section); |
| 37 | void ir_section_cxl_component_to_cper(json_object *section, FILE *out); |
Lawrence Tang | d7e8ca3 | 2022-07-07 10:25:53 +0100 | [diff] [blame] | 38 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 39 | #endif |