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 
7 #define CXL_COMPONENT_ERROR_VALID_BITFIELD_NAMES                               \
8 	(const char *[])                                                       \
9 	{                                                                      \
10 		"deviceIDValid", "deviceSerialValid",                          \
11 			"cxlComponentEventLogValid"                            \
12 	}
13 
14 ///
15 /// CXL Generic Component Error Section
16 ///
17 typedef struct {
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;
27 } __attribute__((packed, aligned(1))) EFI_CXL_DEVICE_ID_INFO;
28 
29 typedef struct {
30 	UINT32 Length;
31 	UINT64 ValidBits;
32 	EFI_CXL_DEVICE_ID_INFO DeviceId;
33 	UINT64 DeviceSerial;
34 } __attribute__((packed, aligned(1))) EFI_CXL_COMPONENT_EVENT_HEADER;
35 
36 json_object *cper_section_cxl_component_to_ir(void *section);
37 void ir_section_cxl_component_to_cper(json_object *section, FILE *out);
38 
39 #endif
40