Commit e2542fe2bce6756948dffe2d233d154a9e25bd35
Committed by
Anthony Liguori
1 parent
f0667e66
rename WORDS_BIGENDIAN to HOST_WORDS_BIGENDIAN
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Showing
36 changed files
with
82 additions
and
82 deletions
Makefile.target
| ... | ... | @@ -234,7 +234,7 @@ LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
| 234 | 234 | endif |
| 235 | 235 | |
| 236 | 236 | ifeq ($(ARCH),mips) |
| 237 | -ifeq ($(WORDS_BIGENDIAN),yes) | |
| 237 | +ifeq ($(HOST_WORDS_BIGENDIAN),y) | |
| 238 | 238 | LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
| 239 | 239 | else |
| 240 | 240 | LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld |
| ... | ... | @@ -242,7 +242,7 @@ endif |
| 242 | 242 | endif |
| 243 | 243 | |
| 244 | 244 | ifeq ($(ARCH),mips64) |
| 245 | -ifeq ($(WORDS_BIGENDIAN),yes) | |
| 245 | +ifeq ($(HOST_WORDS_BIGENDIAN),y) | |
| 246 | 246 | LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
| 247 | 247 | else |
| 248 | 248 | LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld |
| ... | ... | @@ -377,7 +377,7 @@ LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
| 377 | 377 | endif |
| 378 | 378 | |
| 379 | 379 | ifeq ($(ARCH),mips) |
| 380 | -ifeq ($(WORDS_BIGENDIAN),yes) | |
| 380 | +ifeq ($(HOST_WORDS_BIGENDIAN),y) | |
| 381 | 381 | LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
| 382 | 382 | else |
| 383 | 383 | LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld |
| ... | ... | @@ -385,7 +385,7 @@ endif |
| 385 | 385 | endif |
| 386 | 386 | |
| 387 | 387 | ifeq ($(ARCH),mips64) |
| 388 | -ifeq ($(WORDS_BIGENDIAN),yes) | |
| 388 | +ifeq ($(HOST_WORDS_BIGENDIAN),y) | |
| 389 | 389 | LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
| 390 | 390 | else |
| 391 | 391 | LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld | ... | ... |
audio/audio.h
bswap.h
| ... | ... | @@ -81,7 +81,7 @@ static inline void bswap64s(uint64_t *s) |
| 81 | 81 | *s = bswap64(*s); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | -#if defined(WORDS_BIGENDIAN) | |
| 84 | +#if defined(HOST_WORDS_BIGENDIAN) | |
| 85 | 85 | #define be_bswap(v, size) (v) |
| 86 | 86 | #define le_bswap(v, size) bswap ## size(v) |
| 87 | 87 | #define be_bswaps(v, size) |
| ... | ... | @@ -203,7 +203,7 @@ static inline void cpu_to_be32wu(uint32_t *p, uint32_t v) |
| 203 | 203 | |
| 204 | 204 | #endif |
| 205 | 205 | |
| 206 | -#ifdef WORDS_BIGENDIAN | |
| 206 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 207 | 207 | #define cpu_to_32wu cpu_to_be32wu |
| 208 | 208 | #else |
| 209 | 209 | #define cpu_to_32wu cpu_to_le32wu | ... | ... |
configure
| ... | ... | @@ -1528,8 +1528,8 @@ if test "$strip_opt" = "yes" ; then |
| 1528 | 1528 | echo "STRIP_OPT=-s" >> $config_host_mak |
| 1529 | 1529 | fi |
| 1530 | 1530 | if test "$bigendian" = "yes" ; then |
| 1531 | - echo "WORDS_BIGENDIAN=yes" >> $config_host_mak | |
| 1532 | - echo "#define WORDS_BIGENDIAN 1" >> $config_host_h | |
| 1531 | + echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak | |
| 1532 | + echo "#define HOST_WORDS_BIGENDIAN 1" >> $config_host_h | |
| 1533 | 1533 | fi |
| 1534 | 1534 | echo "#define HOST_LONG_BITS $hostlongbits" >> $config_host_h |
| 1535 | 1535 | if test "$mingw32" = "yes" ; then | ... | ... |
console.c
| ... | ... | @@ -307,7 +307,7 @@ static void vga_bitblt(DisplayState *ds, int xs, int ys, int xd, int yd, int w, |
| 307 | 307 | (((uint32_t)(__x) & (uint32_t)0x00ff0000UL) >> 8) | \ |
| 308 | 308 | (((uint32_t)(__x) & (uint32_t)0xff000000UL) >> 24) )) |
| 309 | 309 | |
| 310 | -#ifdef WORDS_BIGENDIAN | |
| 310 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 311 | 311 | #define PAT(x) x |
| 312 | 312 | #else |
| 313 | 313 | #define PAT(x) cbswap_32(x) |
| ... | ... | @@ -1559,7 +1559,7 @@ DisplaySurface* defaultallocator_create_displaysurface(int width, int height) |
| 1559 | 1559 | surface->height = height; |
| 1560 | 1560 | surface->linesize = width * 4; |
| 1561 | 1561 | surface->pf = qemu_default_pixelformat(32); |
| 1562 | -#ifdef WORDS_BIGENDIAN | |
| 1562 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 1563 | 1563 | surface->flags = QEMU_ALLOCATED_FLAG | QEMU_BIG_ENDIAN_FLAG; |
| 1564 | 1564 | #else |
| 1565 | 1565 | surface->flags = QEMU_ALLOCATED_FLAG; |
| ... | ... | @@ -1580,7 +1580,7 @@ DisplaySurface* defaultallocator_resize_displaysurface(DisplaySurface *surface, |
| 1580 | 1580 | surface->data = (uint8_t*) qemu_realloc(surface->data, surface->linesize * surface->height); |
| 1581 | 1581 | else |
| 1582 | 1582 | surface->data = (uint8_t*) qemu_malloc(surface->linesize * surface->height); |
| 1583 | -#ifdef WORDS_BIGENDIAN | |
| 1583 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 1584 | 1584 | surface->flags = QEMU_ALLOCATED_FLAG | QEMU_BIG_ENDIAN_FLAG; |
| 1585 | 1585 | #else |
| 1586 | 1586 | surface->flags = QEMU_ALLOCATED_FLAG; |
| ... | ... | @@ -1598,7 +1598,7 @@ DisplaySurface* qemu_create_displaysurface_from(int width, int height, int bpp, |
| 1598 | 1598 | surface->height = height; |
| 1599 | 1599 | surface->linesize = linesize; |
| 1600 | 1600 | surface->pf = qemu_default_pixelformat(bpp); |
| 1601 | -#ifdef WORDS_BIGENDIAN | |
| 1601 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 1602 | 1602 | surface->flags = QEMU_BIG_ENDIAN_FLAG; |
| 1603 | 1603 | #endif |
| 1604 | 1604 | surface->data = data; | ... | ... |
cpu-all.h
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 | * WORDS_ALIGNED : if defined, the host cpu can only make word aligned |
| 28 | 28 | * memory accesses. |
| 29 | 29 | * |
| 30 | - * WORDS_BIGENDIAN : if defined, the host cpu is big endian and | |
| 30 | + * HOST_WORDS_BIGENDIAN : if defined, the host cpu is big endian and | |
| 31 | 31 | * otherwise little endian. |
| 32 | 32 | * |
| 33 | 33 | * (TARGET_WORDS_ALIGNED : same for target cpu (not supported yet)) |
| ... | ... | @@ -37,7 +37,7 @@ |
| 37 | 37 | |
| 38 | 38 | #include "softfloat.h" |
| 39 | 39 | |
| 40 | -#if defined(WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN) | |
| 40 | +#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN) | |
| 41 | 41 | #define BSWAP_NEEDED |
| 42 | 42 | #endif |
| 43 | 43 | |
| ... | ... | @@ -123,7 +123,7 @@ typedef union { |
| 123 | 123 | endian ! */ |
| 124 | 124 | typedef union { |
| 125 | 125 | float64 d; |
| 126 | -#if defined(WORDS_BIGENDIAN) \ | |
| 126 | +#if defined(HOST_WORDS_BIGENDIAN) \ | |
| 127 | 127 | || (defined(__arm__) && !defined(__VFP_FP__) && !defined(CONFIG_SOFTFLOAT)) |
| 128 | 128 | struct { |
| 129 | 129 | uint32_t upper; |
| ... | ... | @@ -141,7 +141,7 @@ typedef union { |
| 141 | 141 | #ifdef TARGET_SPARC |
| 142 | 142 | typedef union { |
| 143 | 143 | float128 q; |
| 144 | -#if defined(WORDS_BIGENDIAN) \ | |
| 144 | +#if defined(HOST_WORDS_BIGENDIAN) \ | |
| 145 | 145 | || (defined(__arm__) && !defined(__VFP_FP__) && !defined(CONFIG_SOFTFLOAT)) |
| 146 | 146 | struct { |
| 147 | 147 | uint32_t upmost; |
| ... | ... | @@ -221,7 +221,7 @@ static inline void stb_p(void *ptr, int v) |
| 221 | 221 | /* NOTE: on arm, putting 2 in /proc/sys/debug/alignment so that the |
| 222 | 222 | kernel handles unaligned load/stores may give better results, but |
| 223 | 223 | it is a system wide setting : bad */ |
| 224 | -#if defined(WORDS_BIGENDIAN) || defined(WORDS_ALIGNED) | |
| 224 | +#if defined(HOST_WORDS_BIGENDIAN) || defined(WORDS_ALIGNED) | |
| 225 | 225 | |
| 226 | 226 | /* conservative code for little endian unaligned accesses */ |
| 227 | 227 | static inline int lduw_le_p(const void *ptr) |
| ... | ... | @@ -398,7 +398,7 @@ static inline void stfq_le_p(void *ptr, float64 v) |
| 398 | 398 | } |
| 399 | 399 | #endif |
| 400 | 400 | |
| 401 | -#if !defined(WORDS_BIGENDIAN) || defined(WORDS_ALIGNED) | |
| 401 | +#if !defined(HOST_WORDS_BIGENDIAN) || defined(WORDS_ALIGNED) | |
| 402 | 402 | |
| 403 | 403 | static inline int lduw_be_p(const void *ptr) |
| 404 | 404 | { | ... | ... |
cpu-defs.h
disas.c
| ... | ... | @@ -246,7 +246,7 @@ void disas(FILE *out, void *code, unsigned long size) |
| 246 | 246 | disasm_info.buffer_vma = (unsigned long)code; |
| 247 | 247 | disasm_info.buffer_length = size; |
| 248 | 248 | |
| 249 | -#ifdef WORDS_BIGENDIAN | |
| 249 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 250 | 250 | disasm_info.endian = BFD_ENDIAN_BIG; |
| 251 | 251 | #else |
| 252 | 252 | disasm_info.endian = BFD_ENDIAN_LITTLE; | ... | ... |
fpu/softfloat.h
hw/blizzard_template.h
hw/bt-hci.c
| ... | ... | @@ -419,7 +419,7 @@ static void bt_submit_raw_acl(struct bt_piconet_s *net, int length, uint8_t *dat |
| 419 | 419 | * be continuously allocated. We do it though, to preserve similar |
| 420 | 420 | * behaviour between hosts. Some things, like the BD_ADDR cannot be |
| 421 | 421 | * preserved though (for example if a real hci is used). */ |
| 422 | -#ifdef WORDS_BIGENDIAN | |
| 422 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 423 | 423 | # define HNDL(raw) bswap16(raw) |
| 424 | 424 | #else |
| 425 | 425 | # define HNDL(raw) (raw) | ... | ... |
hw/gus.c
hw/omap_lcd_template.h
| ... | ... | @@ -152,7 +152,7 @@ static void glue(draw_line12_, DEPTH)(void *opaque, |
| 152 | 152 | static void glue(draw_line16_, DEPTH)(void *opaque, |
| 153 | 153 | uint8_t *d, const uint8_t *s, int width, int deststep) |
| 154 | 154 | { |
| 155 | -#if DEPTH == 16 && defined(WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN) | |
| 155 | +#if DEPTH == 16 && defined(HOST_WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN) | |
| 156 | 156 | memcpy(d, s, width * 2); |
| 157 | 157 | #else |
| 158 | 158 | uint16_t v; | ... | ... |
hw/pl110_template.h
| ... | ... | @@ -95,18 +95,18 @@ static drawfn glue(pl110_draw_fn_,BITS)[36] = |
| 95 | 95 | |
| 96 | 96 | #if ORDER == 0 |
| 97 | 97 | #define NAME glue(glue(lblp_, BORDER), BITS) |
| 98 | -#ifdef WORDS_BIGENDIAN | |
| 98 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 99 | 99 | #define SWAP_WORDS 1 |
| 100 | 100 | #endif |
| 101 | 101 | #elif ORDER == 1 |
| 102 | 102 | #define NAME glue(glue(bbbp_, BORDER), BITS) |
| 103 | -#ifndef WORDS_BIGENDIAN | |
| 103 | +#ifndef HOST_WORDS_BIGENDIAN | |
| 104 | 104 | #define SWAP_WORDS 1 |
| 105 | 105 | #endif |
| 106 | 106 | #else |
| 107 | 107 | #define SWAP_PIXELS 1 |
| 108 | 108 | #define NAME glue(glue(lbbp_, BORDER), BITS) |
| 109 | -#ifdef WORDS_BIGENDIAN | |
| 109 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 110 | 110 | #define SWAP_WORDS 1 |
| 111 | 111 | #endif |
| 112 | 112 | #endif | ... | ... |
hw/pxa2xx_template.h
hw/vga.c
| ... | ... | @@ -74,19 +74,19 @@ const uint8_t gr_mask[16] = { |
| 74 | 74 | (((uint32_t)(__x) & (uint32_t)0x00ff0000UL) >> 8) | \ |
| 75 | 75 | (((uint32_t)(__x) & (uint32_t)0xff000000UL) >> 24) )) |
| 76 | 76 | |
| 77 | -#ifdef WORDS_BIGENDIAN | |
| 77 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 78 | 78 | #define PAT(x) cbswap_32(x) |
| 79 | 79 | #else |
| 80 | 80 | #define PAT(x) (x) |
| 81 | 81 | #endif |
| 82 | 82 | |
| 83 | -#ifdef WORDS_BIGENDIAN | |
| 83 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 84 | 84 | #define BIG 1 |
| 85 | 85 | #else |
| 86 | 86 | #define BIG 0 |
| 87 | 87 | #endif |
| 88 | 88 | |
| 89 | -#ifdef WORDS_BIGENDIAN | |
| 89 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 90 | 90 | #define GET_PLANE(data, p) (((data) >> (24 - (p) * 8)) & 0xff) |
| 91 | 91 | #else |
| 92 | 92 | #define GET_PLANE(data, p) (((data) >> ((p) * 8)) & 0xff) |
| ... | ... | @@ -113,7 +113,7 @@ static const uint32_t mask16[16] = { |
| 113 | 113 | |
| 114 | 114 | #undef PAT |
| 115 | 115 | |
| 116 | -#ifdef WORDS_BIGENDIAN | |
| 116 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 117 | 117 | #define PAT(x) (x) |
| 118 | 118 | #else |
| 119 | 119 | #define PAT(x) cbswap_32(x) |
| ... | ... | @@ -1369,7 +1369,7 @@ static void vga_draw_text(VGAState *s, int full_update) |
| 1369 | 1369 | if (cx > cx_max) |
| 1370 | 1370 | cx_max = cx; |
| 1371 | 1371 | *ch_attr_ptr = ch_attr; |
| 1372 | -#ifdef WORDS_BIGENDIAN | |
| 1372 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 1373 | 1373 | ch = ch_attr >> 8; |
| 1374 | 1374 | cattr = ch_attr & 0xff; |
| 1375 | 1375 | #else |
| ... | ... | @@ -1632,7 +1632,7 @@ static void vga_draw_graphic(VGAState *s, int full_update) |
| 1632 | 1632 | disp_width != s->last_width || |
| 1633 | 1633 | height != s->last_height || |
| 1634 | 1634 | s->last_depth != depth) { |
| 1635 | -#if defined(WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN) | |
| 1635 | +#if defined(HOST_WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN) | |
| 1636 | 1636 | if (depth == 16 || depth == 32) { |
| 1637 | 1637 | #else |
| 1638 | 1638 | if (depth == 32) { |
| ... | ... | @@ -1641,7 +1641,7 @@ static void vga_draw_graphic(VGAState *s, int full_update) |
| 1641 | 1641 | s->ds->surface = qemu_create_displaysurface_from(disp_width, height, depth, |
| 1642 | 1642 | s->line_offset, |
| 1643 | 1643 | s->vram_ptr + (s->start_addr * 4)); |
| 1644 | -#if defined(WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN) | |
| 1644 | +#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN) | |
| 1645 | 1645 | s->ds->surface->pf = qemu_different_endianness_pixelformat(depth); |
| 1646 | 1646 | #endif |
| 1647 | 1647 | dpy_resize(s->ds); | ... | ... |
hw/vga_template.h
| ... | ... | @@ -417,7 +417,7 @@ void glue(vga_draw_cursor_line_, DEPTH)(uint8_t *d1, |
| 417 | 417 | static void glue(vga_draw_line15_, PIXEL_NAME)(VGAState *s1, uint8_t *d, |
| 418 | 418 | const uint8_t *s, int width) |
| 419 | 419 | { |
| 420 | -#if DEPTH == 15 && defined(WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN) | |
| 420 | +#if DEPTH == 15 && defined(HOST_WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN) | |
| 421 | 421 | memcpy(d, s, width * 2); |
| 422 | 422 | #else |
| 423 | 423 | int w; |
| ... | ... | @@ -442,7 +442,7 @@ static void glue(vga_draw_line15_, PIXEL_NAME)(VGAState *s1, uint8_t *d, |
| 442 | 442 | static void glue(vga_draw_line16_, PIXEL_NAME)(VGAState *s1, uint8_t *d, |
| 443 | 443 | const uint8_t *s, int width) |
| 444 | 444 | { |
| 445 | -#if DEPTH == 16 && defined(WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN) | |
| 445 | +#if DEPTH == 16 && defined(HOST_WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN) | |
| 446 | 446 | memcpy(d, s, width * 2); |
| 447 | 447 | #else |
| 448 | 448 | int w; |
| ... | ... | @@ -493,7 +493,7 @@ static void glue(vga_draw_line24_, PIXEL_NAME)(VGAState *s1, uint8_t *d, |
| 493 | 493 | static void glue(vga_draw_line32_, PIXEL_NAME)(VGAState *s1, uint8_t *d, |
| 494 | 494 | const uint8_t *s, int width) |
| 495 | 495 | { |
| 496 | -#if DEPTH == 32 && defined(WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN) && !defined(BGR_FORMAT) | |
| 496 | +#if DEPTH == 32 && defined(HOST_WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN) && !defined(BGR_FORMAT) | |
| 497 | 497 | memcpy(d, s, width * 4); |
| 498 | 498 | #else |
| 499 | 499 | int w; | ... | ... |
linux-user/arm/nwfpe/double_cpdo.c
| ... | ... | @@ -150,7 +150,7 @@ unsigned int DoubleCPDO(const unsigned int opcode) |
| 150 | 150 | case MNF_CODE: |
| 151 | 151 | { |
| 152 | 152 | unsigned int *p = (unsigned int*)&rFm; |
| 153 | -#ifdef WORDS_BIGENDIAN | |
| 153 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 154 | 154 | p[0] ^= 0x80000000; |
| 155 | 155 | #else |
| 156 | 156 | p[1] ^= 0x80000000; |
| ... | ... | @@ -162,7 +162,7 @@ unsigned int DoubleCPDO(const unsigned int opcode) |
| 162 | 162 | case ABS_CODE: |
| 163 | 163 | { |
| 164 | 164 | unsigned int *p = (unsigned int*)&rFm; |
| 165 | -#ifdef WORDS_BIGENDIAN | |
| 165 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 166 | 166 | p[0] &= 0x7fffffff; |
| 167 | 167 | #else |
| 168 | 168 | p[1] &= 0x7fffffff; | ... | ... |
linux-user/arm/nwfpe/fpa11_cpdt.c
| ... | ... | @@ -44,7 +44,7 @@ void loadDouble(const unsigned int Fn, target_ulong addr) |
| 44 | 44 | unsigned int *p; |
| 45 | 45 | p = (unsigned int*)&fpa11->fpreg[Fn].fDouble; |
| 46 | 46 | fpa11->fType[Fn] = typeDouble; |
| 47 | -#ifdef WORDS_BIGENDIAN | |
| 47 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 48 | 48 | /* FIXME - handle failure of get_user() */ |
| 49 | 49 | get_user_u32(p[0], addr); /* sign & exponent */ |
| 50 | 50 | get_user_u32(p[1], addr + 4); |
| ... | ... | @@ -147,7 +147,7 @@ void storeDouble(const unsigned int Fn, target_ulong addr) |
| 147 | 147 | default: val = fpa11->fpreg[Fn].fDouble; |
| 148 | 148 | } |
| 149 | 149 | /* FIXME - handle put_user() failures */ |
| 150 | -#ifdef WORDS_BIGENDIAN | |
| 150 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 151 | 151 | put_user_u32(p[0], addr); /* msw */ |
| 152 | 152 | put_user_u32(p[1], addr + 4); /* lsw */ |
| 153 | 153 | #else | ... | ... |
loader.c
| ... | ... | @@ -324,7 +324,7 @@ int load_elf(const char *filename, int64_t address_offset, |
| 324 | 324 | e_ident[2] != ELFMAG2 || |
| 325 | 325 | e_ident[3] != ELFMAG3) |
| 326 | 326 | goto fail; |
| 327 | -#ifdef WORDS_BIGENDIAN | |
| 327 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 328 | 328 | data_order = ELFDATA2MSB; |
| 329 | 329 | #else |
| 330 | 330 | data_order = ELFDATA2LSB; |
| ... | ... | @@ -358,7 +358,7 @@ int load_elf(const char *filename, int64_t address_offset, |
| 358 | 358 | |
| 359 | 359 | static void bswap_uboot_header(uboot_image_header_t *hdr) |
| 360 | 360 | { |
| 361 | -#ifndef WORDS_BIGENDIAN | |
| 361 | +#ifndef HOST_WORDS_BIGENDIAN | |
| 362 | 362 | bswap32s(&hdr->ih_magic); |
| 363 | 363 | bswap32s(&hdr->ih_hcrc); |
| 364 | 364 | bswap32s(&hdr->ih_time); | ... | ... |
sdl.c
| ... | ... | @@ -185,7 +185,7 @@ static DisplaySurface* sdl_create_displaysurface(int width, int height) |
| 185 | 185 | surface->linesize = width * host_format.BytesPerPixel; |
| 186 | 186 | surface->pf = sdl_to_qemu_pixelformat(&host_format); |
| 187 | 187 | } |
| 188 | -#ifdef WORDS_BIGENDIAN | |
| 188 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 189 | 189 | surface->flags = QEMU_ALLOCATED_FLAG | QEMU_BIG_ENDIAN_FLAG; |
| 190 | 190 | #else |
| 191 | 191 | surface->flags = QEMU_ALLOCATED_FLAG; |
| ... | ... | @@ -204,7 +204,7 @@ static DisplaySurface* sdl_create_displaysurface(int width, int height) |
| 204 | 204 | surface->linesize = real_screen->pitch; |
| 205 | 205 | surface->data = real_screen->pixels; |
| 206 | 206 | |
| 207 | -#ifdef WORDS_BIGENDIAN | |
| 207 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 208 | 208 | surface->flags = QEMU_REALPIXELS_FLAG | QEMU_BIG_ENDIAN_FLAG; |
| 209 | 209 | #else |
| 210 | 210 | surface->flags = QEMU_REALPIXELS_FLAG; | ... | ... |
slirp/ip.h
| ... | ... | @@ -33,7 +33,7 @@ |
| 33 | 33 | #ifndef _IP_H_ |
| 34 | 34 | #define _IP_H_ |
| 35 | 35 | |
| 36 | -#ifdef WORDS_BIGENDIAN | |
| 36 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 37 | 37 | # ifndef NTOHL |
| 38 | 38 | # define NTOHL(d) |
| 39 | 39 | # endif |
| ... | ... | @@ -73,7 +73,7 @@ typedef u_int32_t n_long; /* long as received from the net */ |
| 73 | 73 | * Structure of an internet header, naked of options. |
| 74 | 74 | */ |
| 75 | 75 | struct ip { |
| 76 | -#ifdef WORDS_BIGENDIAN | |
| 76 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 77 | 77 | u_int ip_v:4, /* version */ |
| 78 | 78 | ip_hl:4; /* header length */ |
| 79 | 79 | #else |
| ... | ... | @@ -139,7 +139,7 @@ struct ip_timestamp { |
| 139 | 139 | u_int8_t ipt_code; /* IPOPT_TS */ |
| 140 | 140 | u_int8_t ipt_len; /* size of structure (variable) */ |
| 141 | 141 | u_int8_t ipt_ptr; /* index of current entry */ |
| 142 | -#ifdef WORDS_BIGENDIAN | |
| 142 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 143 | 143 | u_int ipt_oflw:4, /* overflow counter */ |
| 144 | 144 | ipt_flg:4; /* flags, see below */ |
| 145 | 145 | #else | ... | ... |
slirp/slirp_config.h
slirp/tcp.h
| ... | ... | @@ -50,7 +50,7 @@ struct tcphdr { |
| 50 | 50 | u_int16_t th_dport; /* destination port */ |
| 51 | 51 | tcp_seq th_seq; /* sequence number */ |
| 52 | 52 | tcp_seq th_ack; /* acknowledgement number */ |
| 53 | -#ifdef WORDS_BIGENDIAN | |
| 53 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 54 | 54 | u_int th_off:4, /* data offset */ |
| 55 | 55 | th_x2:4; /* (unused) */ |
| 56 | 56 | #else | ... | ... |
target-arm/neon_helper.c
target-i386/cpu.h
target-i386/exec.h
| ... | ... | @@ -155,7 +155,7 @@ typedef union { |
| 155 | 155 | /* NOTE: arm is horrible as double 32 bit words are stored in big endian ! */ |
| 156 | 156 | typedef union { |
| 157 | 157 | double d; |
| 158 | -#if !defined(WORDS_BIGENDIAN) && !defined(__arm__) | |
| 158 | +#if !defined(HOST_WORDS_BIGENDIAN) && !defined(__arm__) | |
| 159 | 159 | struct { |
| 160 | 160 | uint32_t lower; |
| 161 | 161 | int32_t upper; | ... | ... |
target-i386/translate.c
| ... | ... | @@ -255,7 +255,7 @@ static inline void gen_op_andl_A0_ffff(void) |
| 255 | 255 | |
| 256 | 256 | #endif /* !TARGET_X86_64 */ |
| 257 | 257 | |
| 258 | -#if defined(WORDS_BIGENDIAN) | |
| 258 | +#if defined(HOST_WORDS_BIGENDIAN) | |
| 259 | 259 | #define REG_B_OFFSET (sizeof(target_ulong) - 1) |
| 260 | 260 | #define REG_H_OFFSET (sizeof(target_ulong) - 2) |
| 261 | 261 | #define REG_W_OFFSET (sizeof(target_ulong) - 2) |
| ... | ... | @@ -7151,7 +7151,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start) |
| 7151 | 7151 | break; |
| 7152 | 7152 | case 4: /* smsw */ |
| 7153 | 7153 | gen_svm_check_intercept(s, pc_start, SVM_EXIT_READ_CR0); |
| 7154 | -#if defined TARGET_X86_64 && defined WORDS_BIGENDIAN | |
| 7154 | +#if defined TARGET_X86_64 && defined HOST_WORDS_BIGENDIAN | |
| 7155 | 7155 | tcg_gen_ld32u_tl(cpu_T[0], cpu_env, offsetof(CPUX86State,cr[0]) + 4); |
| 7156 | 7156 | #else |
| 7157 | 7157 | tcg_gen_ld32u_tl(cpu_T[0], cpu_env, offsetof(CPUX86State,cr[0])); | ... | ... |
target-mips/cpu.h
| ... | ... | @@ -62,7 +62,7 @@ union fpr_t { |
| 62 | 62 | /* define FP_ENDIAN_IDX to access the same location |
| 63 | 63 | * in the fpr_t union regardless of the host endianess |
| 64 | 64 | */ |
| 65 | -#if defined(WORDS_BIGENDIAN) | |
| 65 | +#if defined(HOST_WORDS_BIGENDIAN) | |
| 66 | 66 | # define FP_ENDIAN_IDX 1 |
| 67 | 67 | #else |
| 68 | 68 | # define FP_ENDIAN_IDX 0 | ... | ... |
target-ppc/op_helper.c
| ... | ... | @@ -1921,7 +1921,7 @@ target_ulong helper_dlmzb (target_ulong high, target_ulong low, uint32_t update_ |
| 1921 | 1921 | |
| 1922 | 1922 | /*****************************************************************************/ |
| 1923 | 1923 | /* Altivec extension helpers */ |
| 1924 | -#if defined(WORDS_BIGENDIAN) | |
| 1924 | +#if defined(HOST_WORDS_BIGENDIAN) | |
| 1925 | 1925 | #define HI_IDX 0 |
| 1926 | 1926 | #define LO_IDX 1 |
| 1927 | 1927 | #else |
| ... | ... | @@ -1929,7 +1929,7 @@ target_ulong helper_dlmzb (target_ulong high, target_ulong low, uint32_t update_ |
| 1929 | 1929 | #define LO_IDX 0 |
| 1930 | 1930 | #endif |
| 1931 | 1931 | |
| 1932 | -#if defined(WORDS_BIGENDIAN) | |
| 1932 | +#if defined(HOST_WORDS_BIGENDIAN) | |
| 1933 | 1933 | #define VECTOR_FOR_INORDER_I(index, element) \ |
| 1934 | 1934 | for (index = 0; index < ARRAY_SIZE(r->element); index++) |
| 1935 | 1935 | #else |
| ... | ... | @@ -2055,7 +2055,7 @@ STVE(stvewx, stl, bswap32, u32) |
| 2055 | 2055 | |
| 2056 | 2056 | void helper_mtvscr (ppc_avr_t *r) |
| 2057 | 2057 | { |
| 2058 | -#if defined(WORDS_BIGENDIAN) | |
| 2058 | +#if defined(HOST_WORDS_BIGENDIAN) | |
| 2059 | 2059 | env->vscr = r->u32[3]; |
| 2060 | 2060 | #else |
| 2061 | 2061 | 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) |
| 2422 | 2422 | } \ |
| 2423 | 2423 | *r = result; \ |
| 2424 | 2424 | } |
| 2425 | -#if defined(WORDS_BIGENDIAN) | |
| 2425 | +#if defined(HOST_WORDS_BIGENDIAN) | |
| 2426 | 2426 | #define MRGHI 0 |
| 2427 | 2427 | #define MRGLO 1 |
| 2428 | 2428 | #else |
| ... | ... | @@ -2583,7 +2583,7 @@ void helper_vperm (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c) |
| 2583 | 2583 | int i; |
| 2584 | 2584 | VECTOR_FOR_INORDER_I (i, u8) { |
| 2585 | 2585 | int s = c->u8[i] & 0x1f; |
| 2586 | -#if defined(WORDS_BIGENDIAN) | |
| 2586 | +#if defined(HOST_WORDS_BIGENDIAN) | |
| 2587 | 2587 | int index = s & 0xf; |
| 2588 | 2588 | #else |
| 2589 | 2589 | 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) |
| 2597 | 2597 | *r = result; |
| 2598 | 2598 | } |
| 2599 | 2599 | |
| 2600 | -#if defined(WORDS_BIGENDIAN) | |
| 2600 | +#if defined(HOST_WORDS_BIGENDIAN) | |
| 2601 | 2601 | #define PKBIG 1 |
| 2602 | 2602 | #else |
| 2603 | 2603 | #define PKBIG 0 |
| ... | ... | @@ -2606,7 +2606,7 @@ void helper_vpkpx (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) |
| 2606 | 2606 | { |
| 2607 | 2607 | int i, j; |
| 2608 | 2608 | ppc_avr_t result; |
| 2609 | -#if defined(WORDS_BIGENDIAN) | |
| 2609 | +#if defined(HOST_WORDS_BIGENDIAN) | |
| 2610 | 2610 | const ppc_avr_t *x[2] = { a, b }; |
| 2611 | 2611 | #else |
| 2612 | 2612 | const ppc_avr_t *x[2] = { b, a }; |
| ... | ... | @@ -2723,7 +2723,7 @@ void helper_vlogefp (ppc_avr_t *r, ppc_avr_t *b) |
| 2723 | 2723 | } |
| 2724 | 2724 | } |
| 2725 | 2725 | |
| 2726 | -#if defined(WORDS_BIGENDIAN) | |
| 2726 | +#if defined(HOST_WORDS_BIGENDIAN) | |
| 2727 | 2727 | #define LEFT 0 |
| 2728 | 2728 | #define RIGHT 1 |
| 2729 | 2729 | #else |
| ... | ... | @@ -2783,7 +2783,7 @@ void helper_vsldoi (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, uint32_t shift) |
| 2783 | 2783 | int i; |
| 2784 | 2784 | ppc_avr_t result; |
| 2785 | 2785 | |
| 2786 | -#if defined(WORDS_BIGENDIAN) | |
| 2786 | +#if defined(HOST_WORDS_BIGENDIAN) | |
| 2787 | 2787 | for (i = 0; i < ARRAY_SIZE(r->u8); i++) { |
| 2788 | 2788 | int index = sh + i; |
| 2789 | 2789 | if (index > 0xf) { |
| ... | ... | @@ -2809,7 +2809,7 @@ void helper_vslo (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) |
| 2809 | 2809 | { |
| 2810 | 2810 | int sh = (b->u8[LO_IDX*0xf] >> 3) & 0xf; |
| 2811 | 2811 | |
| 2812 | -#if defined (WORDS_BIGENDIAN) | |
| 2812 | +#if defined (HOST_WORDS_BIGENDIAN) | |
| 2813 | 2813 | memmove (&r->u8[0], &a->u8[sh], 16-sh); |
| 2814 | 2814 | memset (&r->u8[16-sh], 0, sh); |
| 2815 | 2815 | #else |
| ... | ... | @@ -2820,7 +2820,7 @@ void helper_vslo (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) |
| 2820 | 2820 | |
| 2821 | 2821 | /* Experimental testing shows that hardware masks the immediate. */ |
| 2822 | 2822 | #define _SPLAT_MASKED(element) (splat & (ARRAY_SIZE(r->element) - 1)) |
| 2823 | -#if defined(WORDS_BIGENDIAN) | |
| 2823 | +#if defined(HOST_WORDS_BIGENDIAN) | |
| 2824 | 2824 | #define SPLAT_ELEMENT(element) _SPLAT_MASKED(element) |
| 2825 | 2825 | #else |
| 2826 | 2826 | #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) |
| 2877 | 2877 | { |
| 2878 | 2878 | int sh = (b->u8[LO_IDX*0xf] >> 3) & 0xf; |
| 2879 | 2879 | |
| 2880 | -#if defined (WORDS_BIGENDIAN) | |
| 2880 | +#if defined (HOST_WORDS_BIGENDIAN) | |
| 2881 | 2881 | memmove (&r->u8[sh], &a->u8[0], 16-sh); |
| 2882 | 2882 | memset (&r->u8[0], 0, sh); |
| 2883 | 2883 | #else |
| ... | ... | @@ -2901,7 +2901,7 @@ void helper_vsumsws (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) |
| 2901 | 2901 | ppc_avr_t result; |
| 2902 | 2902 | int sat = 0; |
| 2903 | 2903 | |
| 2904 | -#if defined(WORDS_BIGENDIAN) | |
| 2904 | +#if defined(HOST_WORDS_BIGENDIAN) | |
| 2905 | 2905 | upper = ARRAY_SIZE(r->s32)-1; |
| 2906 | 2906 | #else |
| 2907 | 2907 | upper = 0; |
| ... | ... | @@ -2925,7 +2925,7 @@ void helper_vsum2sws (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) |
| 2925 | 2925 | ppc_avr_t result; |
| 2926 | 2926 | int sat = 0; |
| 2927 | 2927 | |
| 2928 | -#if defined(WORDS_BIGENDIAN) | |
| 2928 | +#if defined(HOST_WORDS_BIGENDIAN) | |
| 2929 | 2929 | upper = 1; |
| 2930 | 2930 | #else |
| 2931 | 2931 | upper = 0; |
| ... | ... | @@ -2997,7 +2997,7 @@ void helper_vsum4ubs (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) |
| 2997 | 2997 | } |
| 2998 | 2998 | } |
| 2999 | 2999 | |
| 3000 | -#if defined(WORDS_BIGENDIAN) | |
| 3000 | +#if defined(HOST_WORDS_BIGENDIAN) | |
| 3001 | 3001 | #define UPKHI 1 |
| 3002 | 3002 | #define UPKLO 0 |
| 3003 | 3003 | #else | ... | ... |
target-ppc/translate.c
| ... | ... | @@ -120,7 +120,7 @@ void ppc_translate_init(void) |
| 120 | 120 | cpu_reg_names_size -= (i < 10) ? 4 : 5; |
| 121 | 121 | |
| 122 | 122 | snprintf(p, cpu_reg_names_size, "avr%dH", i); |
| 123 | -#ifdef WORDS_BIGENDIAN | |
| 123 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 124 | 124 | cpu_avrh[i] = tcg_global_mem_new_i64(TCG_AREG0, |
| 125 | 125 | offsetof(CPUState, avr[i].u64[0]), p); |
| 126 | 126 | #else |
| ... | ... | @@ -131,7 +131,7 @@ void ppc_translate_init(void) |
| 131 | 131 | cpu_reg_names_size -= (i < 10) ? 6 : 7; |
| 132 | 132 | |
| 133 | 133 | snprintf(p, cpu_reg_names_size, "avr%dL", i); |
| 134 | -#ifdef WORDS_BIGENDIAN | |
| 134 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 135 | 135 | cpu_avrl[i] = tcg_global_mem_new_i64(TCG_AREG0, |
| 136 | 136 | offsetof(CPUState, avr[i].u64[1]), p); |
| 137 | 137 | #else | ... | ... |
target-ppc/translate_init.c
| ... | ... | @@ -9388,7 +9388,7 @@ static int gdb_set_float_reg(CPUState *env, uint8_t *mem_buf, int n) |
| 9388 | 9388 | static int gdb_get_avr_reg(CPUState *env, uint8_t *mem_buf, int n) |
| 9389 | 9389 | { |
| 9390 | 9390 | if (n < 32) { |
| 9391 | -#ifdef WORDS_BIGENDIAN | |
| 9391 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 9392 | 9392 | stq_p(mem_buf, env->avr[n].u64[0]); |
| 9393 | 9393 | stq_p(mem_buf+8, env->avr[n].u64[1]); |
| 9394 | 9394 | #else |
| ... | ... | @@ -9411,7 +9411,7 @@ static int gdb_get_avr_reg(CPUState *env, uint8_t *mem_buf, int n) |
| 9411 | 9411 | static int gdb_set_avr_reg(CPUState *env, uint8_t *mem_buf, int n) |
| 9412 | 9412 | { |
| 9413 | 9413 | if (n < 32) { |
| 9414 | -#ifdef WORDS_BIGENDIAN | |
| 9414 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 9415 | 9415 | env->avr[n].u64[0] = ldq_p(mem_buf); |
| 9416 | 9416 | env->avr[n].u64[1] = ldq_p(mem_buf+8); |
| 9417 | 9417 | #else | ... | ... |
target-sparc/op_helper.c
tcg/arm/tcg-target.c
| ... | ... | @@ -282,7 +282,7 @@ static inline void tcg_out_b(TCGContext *s, int cond, int32_t offset) |
| 282 | 282 | |
| 283 | 283 | static inline void tcg_out_b_noaddr(TCGContext *s, int cond) |
| 284 | 284 | { |
| 285 | -#ifdef WORDS_BIGENDIAN | |
| 285 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 286 | 286 | tcg_out8(s, (cond << 4) | 0x0a); |
| 287 | 287 | s->code_ptr += 3; |
| 288 | 288 | #else | ... | ... |
vl.c
vnc.c
| ... | ... | @@ -1656,7 +1656,7 @@ static void pixel_format_message (VncState *vs) { |
| 1656 | 1656 | vnc_write_u8(vs, vs->ds->surface->pf.bits_per_pixel); /* bits-per-pixel */ |
| 1657 | 1657 | vnc_write_u8(vs, vs->ds->surface->pf.depth); /* depth */ |
| 1658 | 1658 | |
| 1659 | -#ifdef WORDS_BIGENDIAN | |
| 1659 | +#ifdef HOST_WORDS_BIGENDIAN | |
| 1660 | 1660 | vnc_write_u8(vs, 1); /* big-endian-flag */ |
| 1661 | 1661 | #else |
| 1662 | 1662 | vnc_write_u8(vs, 0); /* big-endian-flag */ | ... | ... |