qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] PATCH: patch to qemu CVS-head for compiling under Solaris 1


From: Ben Taylor
Subject: [Qemu-devel] PATCH: patch to qemu CVS-head for compiling under Solaris 10
Date: Sun, 16 Apr 2006 14:18:22 -0400

This patch is to allow qemu to configure/compile/build under
Solaris 10.  It is the third revision in a couple of days,
due to a variety of reasons.  I hand verified the patch twice
and rebuilt the code fresh on two different systems and
was able to boot a WinXP image that was installed under 
qemu-0.7.0.

Please let me know there are any issues.

Thanks

Ben
diff -ruN qemu/Makefile qemu-solaris/Makefile
--- qemu/Makefile       2006-04-16 08:41:07.000000000 -0400
+++ qemu-solaris/Makefile       2006-04-16 13:20:18.000000000 -0400
@@ -4,6 +4,9 @@
 ifdef CONFIG_DARWIN
 CFLAGS+= -mdynamic-no-pic
 endif
+ifdef _PRESOLARIS10
+CFLAGS+= -D_PRESOLARIS10
+endif
 LDFLAGS=-g
 LIBS=
 DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
@@ -45,20 +48,20 @@
 
 install: all 
        mkdir -p "$(DESTDIR)$(bindir)"
-       install -m 755 -s $(TOOLS) "$(DESTDIR)$(bindir)"
+       $(INSTALL) -m 755 -s $(TOOLS) "$(DESTDIR)$(bindir)"
        mkdir -p "$(DESTDIR)$(datadir)"
        for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
                        video.x proll.elf linux_boot.bin; do \
-               install -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
+               $(INSTALL) -m 644 $(SRC_PATH)/pc-bios/$$x 
"$(DESTDIR)$(datadir)"; \
        done
        mkdir -p "$(DESTDIR)$(docdir)"
-       install -m 644 qemu-doc.html  qemu-tech.html "$(DESTDIR)$(docdir)"
+       $(INSTALL) -m 644 qemu-doc.html  qemu-tech.html "$(DESTDIR)$(docdir)"
 ifndef CONFIG_WIN32
        mkdir -p "$(DESTDIR)$(mandir)/man1"
-       install qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
+       $(INSTALL) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
        mkdir -p "$(DESTDIR)$(datadir)/keymaps"
        for x in $(KEYMAPS); do \
-               install -m 644 $(SRC_PATH)/keymaps/$$x 
"$(DESTDIR)$(datadir)/keymaps"; \
+               $(INSTALL) -m 644 $(SRC_PATH)/keymaps/$$x 
"$(DESTDIR)$(datadir)/keymaps"; \
        done
 endif
        for d in $(TARGET_DIRS); do \
diff -ruN qemu/Makefile.target qemu-solaris/Makefile.target
--- qemu/Makefile.target        2006-04-16 08:41:07.000000000 -0400
+++ qemu-solaris/Makefile.target        2006-04-16 13:18:19.000000000 -0400
@@ -109,7 +109,11 @@
 ifeq ($(ARCH),sparc)
 CFLAGS+=-m32 -ffixed-g1 -ffixed-g2 -ffixed-g3 -ffixed-g6
 LDFLAGS+=-m32
+ifeq ($(HAVE_GCC3_OPTIONS),yes)
+OP_CFLAGS=$(CFLAGS) -fno-delayed-branch -ffixed-i0 -fno-omit-frame-pointer
+else
 OP_CFLAGS=$(CFLAGS) -fno-delayed-branch -ffixed-i0
+endif
 HELPER_CFLAGS=$(CFLAGS) -ffixed-i0 -mflat
 # -static is used to avoid g1/g3 usage by the dynamic linker
 LDFLAGS+=-Wl,-T,$(SRC_PATH)/sparc.ld -static
@@ -118,8 +122,12 @@
 ifeq ($(ARCH),sparc64)
 CFLAGS+=-m64 -ffixed-g1 -ffixed-g2 -ffixed-g3 -ffixed-g6
 LDFLAGS+=-m64
