1 #ifndef CPER_SECTION_CXL_COMPONENT_H
2 #define CPER_SECTION_CXL_COMPONENT_H
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
8 #include <json.h>
9 #include "../edk/Cper.h"
10 
11 #define CXL_COMPONENT_ERROR_VALID_BITFIELD_NAMES                               \
12 	(const char *[])                                                       \
13 	{                                                                      \
14 		"deviceIDValid", "deviceSerialValid",                          \
15 			"cxlComponentEventLogValid"                            \
16 	}
17 
18 ///
19 /// CXL Generic Component Error Section
20 ///
21 typedef struct {
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;
31 } __attribute__((packed, aligned(1))) EFI_CXL_DEVICE_ID_INFO;
32 
33 typedef struct {
34 	UINT32 Length;
35 	UINT64 ValidBits;
36 	EFI_CXL_DEVICE_ID_INFO DeviceId;
37 	UINT64 DeviceSerial;
38 } __attribute__((packed, aligned(1))) EFI_CXL_COMPONENT_EVENT_HEADER;
39 
40 json_object *cper_section_cxl_component_to_ir(void *section);
41 void ir_section_cxl_component_to_cper(json_object *section, FILE *out);
42 
43 #ifdef __cplusplus
44 }
45 #endif
46 
47 #endif
48