From a7835c462eacdcb30aa6a41b2e04d1650995e175 Mon Sep 17 00:00:00 2001 From: Werner Zeh Date: Fri, 15 Jun 2018 14:02:18 +0200 Subject: cbfstool: Use endian.h and functions from commonlib The endian conversion function be32toh() is defined in src/include/endian.h, however this file is not used for cbfstool compilation. Currently the one provided by the host is used and if the host does not provide this endian.h file, the build will fail. However, we do have endian conversion functions in commonlib/endian.h which is available for cbfstool compilation. Switch from be32toh() to read_be32() in order to avoid relying on a host provided include file. We use functions from commonlib/endian.h already in cbfstool. Change-Id: I106274cf9c69e1849f848920d96a61188f895b36 Signed-off-by: Werner Zeh Reviewed-on: https://review.coreboot.org/27116 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber Reviewed-by: Patrick Georgi --- util/cbfstool/cbfs-mkpayload.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'util/cbfstool') diff --git a/util/cbfstool/cbfs-mkpayload.c b/util/cbfstool/cbfs-mkpayload.c index 6dc163433d..e26c530106 100644 --- a/util/cbfstool/cbfs-mkpayload.c +++ b/util/cbfstool/cbfs-mkpayload.c @@ -18,6 +18,7 @@ #include #include #include +#include #include "elfparsing.h" #include "common.h" @@ -426,7 +427,7 @@ int parse_fit_to_payload(const struct buffer *input, struct buffer *output, DEBUG("start: parse_fit_to_payload\n"); fdt_h = buffer_get(input); - if (be32toh(fdt_h->magic) != FDT_HEADER_MAGIC) { + if (read_be32(&fdt_h->magic) != FDT_HEADER_MAGIC) { INFO("Not a FIT payload.\n"); return -1; } -- cgit v1.2.3