Revision e2542fe2
b/Makefile.target | ||
---|---|---|
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 | 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 | 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 | 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 |
b/audio/audio.h | ||
---|---|---|
38 | 38 |
AUD_FMT_S32 |
39 | 39 |
} audfmt_e; |
40 | 40 |
|
41 |
#ifdef WORDS_BIGENDIAN |
|
41 |
#ifdef HOST_WORDS_BIGENDIAN
|
|
42 | 42 |
#define AUDIO_HOST_ENDIANNESS 1 |
43 | 43 |
#else |
44 | 44 |
#define AUDIO_HOST_ENDIANNESS 0 |
b/bswap.h | ||
---|---|---|
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 | 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 |
b/configure | ||
---|---|---|
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 |
b/console.c | ||
---|---|---|
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 | 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 | 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 | 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; |
b/cpu-all.h | ||
---|---|---|
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 | 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 | 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 | 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 | 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 | 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 |
{ |
b/cpu-defs.h | ||
---|---|---|
106 | 106 |
sizeof(target_phys_addr_t))]; |
107 | 107 |
} CPUTLBEntry; |
108 | 108 |
|
109 |
#ifdef WORDS_BIGENDIAN |
|
109 |
#ifdef HOST_WORDS_BIGENDIAN
|
|
110 | 110 |
typedef struct icount_decr_u16 { |
111 | 111 |
uint16_t high; |
112 | 112 |
uint16_t low; |
b/disas.c | ||
---|---|---|
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; |
b/fpu/softfloat.h | ||
---|---|---|
146 | 146 |
#endif |
147 | 147 |
#ifdef FLOAT128 |
148 | 148 |
typedef struct { |
149 |
#ifdef WORDS_BIGENDIAN |
|
149 |
#ifdef HOST_WORDS_BIGENDIAN
|
|
150 | 150 |
uint64_t high, low; |
151 | 151 |
#else |
152 | 152 |
uint64_t low, high; |
b/hw/blizzard_template.h | ||
---|---|---|
41 | 41 |
# error unknown bit depth |
42 | 42 |
#endif |
43 | 43 |
|
44 |
#ifdef WORDS_BIGENDIAN |
|
44 |
#ifdef HOST_WORDS_BIGENDIAN
|
|
45 | 45 |
# define SWAP_WORDS 1 |
46 | 46 |
#endif |
47 | 47 |
|
b/hw/bt-hci.c | ||
---|---|---|
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) |
b/hw/gus.c | ||
---|---|---|
35 | 35 |
#define ldebug(...) |
36 | 36 |
#endif |
37 | 37 |
|
38 |
#ifdef WORDS_BIGENDIAN |
|
38 |
#ifdef HOST_WORDS_BIGENDIAN
|
|
39 | 39 |
#define GUS_ENDIANNESS 1 |
40 | 40 |
#else |
41 | 41 |
#define GUS_ENDIANNESS 0 |
b/hw/omap_lcd_template.h | ||
---|---|---|
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; |
b/hw/pl110_template.h | ||
---|---|---|
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 |
b/hw/pxa2xx_template.h | ||
---|---|---|
23 | 23 |
# error unknown bit depth |
24 | 24 |
#endif |
25 | 25 |
|
26 |
#ifdef WORDS_BIGENDIAN |
|
26 |
#ifdef HOST_WORDS_BIGENDIAN
|
|
27 | 27 |
# define SWAP_WORDS 1 |
28 | 28 |
#endif |
29 | 29 |
|
b/hw/vga.c | ||
---|---|---|
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 | 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 | 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 | 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 | 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); |
b/hw/vga_template.h | ||
---|---|---|
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 | 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 | 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; |
b/linux-user/arm/nwfpe/double_cpdo.c | ||
---|---|---|
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 | 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; |
b/linux-user/arm/nwfpe/fpa11_cpdt.c | ||
---|---|---|
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 | 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 |
b/loader.c | ||
---|---|---|
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 | 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); |
b/sdl.c | ||
---|---|---|
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 | 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; |
b/slirp/ip.h | ||
---|---|---|
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 | 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 | 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 |
b/slirp/slirp_config.h | ||
---|---|---|
83 | 83 |
#undef HAVE_SYS_BITYPES_H |
84 | 84 |
|
85 | 85 |
/* Define if the machine is big endian */ |
86 |
//#undef WORDS_BIGENDIAN |
|
86 |
//#undef HOST_WORDS_BIGENDIAN
|
|
87 | 87 |
|
88 | 88 |
/* Define if your sprintf returns char * instead of int */ |
89 | 89 |
#undef BAD_SPRINTF |
b/slirp/tcp.h | ||
---|---|---|
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 |
b/target-arm/neon_helper.c | ||
---|---|---|
49 | 49 |
{ \ |
50 | 50 |
type v1; \ |
51 | 51 |
} neon_##name; |
52 |
#ifdef WORDS_BIGENDIAN |
|
52 |
#ifdef HOST_WORDS_BIGENDIAN
|
|
53 | 53 |
#define NEON_TYPE2(name, type) \ |
54 | 54 |
typedef struct \ |
55 | 55 |
{ \ |
b/target-i386/cpu.h | ||
---|---|---|
528 | 528 |
uint64_t q; |
529 | 529 |
} MMXReg; |
530 | 530 |
|
531 |
#ifdef WORDS_BIGENDIAN |
|
531 |
#ifdef HOST_WORDS_BIGENDIAN
|
|
532 | 532 |
#define XMM_B(n) _b[15 - (n)] |
533 | 533 |
#define XMM_W(n) _w[7 - (n)] |
534 | 534 |
#define XMM_L(n) _l[3 - (n)] |
b/target-i386/exec.h | ||
---|---|---|
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; |
b/target-i386/translate.c | ||
---|---|---|
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 | 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])); |
b/target-mips/cpu.h | ||
---|---|---|
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 |
b/target-ppc/op_helper.c | ||
---|---|---|
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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 |
b/target-ppc/translate.c | ||
---|---|---|
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 | 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 |
b/target-ppc/translate_init.c | ||
---|---|---|
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 | 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 |
b/target-sparc/op_helper.c | ||
---|---|---|
385 | 385 |
*((uint64_t *)&DT0) = tmp; |
386 | 386 |
} |
387 | 387 |
|
388 |
#ifdef WORDS_BIGENDIAN |
|
388 |
#ifdef HOST_WORDS_BIGENDIAN
|
|
389 | 389 |
#define VIS_B64(n) b[7 - (n)] |
390 | 390 |
#define VIS_W64(n) w[3 - (n)] |
391 | 391 |
#define VIS_SW64(n) sw[3 - (n)] |
b/tcg/arm/tcg-target.c | ||
---|---|---|
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 |
b/vl.c | ||
---|---|---|
506 | 506 |
union { |
507 | 507 |
uint64_t ll; |
508 | 508 |
struct { |
509 |
#ifdef WORDS_BIGENDIAN |
|
509 |
#ifdef HOST_WORDS_BIGENDIAN
|
|
510 | 510 |
uint32_t high, low; |
511 | 511 |
#else |
512 | 512 |
uint32_t low, high; |
b/vnc.c | ||
---|---|---|
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 */ |
Also available in: Unified diff