summaryrefslogtreecommitdiff
path: root/util/cbfstool/cbfs-mkpayload.c
diff options
context:
space:
mode:
authorStefan Reinauer <reinauer@chromium.org>2011-10-21 14:24:57 -0700
committerStefan Reinauer <stefan.reinauer@coreboot.org>2011-10-24 20:29:29 +0200
commita1e4824f73602a411826b27160a8818049ce0f97 (patch)
tree777dcf31f4eddaaf0c68078814bd27fb63f03524 /util/cbfstool/cbfs-mkpayload.c
parent3c976791b06c75e8983266b3551f133d89924376 (diff)
downloadcoreboot-a1e4824f73602a411826b27160a8818049ce0f97.tar.xz
Various fixes to cbfstool.
- add ntohll and htonll (as coreboot parses 64bit fields now) - use the same byte swapping code across platforms - detect endianess early - fix lots of warnings - Don't override CFLAGS in Makefile Change-Id: Iaea02ff7a31ab6a95fd47858d0efd9af764a3e5f Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/313 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'util/cbfstool/cbfs-mkpayload.c')
-rw-r--r--util/cbfstool/cbfs-mkpayload.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/util/cbfstool/cbfs-mkpayload.c b/util/cbfstool/cbfs-mkpayload.c
index baa92ff237..ff6479dc66 100644
--- a/util/cbfstool/cbfs-mkpayload.c
+++ b/util/cbfstool/cbfs-mkpayload.c
@@ -152,9 +152,9 @@ int parse_elf_to_payload(unsigned char *input, unsigned char **output,
if (phdr[i].p_filesz == 0) {
segs[segments].type = PAYLOAD_SEGMENT_BSS;
segs[segments].load_addr =
- (unsigned long long)htonl(phdr[i].p_paddr);
+ (uint64_t)htonll(phdr[i].p_paddr);
segs[segments].mem_len =
- (unsigned int)htonl(phdr[i].p_memsz);
+ (uint32_t)htonl(phdr[i].p_memsz);
segs[segments].offset = htonl(doffset);
segments++;
@@ -162,8 +162,8 @@ int parse_elf_to_payload(unsigned char *input, unsigned char **output,
}
segs[segments].type = PAYLOAD_SEGMENT_DATA;
- segs[segments].load_addr = (unsigned int)htonl(phdr[i].p_paddr);
- segs[segments].mem_len = (unsigned int)htonl(phdr[i].p_memsz);
+ segs[segments].load_addr = (uint64_t)htonll(phdr[i].p_paddr);
+ segs[segments].mem_len = (uint32_t)htonl(phdr[i].p_memsz);
segs[segments].compression = htonl(algo);
segs[segments].offset = htonl(doffset);
@@ -190,7 +190,7 @@ int parse_elf_to_payload(unsigned char *input, unsigned char **output,
}
segs[segments].type = PAYLOAD_SEGMENT_ENTRY;
- segs[segments++].load_addr = (unsigned long long)htonl(ehdr->e_entry);
+ segs[segments++].load_addr = (uint64_t)htonll(ehdr->e_entry);
*output = sptr;