+ifeq ($(HAVE_GCC3_OPTIONS),yes)
+OP_CFLAGS=$(CFLAGS) -fno-delayed-branch -ffixed-i0 -fno-omit-frame-pointer
+else
 OP_CFLAGS=$(CFLAGS) -fno-delayed-branch -ffixed-i0
 endif
+endif
 
 ifeq ($(ARCH),alpha)
 # -msmall-data is not used because we want two-instruction relocations
@@ -166,6 +174,13 @@
 ifdef CONFIG_WIN32
 LIBS+=-lwinmm -lws2_32 -liphlpapi
 endif
+ifdef CONFIG_SOLARIS
+LIBS+=-lsocket -lnsl -lresolv
+ifdef _PRESOLARIS10
+CFLAGS+=-D_PRESOLARIS10
+endif
+endif
+
 
 # profiling code
 ifdef TARGET_GPROF
@@ -283,6 +298,11 @@
 endif
 ifdef CONFIG_OSS
 AUDIODRV += ossaudio.o
+ifdef CONFIG_SOLARIS
+ifdef CONFIG_OSS_INC
+audio.o ossaudio.o: DEFINES := -I$(CONFIG_OSS_INC) $(DEFINES)
+endif
+endif
 endif
 ifdef CONFIG_COREAUDIO
 AUDIODRV += coreaudio.o
@@ -373,9 +393,11 @@
 endif
 ifndef CONFIG_DARWIN
 ifndef CONFIG_WIN32
+ifndef CONFIG_SOLARIS
 VL_LIBS=-lutil
 endif
 endif
+endif
 ifdef TARGET_GPROF
 vl.o: CFLAGS+=-p
 VL_LDFLAGS+=-p
@@ -470,7 +492,7 @@
 
 install: all 
 ifneq ($(PROGS),)
-       install -m 755 -s $(PROGS) "$(DESTDIR)$(bindir)"
+       $(INSTALL) -m 755 -s $(PROGS) "$(DESTDIR)$(bindir)"
 endif
 
 ifneq ($(wildcard .depend),)
diff -ruN qemu/block.c qemu-solaris/block.c
--- qemu/block.c        2005-12-18 13:28:15.000000000 -0500
+++ qemu-solaris/block.c        2006-04-16 13:18:32.000000000 -0400
@@ -648,6 +648,33 @@
     }
 }
 
+#ifdef __sun__
+static int64_t
+raw_find_device_size(int fd)
+{
+    char buf[512];
+    uint64_t low, high, mid;
+
+    /* we already know that the real capacity is at least one sector */
+    low = high = 1;
+
+    /* find an upper limit for the device size */
+    while (pread(fd, buf, 512, high*512) == 512) {
+       low = high;
+       high <<= 1;
+    }
+
+    /* find the real device size using a binary search */
+    while (low < high) {
+       mid = (low + high) >> 1;
+       if (pread(fd, buf, 512, mid*512) == 512)
+           low = mid + 1;
+       else
+           high = mid;
+    }
+    return low*512;
+}
+#endif
 
 /**************************************************************/
 /* RAW block driver */
@@ -698,6 +725,29 @@
     if (size == -1)
         size = LONG_LONG_MAX;
 #endif
+
+#ifdef __sun__
+    /*
+     * the solaris 9 character device /vol/dev/aliases/cdrom0 refuses to 
+     * seek to the end of the device and stays at seek offset 0. So we 
+     * have to work a bit harder to find out the real device size in this
+     * special case.
+     */
+    {
+       char buf[512];
+       struct stat stb;
+
+       /*
+        * is it a character device, and did lseek lie about the seek offset
+        * for the end of file position?
+        */
+       if (size == 0 && fstat(fd, &stb) == 0 && S_ISCHR(stb.st_mode)
+           && read(fd, buf, sizeof(buf)) == sizeof(buf)) {
+           size = raw_find_device_size(fd);
+       }
+    }
+
+#endif
     bs->total_sectors = size / 512;
     s->fd = fd;
     return 0;
