blob: e261d44661db66152e213269188aa2d0ecdb949e [file] [log] [blame]
Lawrence Tanga416ec92022-07-06 14:34:40 +01001#ifndef CPER_SECTION_PCI_DEV_H
2#define CPER_SECTION_PCI_DEV_H
3
Lawrence Tang5202bbb2022-08-12 14:54:36 +01004#include <json.h>
Lawrence Tanga416ec92022-07-06 14:34:40 +01005#include "../edk/Cper.h"
6
7#define PCI_DEV_ERROR_VALID_BITFIELD_NAMES (const char*[]) {"errorStatusValid", "idInfoValid", "memoryNumberValid", \
Lawrence Tangcef2a592022-07-11 17:00:48 +01008 "ioNumberValid", "registerDataPairsValid"}
Lawrence Tanga416ec92022-07-06 14:34:40 +01009
10///
11/// PCI/PCI-X Device Error Section
12///
13typedef struct {
Lawrence Tangd7e8ca32022-07-07 10:25:53 +010014 UINT64 VendorId : 16;
15 UINT64 DeviceId : 16;
16 UINT64 ClassCode : 24;
17 UINT64 FunctionNumber : 8;
18 UINT64 DeviceNumber : 8;
19 UINT64 BusNumber : 8;
20 UINT64 SegmentNumber : 8;
21 UINT64 Reserved : 40;
Lawrence Tanga416ec92022-07-06 14:34:40 +010022} EFI_PCI_PCIX_DEVICE_ID_INFO;
23
24typedef struct {
25 UINT64 ValidFields;
26 EFI_GENERIC_ERROR_STATUS ErrorStatus;
27 EFI_PCI_PCIX_DEVICE_ID_INFO IdInfo;
28 UINT32 MemoryNumber;
29 UINT32 IoNumber;
Lawrence Tangefe17e22022-08-08 09:16:23 +010030} __attribute__((packed, aligned(1))) EFI_PCI_PCIX_DEVICE_ERROR_DATA;
Lawrence Tanga416ec92022-07-06 14:34:40 +010031
32json_object* cper_section_pci_dev_to_ir(void* section, EFI_ERROR_SECTION_DESCRIPTOR* descriptor);
Lawrence Tang205dd1d2022-07-14 16:23:38 +010033void ir_section_pci_dev_to_cper(json_object* section, FILE* out);
Lawrence Tanga416ec92022-07-06 14:34:40 +010034
35#endif