aboutsummaryrefslogtreecommitdiff
path: root/include/image.h
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-07-02 19:23:25 -0400
committerWolfgang Denk <wd@denx.de>2009-07-19 21:41:46 +0200
commit37566090766d61beef70c62986b90749920255d8 (patch)
tree6770441ddc1bc0b9e662e2ea7102da8e10b62d61 /include/image.h
parent2a2ed845c085eb093b69fa6382fcf7534bb1f4b0 (diff)
compiler.h: unify system ifdef cruft here
Shove a lot of the HOSTCC and related #ifdef checking crap into the new compiler.h header so that we can keep all other headers nice and clean. Also introduce custom uswap functions so we don't have to rely on the non standard implementations that a host may (or may not in the case of OS X) provide. This allows mkimage to finally build cleanly on an OS X system. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'include/image.h')
-rw-r--r--include/image.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/include/image.h b/include/image.h
index f183757c8..beb3a16cd 100644
--- a/include/image.h
+++ b/include/image.h
@@ -33,10 +33,9 @@
#ifndef __IMAGE_H__
#define __IMAGE_H__
-#if USE_HOSTCC
-#ifndef __MINGW32__
-#include <endian.h>
-#endif
+#include "compiler.h"
+
+#ifdef USE_HOSTCC
/* new uImage format support enabled on host */
#define CONFIG_FIT 1
@@ -46,9 +45,7 @@
#else
#include <lmb.h>
-#include <linux/string.h>
#include <asm/u-boot.h>
-#include <asm/byteorder.h>
#endif /* USE_HOSTCC */
@@ -284,8 +281,8 @@ typedef struct bootm_headers {
#define CHUNKSZ_SHA1 (64 * 1024)
#endif
-#define uimage_to_cpu(x) ntohl(x)
-#define cpu_to_uimage(x) htonl(x)
+#define uimage_to_cpu(x) be32_to_cpu(x)
+#define cpu_to_uimage(x) cpu_to_be32(x)
const char *genimg_get_os_name (uint8_t os);
const char *genimg_get_arch_name (uint8_t arch);