summaryrefslogtreecommitdiffstats
path: root/util/cbfstool/cbfstool.c
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2015-09-21 13:10:13 -0500
committerPatrick Georgi <pgeorgi@google.com>2015-09-21 19:10:26 +0000
commit4b93a4f47a7457162d1be20eeffe57f81d5cd6af (patch)
tree48b76ffa55e2261cf9a848670923b19f3f7605db /util/cbfstool/cbfstool.c
parentb946f12ed0c4a4177b64c032f17dd5b3fd2a0c99 (diff)
downloadcoreboot-4b93a4f47a7457162d1be20eeffe57f81d5cd6af.tar.gz
coreboot-4b93a4f47a7457162d1be20eeffe57f81d5cd6af.tar.bz2
coreboot-4b93a4f47a7457162d1be20eeffe57f81d5cd6af.zip
cbfstool: don't use endian to fix BSD hosts
endian.h lives in under sys on the BSDs. Replace htole32() with swab32(htonl(..)) as a proxy for little endian operations. Change-Id: I84a88f6882b6c8f14fb089e4b629e916386afe4d Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/11695 Tested-by: build bot (Jenkins) Reviewed-by: Idwer Vollering <vidwer@gmail.com> Reviewed-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
Diffstat (limited to 'util/cbfstool/cbfstool.c')
-rw-r--r--util/cbfstool/cbfstool.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c
index ed6e898f5d2b..5194061f3cf7 100644
--- a/util/cbfstool/cbfstool.c
+++ b/util/cbfstool/cbfstool.c
@@ -19,7 +19,6 @@
* Foundation, Inc.
*/
-#include <endian.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -272,7 +271,7 @@ static int cbfs_add_master_header(void)
// TODO: when we have a BE target, we'll need to store this as BE
*(uint32_t *)(buffer_get(&image.buffer) +
buffer_size(&image.buffer) - 4) =
- htole32(header_offset);
+ swab32(htonl(header_offset));
ret = 0;