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>
This commit is contained in:
Aaron Durbin 2015-09-21 13:10:13 -05:00 committed by Patrick Georgi
parent b946f12ed0
commit 4b93a4f47a
1 changed files with 1 additions and 2 deletions

View File

@ -19,7 +19,6 @@
* Foundation, Inc. * Foundation, Inc.
*/ */
#include <endian.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.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 // TODO: when we have a BE target, we'll need to store this as BE
*(uint32_t *)(buffer_get(&image.buffer) + *(uint32_t *)(buffer_get(&image.buffer) +
buffer_size(&image.buffer) - 4) = buffer_size(&image.buffer) - 4) =
htole32(header_offset); swab32(htonl(header_offset));
ret = 0; ret = 0;