blob: 56b092c810320cd5d519e13c81aed68e0f5e05e1 [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
Karthik Rajagopalan255bd812024-09-06 14:36:34 -07004#ifdef __cplusplus
5extern "C" {
6#endif
7
Lawrence Tang5202bbb2022-08-12 14:54:36 +01008#include <json.h>
Ed Tanousa3b7f8a2024-11-04 16:38:59 -08009#include "Cper.h"
Lawrence Tangd7e8ca32022-07-07 10:25:53 +010010
John Chungf8fc7052024-05-03 20:05:29 +080011#define CXL_COMPONENT_ERROR_VALID_BITFIELD_NAMES \
12 (const char *[]) \
13 { \
14 "deviceIDValid", "deviceSerialValid", \
15 "cxlComponentEventLogValid" \
16 }
Lawrence Tang27217392022-07-07 11:55:39 +010017
Lawrence Tangd7e8ca32022-07-07 10:25:53 +010018///
19/// CXL Generic Component Error Section
20///
21typedef struct {
John Chungf8fc7052024-05-03 20:05:29 +080022 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 Tang0a4b3f22022-07-21 10:40:10 +010031} __attribute__((packed, aligned(1))) EFI_CXL_DEVICE_ID_INFO;
Lawrence Tangd7e8ca32022-07-07 10:25:53 +010032
33typedef struct {
John Chungf8fc7052024-05-03 20:05:29 +080034 UINT32 Length;
35 UINT64 ValidBits;
36 EFI_CXL_DEVICE_ID_INFO DeviceId;
37 UINT64 DeviceSerial;
Lawrence Tang0a4b3f22022-07-21 10:40:10 +010038} __attribute__((packed, aligned(1))) EFI_CXL_COMPONENT_EVENT_HEADER;
Lawrence Tangd7e8ca32022-07-07 10:25:53 +010039
John Chungf8fc7052024-05-03 20:05:29 +080040json_object *cper_section_cxl_component_to_ir(void *section);
41void ir_section_cxl_component_to_cper(json_object *section, FILE *out);
Lawrence Tangd7e8ca32022-07-07 10:25:53 +010042
Karthik Rajagopalan255bd812024-09-06 14:36:34 -070043#ifdef __cplusplus
44}
45#endif
46
John Chungf8fc7052024-05-03 20:05:29 +080047#endif