Skip to contentSkip to conversation

[5732] Preliminary AIX support

Qemu-devel malc 1 participant 1 message Nov 18, 2008 Kbuild

lore
Share & tools
lore

malc

author
#0 lore raw

Revision: 5732

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5732
Author:   malc
Date:     2008-11-18 01:42:22 +0000 (Tue, 18 Nov 2008)

Log Message:
-----------
Preliminary AIX support

Modified Paths:
--------------
trunk/Makefile.target
trunk/configure
trunk/fpu/softfloat.h
trunk/net.c
trunk/tcg/ppc/tcg-target.c
trunk/tcg/ppc/tcg-target.h
trunk/tcg/tcg.c

Modified: trunk/Makefile.target
===================================================================

Makefile.target +2 -0
@@ -763,10 +763,12 @@
 ifndef CONFIG_DARWIN
 ifndef CONFIG_WIN32
 ifndef CONFIG_SOLARIS
+ifndef CONFIG_AIX
 LIBS+=-lutil
 endif
 endif
 endif
+endif
 ifdef TARGET_GPROF
 vl.o: CFLAGS+=-p
 LDFLAGS+=-p

Modified: trunk/configure
===================================================================

configure +13 -2
@@ -32,7 +32,7 @@
 make="make"
 install="install"
 strip="strip"
-cpu=`uname -m`
+cpu=`test $(uname -s) = AIX && uname -p || uname -m`
 target_list=""
 case "$cpu" in
   i386|i486|i586|i686|i86pc|BePC)
@@ -68,7 +68,7 @@
   mips64)
     cpu="mips64"
   ;;
-  "Power Macintosh"|ppc|ppc64)
+  "Power Macintosh"|ppc|ppc64|powerpc)
     cpu="powerpc"
   ;;
   s390*)
@@ -117,6 +117,7 @@
 bluez="yes"
 kvm="yes"
 kerneldir=""
+aix="no"
 
 # OS specific
 targetos=`uname -s`
@@ -206,6 +207,10 @@
     fi
     audio_possible_drivers="oss sdl"
 ;;
+AIX)
+aix="yes"
+make="gmake"
+;;
 *)
 audio_drv_list="oss"
 audio_possible_drivers="oss alsa sdl esd pa"
@@ -1220,6 +1225,12 @@
   echo "CONFIG_DARWIN=yes" >> $config_mak
   echo "#define CONFIG_DARWIN 1" >> $config_h
 fi
+
+if test "$aix" = "yes" ; then
+  echo "CONFIG_AIX=yes" >> $config_mak
+  echo "#define CONFIG_AIX 1" >> $config_h
+fi
+
 if test "$solaris" = "yes" ; then
   echo "CONFIG_SOLARIS=yes" >> $config_mak
   echo "#define HOST_SOLARIS $solarisrev" >> $config_h

Modified: trunk/fpu/softfloat.h
===================================================================

fpu/softfloat.h +2 -0
@@ -50,8 +50,10 @@
 typedef uint8_t flag;
 typedef uint8_t uint8;
 typedef int8_t int8;
+#ifndef _AIX
 typedef int uint16;
 typedef int int16;
+#endif
 typedef unsigned int uint32;
 typedef signed int int32;
 typedef uint64_t uint64;

Modified: trunk/net.c
===================================================================

net.c +7 -0
@@ -780,6 +780,12 @@
     fcntl(fd, F_SETFL, O_NONBLOCK);
     return fd;
 }
+#elif defined (_AIX)
+static int tap_open(char *ifname, int ifname_size)
+{
+    fprintf (stderr, "no tap on AIX\n");
+    return -1;
+}
 #else
 static int tap_open(char *ifname, int ifname_size)
 {
@@ -1441,6 +1447,7 @@
         vlan->nb_host_devs++;
         ret = tap_win32_init(vlan, ifname);
     } else
+#elif defined (_AIX)
 #else
     if (!strcmp(device, "tap")) {
         char ifname[64];

Modified: trunk/tcg/ppc/tcg-target.c
===================================================================

tcg/ppc/tcg-target.c +46 -0

96 lines not on this page · raw message

Modified: trunk/tcg/ppc/tcg-target.h
===================================================================

tcg/ppc/tcg-target.h +6 -2
@@ -65,11 +65,15 @@
 /* used for function call generation */
 #define TCG_REG_CALL_STACK TCG_REG_R1
 #define TCG_TARGET_STACK_ALIGN 16
-#ifdef __APPLE__
+#if defined __APPLE__
 #define TCG_TARGET_CALL_STACK_OFFSET 24
-#else
+#elif defined _AIX
+#define TCG_TARGET_CALL_STACK_OFFSET 52
+#elif defined __linux__
 #define TCG_TARGET_CALL_ALIGN_ARGS 1
 #define TCG_TARGET_CALL_STACK_OFFSET 8
+#else
+#error Unsupported system
 #endif
 
 /* optional instructions */

Modified: trunk/tcg/tcg.c
===================================================================

tcg/tcg.c +3 -0
@@ -37,6 +37,9 @@
 #ifdef _WIN32
 #include <malloc.h>
 #endif
+#ifdef _AIX
+#include <alloca.h>
+#endif
 
 #include "config.h"
 #include "qemu-common.h"