blob: 1124b00c4119dd75e2da41981508ab86c989c161 [file] [log] [blame]
Andrew Jefferyd861a682024-06-03 21:43:09 +09301// 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 Jeffery0a1be3c2024-08-11 08:34:10 +00007#include "compiler.h"
Andrew Jefferyd861a682024-06-03 21:43:09 +09308#include <libpldm/base.h>
9
10int pack_pldm_header_errno(const struct pldm_header_info *hdr,
11 struct pldm_msg_hdr *msg);
12
13int unpack_pldm_header_errno(const struct pldm_msg_hdr *msg,
14 struct pldm_header_info *hdr);
15
Andrew Jeffery0a1be3c2024-08-11 08:34:10 +000016LIBPLDM_CC_ALWAYS_INLINE
17int 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 Jefferyd861a682024-06-03 21:43:09 +093023#endif