Matt Spinler | df13bdb | 2019-07-10 16:54:13 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <cstdint> |
Sumit Kumar | f380c51 | 2021-11-19 06:07:31 -0600 | [diff] [blame] | 4 | #include <string> |
Matt Spinler | df13bdb | 2019-07-10 16:54:13 -0500 | [diff] [blame] | 5 | |
| 6 | namespace openpower |
| 7 | { |
| 8 | namespace pels |
| 9 | { |
| 10 | |
| 11 | namespace detail |
| 12 | { |
| 13 | |
| 14 | /** |
| 15 | * @brief Adds the 1 byte log creator prefix to the log ID |
| 16 | * |
| 17 | * @param[in] id - the ID to add it to |
| 18 | * |
| 19 | * @return - the full log ID |
| 20 | */ |
| 21 | uint32_t addLogIDPrefix(uint32_t id); |
| 22 | |
| 23 | /** |
| 24 | * @brief Generates a PEL ID based on the current time. |
| 25 | * |
| 26 | * Used for error scenarios where the normal method doesn't |
| 27 | * work in order to get a unique ID still. |
| 28 | * |
| 29 | * @return A unique log ID. |
| 30 | */ |
| 31 | uint32_t getTimeBasedLogID(); |
| 32 | |
| 33 | } // namespace detail |
| 34 | |
| 35 | /** |
| 36 | * @brief Generates a unique PEL log entry ID every time |
| 37 | * it is called. |
| 38 | * |
| 39 | * This ID is used at offset 0x2C in the Private Header |
| 40 | * section of a PEL. For single BMC systems, it must |
| 41 | * start with 0x50. |
| 42 | * |
| 43 | * @return uint32_t - The log ID |
| 44 | */ |
| 45 | uint32_t generatePELID(); |
| 46 | |
Sumit Kumar | f380c51 | 2021-11-19 06:07:31 -0600 | [diff] [blame] | 47 | /** |
| 48 | * @brief Check for file containing zero data. |
| 49 | * |
| 50 | */ |
| 51 | void checkFileForZeroData(const std::string& filename); |
| 52 | |
Matt Spinler | df13bdb | 2019-07-10 16:54:13 -0500 | [diff] [blame] | 53 | } // namespace pels |
| 54 | } // namespace openpower |