Statistics
| Branch: | Revision:

root / include / qemu / bswap.h @ 052e87b0

History | View | Annotate | Download (8.9 kB)

# Date Author Comment
ea44910e 04/19/2013 12:28 pm Alexey Kardashevskiy

bswap: fix compiler warning

The bswap functions use memcpy but the bswap.h header itself does not seem to
include it in some configuration such as cross compiling for powerpc64
on x86_64 machine.

The patch explicitly includes string.h.

Signed-off-by: Alexey Kardashevskiy <>...

91107fdf 02/06/2013 04:29 pm Richard Henderson

bswap: Fix width of swap in leul_to_cpu

The misnamed HOST_LONG_BITS is really HOST_POINTER_BITS. Here we're
explicitly using an unsigned long, rather than uintptr_t, so it is
more correct to select the swap size via ULONG_MAX.

Acked-by: Andreas Färber <>...

a4cbfe24 01/17/2013 03:31 am Blue Swirl

bswap: improve gluing

OpenBSD system compiler (gcc 4.2.1) has problems with concatenation
of macro arguments in macro functions:
CC aes.o
In file included from /src/qemu/include/qemu-common.h:126,
from /src/qemu/aes.c:30:
/src/qemu/include/qemu/bswap.h: In function 'leul_to_cpu':...

c732a52d 01/12/2013 02:24 pm Richard Henderson

bswap: Rewrite cpu_to_<endian><type>u with {ld,st}<type>_<endian>_p

We've now optimized the ld/st versions; reuse that for the "legacy"
versions. Always use inlines so that we get the type checking that
we expect.

Signed-off-by: Richard Henderson <>...

612d590e 01/12/2013 02:24 pm Richard Henderson

bswap: Rewrite all ld<type>_<endian>_p functions

Use the new host endian unaligned access functions instead of
open coding byte-by-byte references. Remove assembly special
cases for i386 and ppc -- we've now exposed the operation to
the compiler sufficiently for these to be optimized automatically....

7db2145a 01/12/2013 02:24 pm Richard Henderson

bswap: Add host endian unaligned access functions

Signed-off-by: Richard Henderson <>
Signed-off-by: Blue Swirl <>

cdfe2851 01/12/2013 02:23 pm Richard Henderson

bswap: Tidy base definitions of bswapN

Move the bswap_N -> bswapN wrappers inside CONFIG_BYTESWAP_H.

Change the ultimate fallback defintions from macros to inline functions.
The proper types recieved by the function arguments means we can remove
unnecessary casts, making the code more readable....

6b4c305c 12/19/2012 09:32 am Paolo Bonzini

fpu: move public header file to include/fpu

Signed-off-by: Paolo Bonzini <>

1de7afc9 12/19/2012 09:32 am Paolo Bonzini

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>