blob: 5326a8c5839052831cf1cf2156a0509cafae8d0c [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
John Chungf8fc7052024-05-03 20:05:29 +08007#define PCI_DEV_ERROR_VALID_BITFIELD_NAMES \
8 (const char *[]) \
9 { \
10 "errorStatusValid", "idInfoValid", "memoryNumberValid", \
11 "ioNumberValid", "registerDataPairsValid" \
12 }
Lawrence Tanga416ec92022-07-06 14:34:40 +010013
14///
15/// PCI/PCI-X Device Error Section
16///
17typedef struct {
John Chungf8fc7052024-05-03 20:05:29 +080018 UINT64 VendorId : 16;
19 UINT64 DeviceId : 16;
20 UINT64 ClassCode : 24;
21 UINT64 FunctionNumber : 8;
22 UINT64 DeviceNumber : 8;
23 UINT64 BusNumber : 8;
24 UINT64 SegmentNumber : 8;
25 UINT64 Reserved : 40;
Lawrence Tanga416ec92022-07-06 14:34:40 +010026} EFI_PCI_PCIX_DEVICE_ID_INFO;
27
28typedef struct {
John Chungf8fc7052024-05-03 20:05:29 +080029 UINT64 ValidFields;
30 EFI_GENERIC_ERROR_STATUS ErrorStatus;
31 EFI_PCI_PCIX_DEVICE_ID_INFO IdInfo;
32 UINT32 MemoryNumber;
33 UINT32 IoNumber;
Lawrence Tangefe17e22022-08-08 09:16:23 +010034} __attribute__((packed, aligned(1))) EFI_PCI_PCIX_DEVICE_ERROR_DATA;
Lawrence Tanga416ec92022-07-06 14:34:40 +010035
John Chungf8fc7052024-05-03 20:05:29 +080036json_object *cper_section_pci_dev_to_ir(void *section);
37void ir_section_pci_dev_to_cper(json_object *section, FILE *out);
Lawrence Tanga416ec92022-07-06 14:34:40 +010038
John Chungf8fc7052024-05-03 20:05:29 +080039#endif