diff -ruN qemu/bswap.h qemu-solaris/bswap.h
--- qemu/bswap.h        2004-10-10 11:44:19.000000000 -0400
+++ qemu-solaris/bswap.h        2006-04-16 13:18:51.000000000 -0400
@@ -27,6 +27,20 @@
                (((uint32_t)(__x) & (uint32_t)0xff000000UL) >> 24) )); \
 })
 
+#ifdef __sun__
+
+#define        bswap_64(x) \
+({ \
+       uint64_t __x = (x); \
+       uint32_t __hi = __x >> 32; \
+       uint32_t __lo = __x; \
+       __hi = bswap_32(__hi); \
+       __lo = bswap_32(__lo); \
+       (uint64_t)__lo << 32 | __hi; \
+})
+
+#else
+
 #define bswap_64(x) \
 ({ \
        uint64_t __x = (x); \
@@ -41,6 +55,8 @@
                (uint64_t)(((uint64_t)(__x) & (uint64_t)0xff00000000000000ULL) 
>> 56) )); \
 })
 
+#endif
+
 #endif /* !HAVE_BYTESWAP_H */
 
 static inline uint16_t bswap16(uint16_t x)
diff -ruN qemu/configure qemu-solaris/configure
--- qemu/configure      2006-04-16 11:19:15.000000000 -0400
+++ qemu-solaris/configure      2006-04-16 14:08:15.714102000 -0400
@@ -25,6 +25,7 @@
 host_cc="gcc"
 ar="ar"
 make="make"
+install="install"
 strip="strip"
 cpu=`uname -m`
 target_list=""
@@ -50,7 +51,7 @@
   s390)
     cpu="s390"
   ;;
-  sparc)
+  sparc|sun4m|sun4u)
     cpu="sparc"
   ;;
   sparc64)
@@ -123,6 +124,9 @@
 bsd="yes"
 darwin="yes"
 ;;
+SunOS)
+solaris="yes"
+;;
 *)
 oss="yes"
 linux="yes"
@@ -139,6 +143,15 @@
   fi
 fi
 
+if [ "$solaris" = "yes" ] ; then
+    make="gmake"
+    install="ginstall"
+    solarisrev=`uname -r | cut -f2 -d.`
+    if test $solarisrev -lt 10 ; then
+      presolaris10="yes"
+    fi
+fi
+
 # find source path
 source_path=`dirname "$0"`
 if [ -z "$source_path" ]; then
@@ -172,6 +185,8 @@
   ;;
   --make=*) make="$optarg"
   ;;
+  --install=*) install="$optarg"
+  ;;
   --extra-cflags=*) CFLAGS="$optarg"
   ;;
   --extra-ldflags=*) LDFLAGS="$optarg"
@@ -212,6 +227,21 @@
   ;;
   --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no"
   ;;
+  --with-oss=*) oss="$optarg"
+    case $oss in
+      yes|y|YES|Y) oss="yes";;
+      *) oss="no";;
+    esac
+  ;;
+  --oss-inc=*) oss_inc=$"optarg"
+    if test ! -d "$oss_inc" || ! test -f "$oss_inc/sys/soundcard.h" ; then
+      oss_inc=""
+      echo "Could not find $oss_inc/sys/soundcard.h.  Disabling OSS"
+      if test "$solaris" = "yes" ; then
+          oss=no;
+      fi
+    fi
+  ;;
   --disable-gfx-check) check_gfx="no"
   ;;
   --disable-gcc-check) check_gcc="no"
@@ -256,6 +286,7 @@
 echo "  --cc=CC                  use C compiler CC [$cc]"
 echo "  --host-cc=CC             use C compiler CC [$host_cc] for dyngen etc."
 echo "  --make=MAKE              use specified make [$make]"
+echo "  --install=INSTALL        use specified install [$install]"
 echo "  --static                 enable static build [$static]"
 echo "  --enable-cocoa           enable COCOA (Mac OS X only)"
 echo "  --enable-mingw32         enable Win32 cross compilation with mingw32"
@@ -270,6 +301,8 @@
 echo "  --disable-user           disable all linux usermode emulation targets"
 echo "  --fmod-lib               path to FMOD library"
 echo "  --fmod-inc               path to FMOD includes"
