summaryrefslogtreecommitdiffstats
path: root/extensions/openpower-pels/log_id.hpp
blob: 21f04ebc41bf7ff79a74954690cc38b8c79878ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#pragma once

#include <cstdint>

namespace openpower
{
namespace pels
{

namespace detail
{

/**
 * @brief Adds the 1 byte log creator prefix to the log ID
 *
 * @param[in] id - the ID to add it to
 *
 * @return - the full log ID
 */
uint32_t addLogIDPrefix(uint32_t id);

/**
 * @brief Generates a PEL ID based on the current time.
 *
 * Used for error scenarios where the normal method doesn't
 * work in order to get a unique ID still.
 *
 * @return A unique log ID.
 */
uint32_t getTimeBasedLogID();

} // namespace detail

/**
 * @brief Generates a unique PEL log entry ID every time
 *        it is called.
 *
 * This ID is used at offset 0x2C in the Private Header
 * section of a PEL.  For single BMC systems, it must
 * start with 0x50.
 *
 * @return uint32_t - The log ID
 */
uint32_t generatePELID();

} // namespace pels
} // namespace openpower
OpenPOWER on IntegriCloud