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