+echo "  --with-oss               attempt to use OSS sound drivers (solaris)"
+echo "  --oss-inc                path to OSS includes"
 echo ""
 echo "NOTE: The object files are build at the place where configure is 
launched"
 exit 1
@@ -289,6 +322,53 @@
     fi
 fi
 
+#
+# Solaris specific configure tool chain decisions
+#
+if test "$solaris" = "yes" ; then
+  #solaris gcc for solaris 10 in /usr/sfw/bin doesn't compile qemu correctly
+  if test -z "$presolaris10" ; then
+    solgcc=`which $cc`
+    if test "$solgcc" = "/usr/sfw/bin/gcc" ; then
+      echo "Solaris 10 gcc in /usr/sfw/bin will not compiled qemu correctly."
+      echo "please get gcc-3.4.3 or later, from www.blastwave.org using 
pkg-get -i gcc3"
+      exit 1
+    fi
+  fi
+  solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
+  if test -z "$solinst" ; then
+    echo "Solaris install program not found. Use --install=/usr/ucb/install or"
+    echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
+    echo "to get ginstall which is used by default (which lives in 
/opt/csw/bin)"
+    exit 1
+  fi
+  if test "$solinst" = "/usr/sbin/install" ; then
+    echo "Error: Solaris /usr/sbin/install is not an appropriate install 
program."
+    echo "try ginstall from the GNU fileutils available from www.blastwave.org"
+    echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
+    exit 1
+  fi
+  soltexi2html=`which texi2html 2> /dev/null | /usr/bin/grep -v "no texi2html 
in"`
+  if test -z "$soltexi2html" ; then
+    echo "Error: No path includes texi2html."
+    if test -f /usr/sfw/bin/texi2html ; then
+      echo "Add /usr/sfw/bin to your path and rerun configure"
+    else
+      echo "Add the directory holding the texi2html to your path and rerun 
configure"
+    fi
+    exit 1
+  fi
+  sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
+  if test -z "$sol_ar" ; then
+    echo "Error: No path includes ar"
+    if test -f /usr/ccs/bin/ar ; then
+      echo "Add /usr/ccs/bin to your path and rerun configure"
+    fi
+    exit 1
+  fi
+fi 
+
+
 if test -z "$target_list" ; then
 # these targets are portable
     if [ "$softmmu" = "yes" ] ; then
@@ -447,6 +527,7 @@
 echo "C compiler        $cc"
 echo "Host C compiler   $host_cc"
 echo "make              $make"
+echo "install           $install"
 echo "host CPU          $cpu"
 echo "host big endian   $bigendian"
 echo "target list       $target_list"
@@ -478,6 +559,11 @@
     fmod_support=""
 fi
 echo "FMOD support      $fmod $fmod_support"
+if test "$oss" = "yes" && test -d "$oss_inc"; then
+    echo "OSS support       $oss (include='$oss_inc')"
+else
+    echo "OSS support       $oss"
+fi 
 echo "kqemu support     $kqemu"
 
 if test $sdl_too_old = "yes"; then
@@ -502,6 +588,7 @@
 echo "docdir=$docdir" >> $config_mak
 echo "#define CONFIG_QEMU_SHAREDIR \"$datadir\"" >> $config_h
 echo "MAKE=$make" >> $config_mak
+echo "INSTALL=$install" >> $config_mak
 echo "CC=$cc" >> $config_mak
 if test "$have_gcc3_options" = "yes" ; then
   echo "HAVE_GCC3_OPTIONS=yes" >> $config_mak
@@ -567,6 +654,15 @@
   echo "CONFIG_DARWIN=yes" >> $config_mak
   echo "#define CONFIG_DARWIN 1" >> $config_h
 fi
+if test "$solaris" = "yes" ; then
+  echo "CONFIG_SOLARIS=yes" >> $config_mak
+  echo "#define CONFIG_SOLARIS 1" >> $config_h
+  echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
+  if test "$presolaris10" = "yes" ; then
+    echo "PRESOLARIS10=yes" >> $config_mak
+    echo "#define _PRESOLARIS10 1" >> $config_h
+  fi
+fi
 if test "$gdbstub" = "yes" ; then
   echo "CONFIG_GDBSTUB=yes" >> $config_mak
   echo "#define CONFIG_GDBSTUB 1" >> $config_h
