diff options
author | Stefan Reinauer <reinauer@chromium.org> | 2011-10-21 14:24:57 -0700 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2011-10-24 20:29:29 +0200 |
commit | a1e4824f73602a411826b27160a8818049ce0f97 (patch) | |
tree | 777dcf31f4eddaaf0c68078814bd27fb63f03524 /util/cbfstool/cbfs.h | |
parent | 3c976791b06c75e8983266b3551f133d89924376 (diff) | |
download | coreboot-a1e4824f73602a411826b27160a8818049ce0f97.tar.gz coreboot-a1e4824f73602a411826b27160a8818049ce0f97.tar.bz2 coreboot-a1e4824f73602a411826b27160a8818049ce0f97.zip |
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.h')
-rw-r--r-- | util/cbfstool/cbfs.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/util/cbfstool/cbfs.h b/util/cbfstool/cbfs.h index 5c93838a36b1..cdd003062fff 100644 --- a/util/cbfstool/cbfs.h +++ b/util/cbfstool/cbfs.h @@ -29,7 +29,7 @@ struct cbfs_header { } __attribute__ ((packed)); struct cbfs_file { - char magic[8]; + uint8_t magic[8]; uint32_t len; uint32_t type; uint32_t checksum; @@ -37,11 +37,11 @@ struct cbfs_file { } __attribute__ ((packed)); struct cbfs_stage { - unsigned int compression; - unsigned long long entry; - unsigned long long load; - unsigned int len; - unsigned int memlen; + uint32_t compression; + uint64_t entry; + uint64_t load; + uint32_t len; + uint32_t memlen; } __attribute__ ((packed)); #define PAYLOAD_SEGMENT_CODE 0x45444F43 @@ -51,12 +51,12 @@ struct cbfs_stage { #define PAYLOAD_SEGMENT_ENTRY 0x52544E45 struct cbfs_payload_segment { - unsigned int type; - unsigned int compression; - unsigned int offset; - unsigned long long load_addr; - unsigned int len; - unsigned int mem_len; + uint32_t type; + uint32_t compression; + uint32_t offset; + uint64_t load_addr; + uint32_t len; + uint32_t mem_len; } __attribute__ ((packed)); struct cbfs_payload { |