summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-07-27 16:13:06 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-07-27 14:09:21 -0500
commite2542fe2bce6756948dffe2d233d154a9e25bd35 (patch)
tree187b840091116d420116fb2627e48afa25d59563
parentrename DEBUG_EXEC to CONFIG_DEBUG_EXEC (diff)
downloadqemu-kvm-e2542fe2bce6756948dffe2d233d154a9e25bd35.tar.gz
qemu-kvm-e2542fe2bce6756948dffe2d233d154a9e25bd35.tar.bz2
qemu-kvm-e2542fe2bce6756948dffe2d233d154a9e25bd35.zip
rename WORDS_BIGENDIAN to HOST_WORDS_BIGENDIAN
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r--Makefile.target8
-rw-r--r--audio/audio.h2
-rw-r--r--bswap.h4
-rwxr-xr-xconfigure4
-rw-r--r--console.c8
-rw-r--r--cpu-all.h12
-rw-r--r--cpu-defs.h2
-rw-r--r--disas.c2
-rw-r--r--fpu/softfloat.h2
-rw-r--r--hw/blizzard_template.h2
-rw-r--r--hw/bt-hci.c2
-rw-r--r--hw/gus.c2
-rw-r--r--hw/omap_lcd_template.h2
-rw-r--r--hw/pl110_template.h6
-rw-r--r--hw/pxa2xx_template.h2
-rw-r--r--hw/vga.c14
-rw-r--r--hw/vga_template.h6
-rw-r--r--linux-user/arm/nwfpe/double_cpdo.c4
-rw-r--r--linux-user/arm/nwfpe/fpa11_cpdt.c4
-rw-r--r--loader.c4
-rw-r--r--sdl.c4
-rw-r--r--slirp/ip.h6
-rw-r--r--slirp/slirp_config.h2
-rw-r--r--slirp/tcp.h2
-rw-r--r--target-arm/neon_helper.c2
-rw-r--r--target-i386/cpu.h2
-rw-r--r--target-i386/exec.h2
-rw-r--r--target-i386/translate.c4
-rw-r--r--target-mips/cpu.h2
-rw-r--r--target-ppc/op_helper.c30
-rw-r--r--target-ppc/translate.c4
-rw-r--r--target-ppc/translate_init.c4
-rw-r--r--target-sparc/op_helper.c2
-rw-r--r--tcg/arm/tcg-target.c2
-rw-r--r--vl.c2
-rw-r--r--vnc.c2
36 files changed, 82 insertions, 82 deletions
diff --git a/Makefile.target b/Makefile.target
index 687648c0b..560cc0cbb 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -234,7 +234,7 @@ LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
endif
ifeq ($(ARCH),mips)
-ifeq ($(WORDS_BIGENDIAN),yes)
+ifeq ($(HOST_WORDS_BIGENDIAN),y)
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
else
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
@@ -242,7 +242,7 @@ endif
endif
ifeq ($(ARCH),mips64)
-ifeq ($(WORDS_BIGENDIAN),yes)
+ifeq ($(HOST_WORDS_BIGENDIAN),y)
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
else
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
@@ -377,7 +377,7 @@ LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
endif
ifeq ($(ARCH),mips)
-ifeq ($(WORDS_BIGENDIAN),yes)
+ifeq ($(HOST_WORDS_BIGENDIAN),y)
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
else
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
@@ -385,7 +385,7 @@ endif
endif
ifeq ($(ARCH),mips64)
-ifeq ($(WORDS_BIGENDIAN),yes)
+ifeq ($(HOST_WORDS_BIGENDIAN),y)
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
else
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
diff --git a/audio/audio.h b/audio/audio.h
index 3fb2c8bbe..fda2af342 100644
--- a/audio/audio.h
+++ b/audio/audio.h
@@ -38,7 +38,7 @@ typedef enum {
AUD_FMT_S32
} audfmt_e;
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define AUDIO_HOST_ENDIANNESS 1
#else
#define AUDIO_HOST_ENDIANNESS 0
diff --git a/bswap.h b/bswap.h
index 06de5445e..455870429 100644
--- a/bswap.h
+++ b/bswap.h
@@ -81,7 +81,7 @@ static inline void bswap64s(uint64_t *s)
*s = bswap64(*s);
}
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
#define be_bswap(v, size) (v)
#define le_bswap(v, size) bswap ## size(v)
#define be_bswaps(v, size)
@@ -203,7 +203,7 @@ static inline void cpu_to_be32wu(uint32_t *p, uint32_t v)
#endif
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define cpu_to_32wu cpu_to_be32wu
#else
#define cpu_to_32wu cpu_to_le32wu
diff --git a/configure b/configure
index e6fba39ce..a3e543831 100755
--- a/configure
+++ b/configure
@@ -1528,8 +1528,8 @@ if test "$strip_opt" = "yes" ; then
echo "STRIP_OPT=-s" >> $config_host_mak
fi
if test "$bigendian" = "yes" ; then
- echo "WORDS_BIGENDIAN=yes" >> $config_host_mak
- echo "#define WORDS_BIGENDIAN 1" >> $config_host_h
+ echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak
+ echo "#define HOST_WORDS_BIGENDIAN 1" >> $config_host_h
fi
echo "#define HOST_LONG_BITS $hostlongbits" >> $config_host_h
if test "$mingw32" = "yes" ; then
diff --git a/console.c b/console.c
index 52e3e57b8..d55e0fdc0 100644
--- a/console.c
+++ b/console.c
@@ -307,7 +307,7 @@ static void vga_bitblt(DisplayState *ds, int xs, int ys, int xd, int yd, int w,
(((uint32_t)(__x) & (uint32_t)0x00ff0000UL) >> 8) | \
(((uint32_t)(__x) & (uint32_t)0xff000000UL) >> 24) ))
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define PAT(x) x
#else
#define PAT(x) cbswap_32(x)
@@ -1559,7 +1559,7 @@ DisplaySurface* defaultallocator_create_displaysurface(int width, int height)
surface->height = height;
surface->linesize = width * 4;
surface->pf = qemu_default_pixelformat(32);
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
surface->flags = QEMU_ALLOCATED_FLAG | QEMU_BIG_ENDIAN_FLAG;
#else
surface->flags = QEMU_ALLOCATED_FLAG;
@@ -1580,7 +1580,7 @@ DisplaySurface* defaultallocator_resize_displaysurface(DisplaySurface *surface,
surface->data = (uint8_t*) qemu_realloc(surface->data, surface->linesize * surface->height);
else
surface->data = (uint8_t*) qemu_malloc(surface->linesize * surface->height);
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
surface->flags = QEMU_ALLOCATED_FLAG | QEMU_BIG_ENDIAN_FLAG;
#else
surface->flags = QEMU_ALLOCATED_FLAG;
@@ -1598,7 +1598,7 @@ DisplaySurface* qemu_create_displaysurface_from(int width, int height, int bpp,
surface->height = height;
surface->linesize = linesize;
surface->pf = qemu_default_pixelformat(bpp);
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
surface->flags = QEMU_BIG_ENDIAN_FLAG;
#endif
surface->data = data;
diff --git a/cpu-all.h b/cpu-all.h
index 96b25fca8..26bf49286 100644
--- a/cpu-all.h
+++ b/cpu-all.h
@@ -27,7 +27,7 @@
* WORDS_ALIGNED : if defined, the host cpu can only make word aligned
* memory accesses.
*
- * WORDS_BIGENDIAN : if defined, the host cpu is big endian and
+ * HOST_WORDS_BIGENDIAN : if defined, the host cpu is big endian and
* otherwise little endian.
*
* (TARGET_WORDS_ALIGNED : same for target cpu (not supported yet))
@@ -37,7 +37,7 @@
#include "softfloat.h"
-#if defined(WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
#define BSWAP_NEEDED
#endif
@@ -123,7 +123,7 @@ typedef union {
endian ! */
typedef union {
float64 d;
-#if defined(WORDS_BIGENDIAN) \
+#if defined(HOST_WORDS_BIGENDIAN) \
|| (defined(__arm__) && !defined(__VFP_FP__) && !defined(CONFIG_SOFTFLOAT))
struct {
uint32_t upper;
@@ -141,7 +141,7 @@ typedef union {
#ifdef TARGET_SPARC
typedef union {
float128 q;
-#if defined(WORDS_BIGENDIAN) \
+#if defined(HOST_WORDS_BIGENDIAN) \
|| (defined(__arm__) && !defined(__VFP_FP__) && !defined(CONFIG_SOFTFLOAT))
struct {
uint32_t upmost;
@@ -221,7 +221,7 @@ static inline void stb_p(void *ptr, int v)
/* NOTE: on arm, putting 2 in /proc/sys/debug/alignment so that the
kernel handles unaligned load/stores may give better results, but
it is a system wide setting : bad */
-#if defined(WORDS_BIGENDIAN) || defined(WORDS_ALIGNED)
+#if defined(HOST_WORDS_BIGENDIAN) || defined(WORDS_ALIGNED)
/* conservative code for little endian unaligned accesses */
static inline int lduw_le_p(const void *ptr)
@@ -398,7 +398,7 @@ static inline void stfq_le_p(void *ptr, float64 v)
}
#endif
-#if !defined(WORDS_BIGENDIAN) || defined(WORDS_ALIGNED)
+#if !defined(HOST_WORDS_BIGENDIAN) || defined(WORDS_ALIGNED)
static inline int lduw_be_p(const void *ptr)
{
diff --git a/cpu-defs.h b/cpu-defs.h
index d73ec0ab3..5b80b1b36 100644
--- a/cpu-defs.h
+++ b/cpu-defs.h
@@ -106,7 +106,7 @@ typedef struct CPUTLBEntry {
sizeof(target_phys_addr_t))];
} CPUTLBEntry;
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
typedef struct icount_decr_u16 {
uint16_t high;
uint16_t low;
diff --git a/disas.c b/disas.c
index af5a9ea14..ce342bc8e 100644
--- a/disas.c
+++ b/disas.c
@@ -246,7 +246,7 @@ void disas(FILE *out, void *code, unsigned long size)
disasm_info.buffer_vma = (unsigned long)code;
disasm_info.buffer_length = size;
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
disasm_info.endian = BFD_ENDIAN_BIG;
#else
disasm_info.endian = BFD_ENDIAN_LITTLE;
diff --git a/fpu/softfloat.h b/fpu/softfloat.h
index f26215088..bebfefd05 100644
--- a/fpu/softfloat.h
+++ b/fpu/softfloat.h
@@ -146,7 +146,7 @@ typedef struct {
#endif
#ifdef FLOAT128
typedef struct {
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
uint64_t high, low;
#else
uint64_t low, high;
diff --git a/hw/blizzard_template.h b/hw/blizzard_template.h
index 0ef27d1c4..42f4e90b0 100644
--- a/hw/blizzard_template.h
+++ b/hw/blizzard_template.h
@@ -41,7 +41,7 @@
# error unknown bit depth
#endif
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
# define SWAP_WORDS 1
#endif
diff --git a/hw/bt-hci.c b/hw/bt-hci.c
index 6a7909406..d510d8118 100644
--- a/hw/bt-hci.c
+++ b/hw/bt-hci.c
@@ -419,7 +419,7 @@ static void bt_submit_raw_acl(struct bt_piconet_s *net, int length, uint8_t *dat
* be continuously allocated. We do it though, to preserve similar
* behaviour between hosts. Some things, like the BD_ADDR cannot be
* preserved though (for example if a real hci is used). */
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
# define HNDL(raw) bswap16(raw)
#else
# define HNDL(raw) (raw)
diff --git a/hw/gus.c b/hw/gus.c
index 8915d4346..5e73c5a01 100644
--- a/hw/gus.c
+++ b/hw/gus.c
@@ -35,7 +35,7 @@
#define ldebug(...)
#endif
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define GUS_ENDIANNESS 1
#else
#define GUS_ENDIANNESS 0
diff --git a/hw/omap_lcd_template.h b/hw/omap_lcd_template.h
index 0590e4501..2fb96f83a 100644
--- a/hw/omap_lcd_template.h
+++ b/hw/omap_lcd_template.h
@@ -152,7 +152,7 @@ static void glue(draw_line12_, DEPTH)(void *opaque,
static void glue(draw_line16_, DEPTH)(void *opaque,
uint8_t *d, const uint8_t *s, int width, int deststep)
{
-#if DEPTH == 16 && defined(WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN)
+#if DEPTH == 16 && defined(HOST_WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN)
memcpy(d, s, width * 2);
#else
uint16_t v;
diff --git a/hw/pl110_template.h b/hw/pl110_template.h
index d7ff8bc61..b3c9077dc 100644
--- a/hw/pl110_template.h
+++ b/hw/pl110_template.h
@@ -95,18 +95,18 @@ static drawfn glue(pl110_draw_fn_,BITS)[36] =
#if ORDER == 0
#define NAME glue(glue(lblp_, BORDER), BITS)
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define SWAP_WORDS 1
#endif
#elif ORDER == 1
#define NAME glue(glue(bbbp_, BORDER), BITS)
-#ifndef WORDS_BIGENDIAN
+#ifndef HOST_WORDS_BIGENDIAN
#define SWAP_WORDS 1
#endif
#else
#define SWAP_PIXELS 1
#define NAME glue(glue(lbbp_, BORDER), BITS)
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define SWAP_WORDS 1
#endif
#endif
diff --git a/hw/pxa2xx_template.h b/hw/pxa2xx_template.h
index 35312ec29..40f4e4d21 100644
--- a/hw/pxa2xx_template.h
+++ b/hw/pxa2xx_template.h
@@ -23,7 +23,7 @@
# error unknown bit depth
#endif
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
# define SWAP_WORDS 1
#endif
diff --git a/hw/vga.c b/hw/vga.c
index 91a6852f2..c2e08b947 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -74,19 +74,19 @@ const uint8_t gr_mask[16] = {
(((uint32_t)(__x) & (uint32_t)0x00ff0000UL) >> 8) | \
(((uint32_t)(__x) & (uint32_t)0xff000000UL) >> 24) ))
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define PAT(x) cbswap_32(x)
#else
#define PAT(x) (x)
#endif
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define BIG 1
#else
#define BIG 0
#endif
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define GET_PLANE(data, p) (((data) >> (24 - (p) * 8)) & 0xff)
#else
#define GET_PLANE(data, p) (((data) >> ((p) * 8)) & 0xff)
@@ -113,7 +113,7 @@ static const uint32_t mask16[16] = {
#undef PAT
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define PAT(x) (x)
#else
#define PAT(x) cbswap_32(x)
@@ -1369,7 +1369,7 @@ static void vga_draw_text(VGAState *s, int full_update)
if (cx > cx_max)
cx_max = cx;
*ch_attr_ptr = ch_attr;
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
ch = ch_attr >> 8;
cattr = ch_attr & 0xff;
#else
@@ -1632,7 +1632,7 @@ static void vga_draw_graphic(VGAState *s, int full_update)
disp_width != s->last_width ||
height != s->last_height ||
s->last_depth != depth) {
-#if defined(WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN)
if (depth == 16 || depth == 32) {
#else
if (depth == 32) {
@@ -1641,7 +1641,7 @@ static void vga_draw_graphic(VGAState *s, int full_update)
s->ds->surface = qemu_create_displaysurface_from(disp_width, height, depth,
s->line_offset,
s->vram_ptr + (s->start_addr * 4));
-#if defined(WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
s->ds->surface->pf = qemu_different_endianness_pixelformat(depth);
#endif
dpy_resize(s->ds);
diff --git a/hw/vga_template.h b/hw/vga_template.h
index 0bc2e8020..8f32a77b6 100644
--- a/hw/vga_template.h
+++ b/hw/vga_template.h
@@ -417,7 +417,7 @@ void glue(vga_draw_cursor_line_, DEPTH)(uint8_t *d1,
static void glue(vga_draw_line15_, PIXEL_NAME)(VGAState *s1, uint8_t *d,
const uint8_t *s, int width)
{
-#if DEPTH == 15 && defined(WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN)
+#if DEPTH == 15 && defined(HOST_WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN)
memcpy(d, s, width * 2);
#else
int w;
@@ -442,7 +442,7 @@ static void glue(vga_draw_line15_, PIXEL_NAME)(VGAState *s1, uint8_t *d,
static void glue(vga_draw_line16_, PIXEL_NAME)(VGAState *s1, uint8_t *d,
const uint8_t *s, int width)
{
-#if DEPTH == 16 && defined(WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN)
+#if DEPTH == 16 && defined(HOST_WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN)
memcpy(d, s, width * 2);
#else
int w;
@@ -493,7 +493,7 @@ static void glue(vga_draw_line24_, PIXEL_NAME)(VGAState *s1, uint8_t *d,
static void glue(vga_draw_line32_, PIXEL_NAME)(VGAState *s1, uint8_t *d,
const uint8_t *s, int width)
{
-#if DEPTH == 32 && defined(WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN) && !defined(BGR_FORMAT)
+#if DEPTH == 32 && defined(HOST_WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN) && !defined(BGR_FORMAT)
memcpy(d, s, width * 4);
#else
int w;
diff --git a/linux-user/arm/nwfpe/double_cpdo.c b/linux-user/arm/nwfpe/double_cpdo.c
index b5320c82a..655a83d0b 100644
--- a/linux-user/arm/nwfpe/double_cpdo.c
+++ b/linux-user/arm/nwfpe/double_cpdo.c
@@ -150,7 +150,7 @@ unsigned int DoubleCPDO(const unsigned int opcode)
case MNF_CODE:
{
unsigned int *p = (unsigned int*)&rFm;
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
p[0] ^= 0x80000000;
#else
p[1] ^= 0x80000000;
@@ -162,7 +162,7 @@ unsigned int DoubleCPDO(const unsigned int opcode)
case ABS_CODE:
{
unsigned int *p = (unsigned int*)&rFm;
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
p[0] &= 0x7fffffff;
#else
p[1] &= 0x7fffffff;
diff --git a/linux-user/arm/nwfpe/fpa11_cpdt.c b/linux-user/arm/nwfpe/fpa11_cpdt.c
index 76c6dcff3..1c4095402 100644
--- a/linux-user/arm/nwfpe/fpa11_cpdt.c
+++ b/linux-user/arm/nwfpe/fpa11_cpdt.c
@@ -44,7 +44,7 @@ void loadDouble(const unsigned int Fn, target_ulong addr)
unsigned int *p;
p = (unsigned int*)&fpa11->fpreg[Fn].fDouble;
fpa11->fType[Fn] = typeDouble;
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
/* FIXME - handle failure of get_user() */
get_user_u32(p[0], addr); /* sign & exponent */
get_user_u32(p[1], addr + 4);
@@ -147,7 +147,7 @@ void storeDouble(const unsigned int Fn, target_ulong addr)
default: val = fpa11->fpreg[Fn].fDouble;
}
/* FIXME - handle put_user() failures */
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
put_user_u32(p[0], addr); /* msw */
put_user_u32(p[1], addr + 4); /* lsw */
#else
diff --git a/loader.c b/loader.c
index b5c5914c2..0cbcf9c6a 100644
--- a/loader.c
+++ b/loader.c
@@ -324,7 +324,7 @@ int load_elf(const char *filename, int64_t address_offset,
e_ident[2] != ELFMAG2 ||
e_ident[3] != ELFMAG3)
goto fail;
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
data_order = ELFDATA2MSB;
#else
data_order = ELFDATA2LSB;
@@ -358,7 +358,7 @@ int load_elf(const char *filename, int64_t address_offset,
static void bswap_uboot_header(uboot_image_header_t *hdr)
{
-#ifndef WORDS_BIGENDIAN
+#ifndef HOST_WORDS_BIGENDIAN
bswap32s(&hdr->ih_magic);
bswap32s(&hdr->ih_hcrc);
bswap32s(&hdr->ih_time);
diff --git a/sdl.c b/sdl.c
index 6d88cd525..50a4a016d 100644
--- a/sdl.c
+++ b/sdl.c
@@ -185,7 +185,7 @@ static DisplaySurface* sdl_create_displaysurface(int width, int height)
surface->linesize = width * host_format.BytesPerPixel;
surface->pf = sdl_to_qemu_pixelformat(&host_format);
}
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
surface->flags = QEMU_ALLOCATED_FLAG | QEMU_BIG_ENDIAN_FLAG;
#else
surface->flags = QEMU_ALLOCATED_FLAG;
@@ -204,7 +204,7 @@ static DisplaySurface* sdl_create_displaysurface(int width, int height)
surface->linesize = real_screen->pitch;
surface->data = real_screen->pixels;
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
surface->flags = QEMU_REALPIXELS_FLAG | QEMU_BIG_ENDIAN_FLAG;
#else
surface->flags = QEMU_REALPIXELS_FLAG;
diff --git a/slirp/ip.h b/slirp/ip.h
index 574fc019a..5074e3312 100644
--- a/slirp/ip.h
+++ b/slirp/ip.h
@@ -33,7 +33,7 @@
#ifndef _IP_H_
#define _IP_H_
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
# ifndef NTOHL
# define NTOHL(d)
# endif
@@ -73,7 +73,7 @@ typedef u_int32_t n_long; /* long as received from the net */
* Structure of an internet header, naked of options.
*/
struct ip {
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
u_int ip_v:4, /* version */
ip_hl:4; /* header length */
#else
@@ -139,7 +139,7 @@ struct ip_timestamp {
u_int8_t ipt_code; /* IPOPT_TS */
u_int8_t ipt_len; /* size of structure (variable) */
u_int8_t ipt_ptr; /* index of current entry */
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
u_int ipt_oflw:4, /* overflow counter */
ipt_flg:4; /* flags, see below */
#else
diff --git a/slirp/slirp_config.h b/slirp/slirp_config.h
index e977e77f8..a40248eb7 100644
--- a/slirp/slirp_config.h
+++ b/slirp/slirp_config.h
@@ -83,7 +83,7 @@
#undef HAVE_SYS_BITYPES_H
/* Define if the machine is big endian */
-//#undef WORDS_BIGENDIAN
+//#undef HOST_WORDS_BIGENDIAN
/* Define if your sprintf returns char * instead of int */
#undef BAD_SPRINTF
diff --git a/slirp/tcp.h b/slirp/tcp.h
index c65ed4342..c7e3457b7 100644
--- a/slirp/tcp.h
+++ b/slirp/tcp.h
@@ -50,7 +50,7 @@ struct tcphdr {
u_int16_t th_dport; /* destination port */
tcp_seq th_seq; /* sequence number */
tcp_seq th_ack; /* acknowledgement number */
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
u_int th_off:4, /* data offset */
th_x2:4; /* (unused) */
#else
diff --git a/target-arm/neon_helper.c b/target-arm/neon_helper.c
index 35fbaf530..f32ecd6e2 100644
--- a/target-arm/neon_helper.c
+++ b/target-arm/neon_helper.c
@@ -49,7 +49,7 @@ typedef struct \
{ \
type v1; \
} neon_##name;
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define NEON_TYPE2(name, type) \
typedef struct \
{ \
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 08200edaf..6a96e9329 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -528,7 +528,7 @@ typedef union {
uint64_t q;
} MMXReg;
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define XMM_B(n) _b[15 - (n)]
#define XMM_W(n) _w[7 - (n)]
#define XMM_L(n) _l[3 - (n)]
diff --git a/target-i386/exec.h b/target-i386/exec.h
index 3e998d24f..c59c4e872 100644
--- a/target-i386/exec.h
+++ b/target-i386/exec.h
@@ -155,7 +155,7 @@ typedef union {
/* NOTE: arm is horrible as double 32 bit words are stored in big endian ! */
typedef union {
double d;
-#if !defined(WORDS_BIGENDIAN) && !defined(__arm__)
+#if !defined(HOST_WORDS_BIGENDIAN) && !defined(__arm__)
struct {
uint32_t lower;
int32_t upper;
diff --git a/target-i386/translate.c b/target-i386/translate.c
index 380009e39..ff9398575 100644
--- a/target-i386/translate.c
+++ b/target-i386/translate.c
@@ -255,7 +255,7 @@ static inline void gen_op_andl_A0_ffff(void)
#endif /* !TARGET_X86_64 */
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
#define REG_B_OFFSET (sizeof(target_ulong) - 1)
#define REG_H_OFFSET (sizeof(target_ulong) - 2)
#define REG_W_OFFSET (sizeof(target_ulong) - 2)
@@ -7151,7 +7151,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
break;
case 4: /* smsw */
gen_svm_check_intercept(s, pc_start, SVM_EXIT_READ_CR0);
-#if defined TARGET_X86_64 && defined WORDS_BIGENDIAN
+#if defined TARGET_X86_64 && defined HOST_WORDS_BIGENDIAN
tcg_gen_ld32u_tl(cpu_T[0], cpu_env, offsetof(CPUX86State,cr[0]) + 4);
#else
tcg_gen_ld32u_tl(cpu_T[0], cpu_env, offsetof(CPUX86State,cr[0]));
diff --git a/target-mips/cpu.h b/target-mips/cpu.h
index 5115cd6fc..789176b7a 100644
--- a/target-mips/cpu.h
+++ b/target-mips/cpu.h
@@ -62,7 +62,7 @@ union fpr_t {
/* define FP_ENDIAN_IDX to access the same location
* in the fpr_t union regardless of the host endianess
*/
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
# define FP_ENDIAN_IDX 1
#else
# define FP_ENDIAN_IDX 0
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c
index c352aa71b..ad6d8ee9b 100644
--- a/target-ppc/op_helper.c
+++ b/target-ppc/op_helper.c
@@ -1921,7 +1921,7 @@ target_ulong helper_dlmzb (target_ulong high, target_ulong low, uint32_t update_
/*****************************************************************************/
/* Altivec extension helpers */
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
#define HI_IDX 0
#define LO_IDX 1
#else
@@ -1929,7 +1929,7 @@ target_ulong helper_dlmzb (target_ulong high, target_ulong low, uint32_t update_
#define LO_IDX 0
#endif
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
#define VECTOR_FOR_INORDER_I(index, element) \
for (index = 0; index < ARRAY_SIZE(r->element); index++)
#else
@@ -2055,7 +2055,7 @@ STVE(stvewx, stl, bswap32, u32)
void helper_mtvscr (ppc_avr_t *r)
{
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
env->vscr = r->u32[3];
#else
env->vscr = r->u32[0];
@@ -2422,7 +2422,7 @@ void helper_vmladduhm (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c)
} \
*r = result; \
}
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
#define MRGHI 0
#define MRGLO 1
#else
@@ -2583,7 +2583,7 @@ void helper_vperm (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c)
int i;
VECTOR_FOR_INORDER_I (i, u8) {
int s = c->u8[i] & 0x1f;
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
int index = s & 0xf;
#else
int index = 15 - (s & 0xf);
@@ -2597,7 +2597,7 @@ void helper_vperm (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c)
*r = result;
}
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
#define PKBIG 1
#else
#define PKBIG 0
@@ -2606,7 +2606,7 @@ void helper_vpkpx (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
{
int i, j;
ppc_avr_t result;
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
const ppc_avr_t *x[2] = { a, b };
#else
const ppc_avr_t *x[2] = { b, a };
@@ -2723,7 +2723,7 @@ void helper_vlogefp (ppc_avr_t *r, ppc_avr_t *b)
}
}
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
#define LEFT 0
#define RIGHT 1
#else
@@ -2783,7 +2783,7 @@ void helper_vsldoi (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, uint32_t shift)
int i;
ppc_avr_t result;
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
for (i = 0; i < ARRAY_SIZE(r->u8); i++) {
int index = sh + i;
if (index > 0xf) {
@@ -2809,7 +2809,7 @@ void helper_vslo (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
{
int sh = (b->u8[LO_IDX*0xf] >> 3) & 0xf;
-#if defined (WORDS_BIGENDIAN)
+#if defined (HOST_WORDS_BIGENDIAN)
memmove (&r->u8[0], &a->u8[sh], 16-sh);
memset (&r->u8[16-sh], 0, sh);
#else
@@ -2820,7 +2820,7 @@ void helper_vslo (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
/* Experimental testing shows that hardware masks the immediate. */
#define _SPLAT_MASKED(element) (splat & (ARRAY_SIZE(r->element) - 1))
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
#define SPLAT_ELEMENT(element) _SPLAT_MASKED(element)
#else
#define SPLAT_ELEMENT(element) (ARRAY_SIZE(r->element)-1 - _SPLAT_MASKED(element))
@@ -2877,7 +2877,7 @@ void helper_vsro (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
{
int sh = (b->u8[LO_IDX*0xf] >> 3) & 0xf;
-#if defined (WORDS_BIGENDIAN)
+#if defined (HOST_WORDS_BIGENDIAN)
memmove (&r->u8[sh], &a->u8[0], 16-sh);
memset (&r->u8[0], 0, sh);
#else
@@ -2901,7 +2901,7 @@ void helper_vsumsws (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
ppc_avr_t result;
int sat = 0;
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
upper = ARRAY_SIZE(r->s32)-1;
#else
upper = 0;
@@ -2925,7 +2925,7 @@ void helper_vsum2sws (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
ppc_avr_t result;
int sat = 0;
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
upper = 1;
#else
upper = 0;
@@ -2997,7 +2997,7 @@ void helper_vsum4ubs (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
}
}
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
#define UPKHI 1
#define UPKLO 0
#else
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index da3d7de8a..58818c211 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -120,7 +120,7 @@ void ppc_translate_init(void)
cpu_reg_names_size -= (i < 10) ? 4 : 5;
snprintf(p, cpu_reg_names_size, "avr%dH", i);
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
cpu_avrh[i] = tcg_global_mem_new_i64(TCG_AREG0,
offsetof(CPUState, avr[i].u64[0]), p);
#else
@@ -131,7 +131,7 @@ void ppc_translate_init(void)
cpu_reg_names_size -= (i < 10) ? 6 : 7;
snprintf(p, cpu_reg_names_size, "avr%dL", i);
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
cpu_avrl[i] = tcg_global_mem_new_i64(TCG_AREG0,
offsetof(CPUState, avr[i].u64[1]), p);
#else
diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index 3b6e2d504..1731d12ed 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -9388,7 +9388,7 @@ static int gdb_set_float_reg(CPUState *env, uint8_t *mem_buf, int n)
static int gdb_get_avr_reg(CPUState *env, uint8_t *mem_buf, int n)
{
if (n < 32) {
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
stq_p(mem_buf, env->avr[n].u64[0]);
stq_p(mem_buf+8, env->avr[n].u64[1]);
#else
@@ -9411,7 +9411,7 @@ static int gdb_get_avr_reg(CPUState *env, uint8_t *mem_buf, int n)
static int gdb_set_avr_reg(CPUState *env, uint8_t *mem_buf, int n)
{
if (n < 32) {
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
env->avr[n].u64[0] = ldq_p(mem_buf);
env->avr[n].u64[1] = ldq_p(mem_buf+8);
#else
diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c
index 9b959fe30..0234e519e 100644
--- a/target-sparc/op_helper.c
+++ b/target-sparc/op_helper.c
@@ -385,7 +385,7 @@ void helper_faligndata(void)
*((uint64_t *)&DT0) = tmp;
}
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define VIS_B64(n) b[7 - (n)]
#define VIS_W64(n) w[3 - (n)]
#define VIS_SW64(n) sw[3 - (n)]
diff --git a/tcg/arm/tcg-target.c b/tcg/arm/tcg-target.c
index 7ef2b898a..672373d3e 100644
--- a/tcg/arm/tcg-target.c
+++ b/tcg/arm/tcg-target.c
@@ -282,7 +282,7 @@ static inline void tcg_out_b(TCGContext *s, int cond, int32_t offset)
static inline void tcg_out_b_noaddr(TCGContext *s, int cond)
{
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
tcg_out8(s, (cond << 4) | 0x0a);
s->code_ptr += 3;
#else
diff --git a/vl.c b/vl.c
index f02b399fb..bb56644e2 100644
--- a/vl.c
+++ b/vl.c
@@ -506,7 +506,7 @@ uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c)
union {
uint64_t ll;
struct {
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
uint32_t high, low;
#else
uint32_t low, high;
diff --git a/vnc.c b/vnc.c
index de0ff872d..dfcf34c01 100644
--- a/vnc.c
+++ b/vnc.c
@@ -1656,7 +1656,7 @@ static void pixel_format_message (VncState *vs) {
vnc_write_u8(vs, vs->ds->surface->pf.bits_per_pixel); /* bits-per-pixel */
vnc_write_u8(vs, vs->ds->surface->pf.depth); /* depth */
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
vnc_write_u8(vs, 1); /* big-endian-flag */
#else
vnc_write_u8(vs, 0); /* big-endian-flag */