@@ -591,8 +687,18 @@
   echo "#define CONFIG_ADLIB 1" >> $config_h
 fi
 if test "$oss" = "yes" ; then
-  echo "CONFIG_OSS=yes" >> $config_mak
-  echo "#define CONFIG_OSS 1" >> $config_h
+  if test "$solaris" = "yes" && test -n "$oss_inc" ; then
+    echo "CONFIG_OSS_INC=$oss_inc" >> $config_mak
+  elif test "$solaris" = "yes" && test -z "$oss_inc" ; then
+    # handle case where OSS include is in /usr/include (OSS 4.0)
+    if test -f "$oss_inc/sys/soundcard.h" ; then
+      no_oss_hfile="yes"
+    fi
+  fi
+  if test -z "$no_oss_hfile" ; then
+    echo "CONFIG_OSS=yes" >> $config_mak
+    echo "#define CONFIG_OSS 1" >> $config_h
+  fi
 fi
 if test "$coreaudio" = "yes" ; then
   echo "CONFIG_COREAUDIO=yes" >> $config_mak
@@ -669,7 +775,16 @@
   mkdir -p $target_dir/slirp
 fi
 
-ln -sf $source_path/Makefile.target $target_dir/Makefile
+# handle case that stock solaris ln won't overwrite an existing link.
+# that is gnu ln behavior, and we need to work around it.
+#
+if test "$solaris" = "yes" ; then
+  rm -f $target_dir/Makefile
+  ln -s $source_path/Makefile.target $target_dir/Makefile
+else
+  ln -sf $source_path/Makefile.target $target_dir/Makefile
+fi
+
 
 echo "# Automatically generated by configure - do not modify" > $config_mak
 echo "/* Automatically generated by configure - do not modify */" > $config_h
@@ -781,8 +896,14 @@
     for dir in $DIRS ; do
             mkdir -p $dir
     done
+    # handle case where solaris ln won't overwrite existing links
     for f in $FILES ; do
-        ln -sf $source_path/$f $f
+        if test "solaris" = "yes" ; then
+            rm -f $f
+            ln -s $source_path/$f $f
+        else
+            ln -sf $source_path/$f $f
+        fi
     done
 fi
 
diff -ruN qemu/dyngen-exec.h qemu-solaris/dyngen-exec.h
--- qemu/dyngen-exec.h  2005-07-24 11:11:38.000000000 -0400
+++ qemu-solaris/dyngen-exec.h  2006-04-16 13:21:21.000000000 -0400
@@ -25,6 +25,11 @@
    host headers do not allow that. */
 #include <stddef.h>
 
+#ifdef __sun__
+#include <stdio.h>
+#include <sys/types.h>
+#else
+
 typedef unsigned char uint8_t;
 typedef unsigned short uint16_t;
 typedef unsigned int uint32_t;
@@ -63,6 +68,8 @@
 #undef NULL
 #define NULL 0
 
+#endif // __sun__
+
 #ifdef __i386__
 #define AREG0 "ebp"
 #define AREG1 "ebx"
@@ -231,6 +238,8 @@
 #ifdef __sparc__
 #define EXIT_TB() asm volatile ("jmpl %i0 + 8, %g0\n" \
                                 "nop")
+#define        GOTO_LABEL_PARAM(n) asm volatile ( \
+               "set " ASM_NAME(__op_gen_label) #n ", %g1; jmp %g1; nop")
 #endif
 #ifdef __arm__
 #define EXIT_TB() asm volatile ("b exec_loop")
diff -ruN qemu/fpu/softfloat-native.h qemu-solaris/fpu/softfloat-native.h
--- qemu/fpu/softfloat-native.h 2005-03-20 05:33:58.000000000 -0500
+++ qemu-solaris/fpu/softfloat-native.h 2006-04-16 13:25:39.000000000 -0400
@@ -3,8 +3,11 @@
 #if defined(_BSD) && !defined(__APPLE__)
 #include <ieeefp.h>
 #else
