util/cbfstool: Replace swab.h with commonlib/bsd/sysincludes.h

Instead of maintaining another set of byteswapping functions in
cbfstool, this change removes swab.h and replaces it with
bsd/sysincludes.h from commonlib. Callers have been updated to use
be32toh/be64toh/htobe32/htobe64 instead of ntohl/ntohll/htonl/htonll
respectively.

Change-Id: I54195865ab4042fcf83609fcf67ef8f33994d68e
Signed-off-by: Alex James <theracermaster@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60233
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
Alex James
2021-12-19 16:41:59 -06:00
committed by Julius Werner
parent f6e74c45c0
commit 02001a38be
8 changed files with 111 additions and 179 deletions

View File

@@ -15,17 +15,6 @@
/* Utilities */
int verbose = 0;
/* Small, OS/libc independent runtime check for endianness */
int is_big_endian(void)
{
static const uint32_t inttest = 0x12345678;
const uint8_t inttest_lsb = *(const uint8_t *)&inttest;
if (inttest_lsb == 0x12) {
return 1;
}
return 0;
}
static off_t get_file_size(FILE *f)
{
off_t fsize;