blob: e0a585e2f4541d5de6eb0fe165b3816e7c3cf1f5 [file] [log] [blame]
Lawrence Tangd7e8ca32022-07-07 10:25:53 +01001#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 Tang27217392022-07-07 11:55:39 +01007#define CXL_COMPONENT_ERROR_VALID_BITFIELD_NAMES (const char*[]) {"deviceIDValid", "deviceSerialValid", \
8 "cxlComponentEventLogValid"}
9
Lawrence Tangd7e8ca32022-07-07 10:25:53 +010010///
11/// CXL Generic Component Error Section
12///
13typedef 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 Tang0a4b3f22022-07-21 10:40:10 +010023} __attribute__((packed, aligned(1))) EFI_CXL_DEVICE_ID_INFO;
Lawrence Tangd7e8ca32022-07-07 10:25:53 +010024
25typedef struct {
26 UINT32 Length;
27 UINT64 ValidBits;
28 EFI_CXL_DEVICE_ID_INFO DeviceId;
29 UINT64 DeviceSerial;
Lawrence Tang0a4b3f22022-07-21 10:40:10 +010030} __attribute__((packed, aligned(1))) EFI_CXL_COMPONENT_EVENT_HEADER;
Lawrence Tangd7e8ca32022-07-07 10:25:53 +010031
Lawrence Tangd7e8ca32022-07-07 10:25:53 +010032json_object* cper_section_cxl_component_to_ir(void* section, EFI_ERROR_SECTION_DESCRIPTOR* descriptor);
Lawrence Tangaec83902022-07-18 09:41:08 +010033void ir_section_cxl_component_to_cper(json_object* section, FILE* out);
Lawrence Tangd7e8ca32022-07-07 10:25:53 +010034
35#endif