Matt Spinler | 7f3c8a4 | 2022-01-21 09:26:06 -0600 | [diff] [blame] | 1 | #include "pel_entry.hpp" |
| 2 | |
Matt Spinler | 8a09b98 | 2025-05-09 14:09:10 -0500 | [diff] [blame^] | 3 | #include "pel_types.hpp" |
| 4 | #include "repository.hpp" |
| 5 | |
Matt Spinler | 7f3c8a4 | 2022-01-21 09:26:06 -0600 | [diff] [blame] | 6 | #include <xyz/openbmc_project/Common/error.hpp> |
| 7 | |
| 8 | namespace openpower |
| 9 | { |
| 10 | namespace pels |
| 11 | { |
| 12 | |
| 13 | namespace common_error = sdbusplus::xyz::openbmc_project::Common::Error; |
| 14 | |
| 15 | bool PELEntry::managementSystemAck(bool value) |
| 16 | { |
Willy Tu | 6ddbf69 | 2023-09-05 10:54:16 -0700 | [diff] [blame] | 17 | auto current = sdbusplus::server::org::open_power::logging::pel::Entry:: |
Matt Spinler | 7f3c8a4 | 2022-01-21 09:26:06 -0600 | [diff] [blame] | 18 | managementSystemAck(); |
| 19 | if (value != current) |
| 20 | { |
Willy Tu | 6ddbf69 | 2023-09-05 10:54:16 -0700 | [diff] [blame] | 21 | current = sdbusplus::server::org::open_power::logging::pel::Entry:: |
Matt Spinler | 7f3c8a4 | 2022-01-21 09:26:06 -0600 | [diff] [blame] | 22 | managementSystemAck(value); |
| 23 | |
| 24 | Repository::LogID id{Repository::LogID::Obmc(getMyId())}; |
| 25 | if (auto logId = _repo->getLogID(id); logId.has_value()) |
| 26 | { |
| 27 | // Update HMC acknowledge bit in PEL |
| 28 | _repo->setPELHMCTransState( |
| 29 | logId->pelID.id, |
| 30 | (value ? TransmissionState::acked : TransmissionState::newPEL)); |
| 31 | } |
| 32 | else |
| 33 | { |
| 34 | throw common_error::InvalidArgument(); |
| 35 | } |
| 36 | } |
| 37 | return current; |
| 38 | } |
| 39 | |
| 40 | } // namespace pels |
| 41 | } // namespace openpower |