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 | |
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> |
Ed Tanous | a3b7f8a | 2024-11-04 16:38:59 -0800 | [diff] [blame^] | 9 | #include "Cper.h" |
Lawrence Tang | d7e8ca3 | 2022-07-07 10:25:53 +0100 | [diff] [blame] | 10 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 11 | #define CXL_COMPONENT_ERROR_VALID_BITFIELD_NAMES \ |
| 12 | (const char *[]) \ |
| 13 | { \ |
| 14 | "deviceIDValid", "deviceSerialValid", \ |
| 15 | "cxlComponentEventLogValid" \ |
| 16 | } |
Lawrence Tang | 2721739 | 2022-07-07 11:55:39 +0100 | [diff] [blame] | 17 | |
Lawrence Tang | d7e8ca3 | 2022-07-07 10:25:53 +0100 | [diff] [blame] | 18 | /// |
| 19 | /// CXL Generic Component 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 FunctionNumber : 8; |
| 25 | UINT64 DeviceNumber : 8; |
| 26 | UINT64 BusNumber : 8; |
| 27 | UINT64 SegmentNumber : 16; |
| 28 | UINT64 Resv1 : 3; |
| 29 | UINT64 SlotNumber : 13; |
| 30 | UINT64 Resv2 : 8; |
Lawrence Tang | 0a4b3f2 | 2022-07-21 10:40:10 +0100 | [diff] [blame] | 31 | } __attribute__((packed, aligned(1))) EFI_CXL_DEVICE_ID_INFO; |
Lawrence Tang | d7e8ca3 | 2022-07-07 10:25:53 +0100 | [diff] [blame] | 32 | |
| 33 | typedef struct { |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 34 | UINT32 Length; |
| 35 | UINT64 ValidBits; |
| 36 | EFI_CXL_DEVICE_ID_INFO DeviceId; |
| 37 | UINT64 DeviceSerial; |
Lawrence Tang | 0a4b3f2 | 2022-07-21 10:40:10 +0100 | [diff] [blame] | 38 | } __attribute__((packed, aligned(1))) EFI_CXL_COMPONENT_EVENT_HEADER; |
Lawrence Tang | d7e8ca3 | 2022-07-07 10:25:53 +0100 | [diff] [blame] | 39 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 40 | json_object *cper_section_cxl_component_to_ir(void *section); |
| 41 | void ir_section_cxl_component_to_cper(json_object *section, FILE *out); |
Lawrence Tang | d7e8ca3 | 2022-07-07 10:25:53 +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 |