Skip to content

Commit

Permalink
rename WORDS_BIGENDIAN to HOST_WORDS_BIGENDIAN
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Quintela <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
  • Loading branch information
Juan Quintela authored and Anthony Liguori committed Jul 27, 2009
1 parent f0667e6 commit e2542fe
Show file tree
Hide file tree
Showing 36 changed files with 82 additions and 82 deletions.
8 changes: 4 additions & 4 deletions Makefile.target
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,15 @@ 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
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
Expand Down Expand Up @@ -377,15 +377,15 @@ 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
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
Expand Down
2 changes: 1 addition & 1 deletion audio/audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions bswap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions console.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions cpu-all.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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

Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion cpu-defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion disas.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion fpu/softfloat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion hw/blizzard_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
# error unknown bit depth
#endif

#ifdef WORDS_BIGENDIAN
#ifdef HOST_WORDS_BIGENDIAN
# define SWAP_WORDS 1
#endif

Expand Down
2 changes: 1 addition & 1 deletion hw/bt-hci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion hw/gus.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#define ldebug(...)
#endif

#ifdef WORDS_BIGENDIAN
#ifdef HOST_WORDS_BIGENDIAN
#define GUS_ENDIANNESS 1
#else
#define GUS_ENDIANNESS 0
Expand Down
2 changes: 1 addition & 1 deletion hw/omap_lcd_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions hw/pl110_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion hw/pxa2xx_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# error unknown bit depth
#endif

#ifdef WORDS_BIGENDIAN
#ifdef HOST_WORDS_BIGENDIAN
# define SWAP_WORDS 1
#endif

Expand Down
14 changes: 7 additions & 7 deletions hw/vga.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand All @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions hw/vga_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions linux-user/arm/nwfpe/double_cpdo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions linux-user/arm/nwfpe/fpa11_cpdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Loading

0 comments on commit e2542fe

Please sign in to comment.