blob: 69b9066c57022e82e3ad36d224575d07744a8f5e [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
Lawrence Tang5202bbb2022-08-12 14:54:36 +01004#include <json.h>
Lawrence Tangd7e8ca32022-07-07 10:25:53 +01005#include "../edk/Cper.h"
6
John Chungf8fc7052024-05-03 20:05:29 +08007#define CXL_COMPONENT_ERROR_VALID_BITFIELD_NAMES \
8 (const char *[]) \
9 { \
10 "deviceIDValid", "deviceSerialValid", \
11 "cxlComponentEventLogValid" \
12 }
Lawrence Tang27217392022-07-07 11:55:39 +010013
Lawrence Tangd7e8ca32022-07-07 10:25:53 +010014///
15/// CXL Generic Component Error Section
16///
17typedef struct {
John Chungf8fc7052024-05-03 20:05:29 +080018 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;
Lawrence Tang0a4b3f22022-07-21 10:40:10 +010027} __attribute__((packed, aligned(1))) EFI_CXL_DEVICE_ID_INFO;
Lawrence Tangd7e8ca32022-07-07 10:25:53 +010028
29typedef struct {
John Chungf8fc7052024-05-03 20:05:29 +080030 UINT32 Length;
31 UINT64 ValidBits;
32 EFI_CXL_DEVICE_ID_INFO DeviceId;
33 UINT64 DeviceSerial;
Lawrence Tang0a4b3f22022-07-21 10:40:10 +010034} __attribute__((packed, aligned(1))) EFI_CXL_COMPONENT_EVENT_HEADER;
Lawrence Tangd7e8ca32022-07-07 10:25:53 +010035
John Chungf8fc7052024-05-03 20:05:29 +080036json_object *cper_section_cxl_component_to_ir(void *section);
37void ir_section_cxl_component_to_cper(json_object *section, FILE *out);
Lawrence Tangd7e8ca32022-07-07 10:25:53 +010038
John Chungf8fc7052024-05-03 20:05:29 +080039#endif