Skip to contentSkip to conversation

qemu fixes

PATCH Applied Christoph Egger 2 participants 3 messages Nov 28, 2008 – Dec 5, 2008

lore
Share & tools
lore
#0 lore raw

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.

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
Index: bswap.h
===================================================================
@@ -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
Index: configure
===================================================================
@@ -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
#1 lore raw
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.

This looks fine too, any objections?