+#if !defined(_PRESOLARIS10)
 #include <fenv.h>
 #endif
+#endif
+#include "gnu-c99-math.h"
 
 typedef float float32;
 typedef double float64;
diff -ruN qemu/fpu/softfloat.h qemu-solaris/fpu/softfloat.h
--- qemu/fpu/softfloat.h        2005-03-13 13:52:29.000000000 -0500
+++ qemu-solaris/fpu/softfloat.h        2006-04-16 13:25:46.000000000 -0400
@@ -177,7 +177,9 @@
 | Routine to raise any or all of the software IEC/IEEE floating-point
 | exception flags.
 *----------------------------------------------------------------------------*/
+#ifndef __sun__
 void float_raise( signed char STATUS_PARAM);
+#endif
 
 /*----------------------------------------------------------------------------
 | Software IEC/IEEE integer-to-floating-point conversion routines.
diff -ruN qemu/gnu-c99-math.h qemu-solaris/gnu-c99-math.h
--- qemu/gnu-c99-math.h 1969-12-31 19:00:00.000000000 -0500
+++ qemu-solaris/gnu-c99-math.h 2006-04-16 13:23:56.000000000 -0400
@@ -0,0 +1,22 @@
+#if defined(__sun__) && defined(__GNUC__)
+
+/*
+ * C99 7.12.3 classification macros
+ * and
+ * C99 7.12.14 comparison macros
+ *
+ * ... do not work on Solaris 10 using GNU CC 3.4.x.
+ * Try to workaround the missing / broken C99 math macros.
+ */
+#include <ieeefp.h>
+
+#define isnormal(x)             (fpclass(x) >= FP_NZERO)
+
+#define isgreater(x, y)         ((!unordered(x, y)) && ((x) > (y)))
+#define isgreaterequal(x, y)    ((x) >= (y))
+#define isless(x, y)            ((x) < (y))
+#define islessequal(x, y)       ((x) <= (y))
+
+#define isunordered(x,y)        unordered(x, y)
+
+#endif
diff -ruN qemu/linux-user/main.c qemu-solaris/linux-user/main.c
--- qemu/linux-user/main.c      2006-03-25 14:31:22.000000000 -0500
+++ qemu-solaris/linux-user/main.c      2006-04-16 13:25:54.000000000 -0400
@@ -33,6 +33,10 @@
 # define environ  (*_NSGetEnviron())
 #endif
 
+#if defined(unix) && !defined(linux)
+extern char **environ;
+#endif
+
 static const char *interp_prefix = CONFIG_QEMU_PREFIX;
 
 #if defined(__i386__) && !defined(CONFIG_STATIC)
diff -ruN qemu/linux-user/syscall.c qemu-solaris/linux-user/syscall.c
--- qemu/linux-user/syscall.c   2006-04-16 10:14:53.000000000 -0400
+++ qemu-solaris/linux-user/syscall.c   2006-04-16 13:28:27.000000000 -0400
@@ -22,7 +22,9 @@
 #include <stdarg.h>
 #include <string.h>
 #include <elf.h>
+#ifdef linux
 #include <endian.h>
+#endif
 #include <errno.h>
 #include <unistd.h>
 #include <fcntl.h>
@@ -56,6 +58,7 @@
 #define tchars host_tchars /* same as target */
 #define ltchars host_ltchars /* same as target */
 
+#ifdef linux
 #include <linux/termios.h>
 #include <linux/unistd.h>
 #include <linux/utsname.h>
@@ -64,6 +67,7 @@
 #include <linux/soundcard.h>
 #include <linux/dirent.h>
 #include <linux/kd.h>
+#endif
 
 #include "qemu.h"
 
@@ -203,6 +207,8 @@
 
 #define __NR_sys_uname __NR_uname
 #define __NR_sys_getcwd1 __NR_getcwd
