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