Andrew Jeffery | d861a68 | 2024-06-03 21:43:09 +0930 | [diff] [blame] | 1 | // SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
| 2 | #ifndef LIBPLDM_SRC_DSP_BASE_H |
| 3 | #define LIBPLDM_SRC_DSP_BASE_H |
| 4 | |
| 5 | /* Internal functions */ |
| 6 | |
Andrew Jeffery | 0a1be3c | 2024-08-11 08:34:10 +0000 | [diff] [blame] | 7 | #include "compiler.h" |
Andrew Jeffery | d861a68 | 2024-06-03 21:43:09 +0930 | [diff] [blame] | 8 | #include <libpldm/base.h> |
| 9 | |
| 10 | int pack_pldm_header_errno(const struct pldm_header_info *hdr, |
| 11 | struct pldm_msg_hdr *msg); |
| 12 | |
| 13 | int unpack_pldm_header_errno(const struct pldm_msg_hdr *msg, |
| 14 | struct pldm_header_info *hdr); |
| 15 | |
Andrew Jeffery | 0a1be3c | 2024-08-11 08:34:10 +0000 | [diff] [blame] | 16 | LIBPLDM_CC_ALWAYS_INLINE |
| 17 | int pldm_msg_has_error(const struct pldm_msg *msg, size_t payload_length) |
| 18 | { |
| 19 | static_assert(PLDM_SUCCESS == 0, "Rework required"); |
| 20 | return payload_length < 1 ? 0 : msg->payload[0]; |
| 21 | } |
| 22 | |
Andrew Jeffery | d861a68 | 2024-06-03 21:43:09 +0930 | [diff] [blame] | 23 | #endif |