+#define __NR_sys_statfs __NR_statfs
+#define __NR_sys_fstatfs __NR_fstatfs
 #define __NR_sys_getdents __NR_getdents
 #define __NR_sys_getdents64 __NR_getdents64
 #define __NR_sys_rt_sigqueueinfo __NR_rt_sigqueueinfo
@@ -224,6 +230,8 @@
 _syscall3(int, sys_getdents64, uint, fd, struct dirent64 *, dirp, uint, count);
 _syscall5(int, _llseek,  uint,  fd, ulong, hi, ulong, lo,
           loff_t *, res, uint, wh);
+_syscall2(int,sys_statfs,const char *,path,struct kernel_statfs *,buf)
+_syscall2(int,sys_fstatfs,int,fd,struct kernel_statfs *,buf)
 _syscall3(int,sys_rt_sigqueueinfo,int,pid,int,sig,siginfo_t *,uinfo)
 #ifdef __NR_exit_group
 _syscall1(int,exit_group,int,error_code)
diff -ruN qemu/slirp/slirp_config.h qemu-solaris/slirp/slirp_config.h
--- qemu/slirp/slirp_config.h   2005-06-05 13:11:42.000000000 -0400
+++ qemu-solaris/slirp/slirp_config.h   2006-04-16 13:25:15.000000000 -0400
@@ -138,6 +138,9 @@
 
 /* Define if you don't have u_int32_t etc. typedef'd */
 #undef NEED_TYPEDEFS
+#ifdef __sun__
+#define NEED_TYPEDEFS
+#endif
 
 /* Define to sizeof(char) */
 #define SIZEOF_CHAR 1
diff -ruN qemu/slirp/socket.c qemu-solaris/slirp/socket.c
--- qemu/slirp/socket.c 2006-03-11 15:48:36.000000000 -0500
+++ qemu-solaris/slirp/socket.c 2006-04-16 13:25:06.000000000 -0400
@@ -9,6 +9,9 @@
 #include <slirp.h>
 #include "ip_icmp.h"
 #include "main.h"
+#ifdef __sun__
+#include <sys/filio.h>
+#endif
 
 void
 so_init()
diff -ruN qemu/target-i386/exec.h qemu-solaris/target-i386/exec.h
--- qemu/target-i386/exec.h     2005-10-30 13:16:26.000000000 -0500
+++ qemu-solaris/target-i386/exec.h     2006-04-16 13:24:57.000000000 -0400
@@ -20,6 +20,10 @@
 #include "config.h"
 #include "dyngen-exec.h"
 
+#ifdef __sun__
+#include <sys/types.h>
+#endif
+
 /* XXX: factorize this mess */
 #ifdef TARGET_X86_64
 #define TARGET_LONG_BITS 64
diff -ruN qemu/vl.c qemu-solaris/vl.c
--- qemu/vl.c   2006-04-16 07:06:58.000000000 -0400
+++ qemu-solaris/vl.c   2006-04-16 13:24:35.000000000 -0400
@@ -47,6 +47,22 @@
 #include <libutil.h>
 #endif
 #else
+#ifdef __sun__
+#include <sys/stat.h>
+#include <sys/ethernet.h>
+#include <sys/sockio.h>
+#include <arpa/inet.h>
+#include <netinet/arp.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_icmp.h> // must come after ip.h
+#include <netinet/udp.h>
+#include <netinet/tcp.h>
+#include <net/if.h>
+#include <syslog.h>
+#include <stropts.h>
+#else
 #include <linux/if.h>
 #include <linux/if_tun.h>
 #include <pty.h>
@@ -55,6 +71,7 @@
 #include <linux/ppdev.h>
 #endif
 #endif
+#endif
 
 #if defined(CONFIG_SLIRP)
 #include "libslirp.h"
@@ -2560,6 +2577,12 @@
     fcntl(fd, F_SETFL, O_NONBLOCK);
     return fd;
 }
+#elif defined(__sun__)
+static int tap_open(char *ifname, int ifname_size)
+{
+    fprintf(stderr, "warning: tap_open not yet implemented\n");
+    return -1;
+}
 #else
 static int tap_open(char *ifname, int ifname_size)
 {

reply via email to

[Prev in Thread] Current Thread [Next in Thread]