qemu fixes
PATCH 4/6 qemu fixes
Hi,
This is a series of four patches which improve support for qemu on NetBSD.
Attached patch makes NetBSD use the native bswap functions which compile.
Signed-off-by Christoph Egger <[email protected]>
Signature · 12 lines
AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Geschäftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplementär: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Geschäftsführer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy
bswap.h +8 -0
@@ -5,6 +5,12 @@#include <inttypes.h> +#ifdef HAVE_MACHINE_BSWAP_H +#include <sys/endian.h> +#include <sys/types.h> +#include <machine/bswap.h> +#else +#ifdef HAVE_BYTESWAP_H #include <byteswap.h> #else
@@ -58,6 +64,8 @@ return bswap_64(x); } +#endif /* ! HAVE_MACHINE_BSWAP_H */ +static inline void bswap16s (uint16_t *s) { *s =bswap16 (*s);
configure +9 -0
@@ -1227,6 +1238,15 @@ if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then echo "#define HAVE_BYTESWAP_H 1" >> $config_h fi + cat > $TMPC << EOF +#include <sys/endian.h> +#include <sys/types.h> +#include <machine/bswap.h> +int main(void) { return bswap32(0); } +EOF + if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then + echo "#define HAVE_MACHINE_BSWAP_H 1" >> $config_h + fi fi if [ "$openbsd" = "yes" ] ; then
Quoted 7 lines · Christoph Egger
Hi,
This is a series of four patches which improve support for qemu on NetBSD.
Quoted 5 lines
Attached patch makes NetBSD use the native bswap functions
which compile.Signed-off-by Christoph Egger <[email protected]>
This looks fine too, any objections?
Blue Swirl
AppliedQuoted 7 lines · Christoph Egger
Hi,
This is a series of four patches which improve support for qemu on NetBSD.
Quoted 5 lines
Attached patch makes NetBSD use the native bswap functions
which compile.Signed-off-by Christoph Egger <[email protected]>
Thanks, applied.