Dung Cao | 72c8aa0 | 2023-11-22 02:31:41 +0000 | [diff] [blame] | 1 | #include "libcper/Cper.h" |
| 2 | |
Dung Cao | 72c8aa0 | 2023-11-22 02:31:41 +0000 | [diff] [blame] | 3 | #include <unistd.h> |
| 4 | |
Pavithra Barithaya | 9b71a56 | 2025-01-30 17:01:45 +0530 | [diff] [blame] | 5 | #include <cstdint> |
| 6 | #include <cstdio> |
Dung Cao | 72c8aa0 | 2023-11-22 02:31:41 +0000 | [diff] [blame] | 7 | #include <fstream> |
| 8 | #include <vector> |
| 9 | |
| 10 | namespace pldm |
| 11 | { |
| 12 | namespace oem_ampere |
| 13 | { |
| 14 | constexpr auto logBusName = "xyz.openbmc_project.Logging.IPMI"; |
| 15 | constexpr auto logPath = "/xyz/openbmc_project/Logging/IPMI"; |
| 16 | constexpr auto logIntf = "xyz.openbmc_project.Logging.IPMI"; |
| 17 | #define SENSOR_TYPE_OEM 0xF0 |
| 18 | |
| 19 | /* Memory definitions */ |
| 20 | #define MEM_ERROR_TYPE_PARITY 8 |
| 21 | #define ERROR_TYPE_ID_MCU 1 |
| 22 | #define SUBTYPE_ID_PARITY 9 |
| 23 | |
| 24 | /* PCIe definitions */ |
| 25 | #define ERROR_SUBTYPE_PCIE_AER_ROOT_PORT 0 |
| 26 | #define ERROR_SUBTYPE_PCIE_AER_DEVICE 1 |
| 27 | #define CPER_PCIE_VALID_PORT_TYPE 0x0001 |
| 28 | #define CPER_PCIE_PORT_TYPE_ROOT_PORT 4 |
| 29 | |
| 30 | typedef struct |
| 31 | { |
| 32 | uint8_t formatVersion; |
| 33 | uint8_t formatType; |
| 34 | uint16_t length; |
| 35 | } __attribute__((packed)) CommonEventData; |
| 36 | |
| 37 | void decodeCperRecord(const uint8_t* data, size_t eventDataSize, |
| 38 | EFI_AMPERE_ERROR_DATA* ampSpecHdr); |
| 39 | void addCperSELLog(uint8_t TID, uint16_t eventID, EFI_AMPERE_ERROR_DATA* p); |
| 40 | |
| 41 | } // namespace oem_ampere |
| 42 | } // namespace pldm |