blob: 7318711919710593f40653fa3f41cec38c84912b [file] [log] [blame]
Matt Spinlerdf13bdb2019-07-10 16:54:13 -05001#pragma once
2
3#include <cstdint>
Sumit Kumarf380c512021-11-19 06:07:31 -06004#include <string>
Matt Spinlerdf13bdb2019-07-10 16:54:13 -05005
6namespace openpower
7{
8namespace pels
9{
10
11namespace 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 */
21uint32_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 */
31uint32_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 */
45uint32_t generatePELID();
46
Sumit Kumarf380c512021-11-19 06:07:31 -060047/**
48 * @brief Check for file containing zero data.
49 *
50 */
51void checkFileForZeroData(const std::string& filename);
52
Matt Spinlerdf13bdb2019-07-10 16:54:13 -050053} // namespace pels
54} // namespace openpower