mirror of https://github.com/xqemu/xqemu.git
Preliminary AIX support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5732 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
14f87098c0
commit
b29fe3ed48
|
@ -763,10 +763,12 @@ endif
|
||||||
ifndef CONFIG_DARWIN
|
ifndef CONFIG_DARWIN
|
||||||
ifndef CONFIG_WIN32
|
ifndef CONFIG_WIN32
|
||||||
ifndef CONFIG_SOLARIS
|
ifndef CONFIG_SOLARIS
|
||||||
|
ifndef CONFIG_AIX
|
||||||
LIBS+=-lutil
|
LIBS+=-lutil
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
ifdef TARGET_GPROF
|
ifdef TARGET_GPROF
|
||||||
vl.o: CFLAGS+=-p
|
vl.o: CFLAGS+=-p
|
||||||
LDFLAGS+=-p
|
LDFLAGS+=-p
|
||||||
|
|
|
@ -32,7 +32,7 @@ ar="ar"
|
||||||
make="make"
|
make="make"
|
||||||
install="install"
|
install="install"
|
||||||
strip="strip"
|
strip="strip"
|
||||||
cpu=`uname -m`
|
cpu=`test $(uname -s) = AIX && uname -p || uname -m`
|
||||||
target_list=""
|
target_list=""
|
||||||
case "$cpu" in
|
case "$cpu" in
|
||||||
i386|i486|i586|i686|i86pc|BePC)
|
i386|i486|i586|i686|i86pc|BePC)
|
||||||
|
@ -68,7 +68,7 @@ case "$cpu" in
|
||||||
mips64)
|
mips64)
|
||||||
cpu="mips64"
|
cpu="mips64"
|
||||||
;;
|
;;
|
||||||
"Power Macintosh"|ppc|ppc64)
|
"Power Macintosh"|ppc|ppc64|powerpc)
|
||||||
cpu="powerpc"
|
cpu="powerpc"
|
||||||
;;
|
;;
|
||||||
s390*)
|
s390*)
|
||||||
|
@ -117,6 +117,7 @@ mixemu="no"
|
||||||
bluez="yes"
|
bluez="yes"
|
||||||
kvm="yes"
|
kvm="yes"
|
||||||
kerneldir=""
|
kerneldir=""
|
||||||
|
aix="no"
|
||||||
|
|
||||||
# OS specific
|
# OS specific
|
||||||
targetos=`uname -s`
|
targetos=`uname -s`
|
||||||
|
@ -206,6 +207,10 @@ SunOS)
|
||||||
fi
|
fi
|
||||||
audio_possible_drivers="oss sdl"
|
audio_possible_drivers="oss sdl"
|
||||||
;;
|
;;
|
||||||
|
AIX)
|
||||||
|
aix="yes"
|
||||||
|
make="gmake"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
audio_drv_list="oss"
|
audio_drv_list="oss"
|
||||||
audio_possible_drivers="oss alsa sdl esd pa"
|
audio_possible_drivers="oss alsa sdl esd pa"
|
||||||
|
@ -1220,6 +1225,12 @@ if test "$darwin" = "yes" ; then
|
||||||
echo "CONFIG_DARWIN=yes" >> $config_mak
|
echo "CONFIG_DARWIN=yes" >> $config_mak
|
||||||
echo "#define CONFIG_DARWIN 1" >> $config_h
|
echo "#define CONFIG_DARWIN 1" >> $config_h
|
||||||
fi
|
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
|
if test "$solaris" = "yes" ; then
|
||||||
echo "CONFIG_SOLARIS=yes" >> $config_mak
|
echo "CONFIG_SOLARIS=yes" >> $config_mak
|
||||||
echo "#define HOST_SOLARIS $solarisrev" >> $config_h
|
echo "#define HOST_SOLARIS $solarisrev" >> $config_h
|
||||||
|
|
|
@ -50,8 +50,10 @@ these four paragraphs for those parts of this code that are retained.
|
||||||
typedef uint8_t flag;
|
typedef uint8_t flag;
|
||||||
typedef uint8_t uint8;
|
typedef uint8_t uint8;
|
||||||
typedef int8_t int8;
|
typedef int8_t int8;
|
||||||
|
#ifndef _AIX
|
||||||
typedef int uint16;
|
typedef int uint16;
|
||||||
typedef int int16;
|
typedef int int16;
|
||||||
|
#endif
|
||||||
typedef unsigned int uint32;
|
typedef unsigned int uint32;
|
||||||
typedef signed int int32;
|
typedef signed int int32;
|
||||||
typedef uint64_t uint64;
|
typedef uint64_t uint64;
|
||||||
|
|
7
net.c
7
net.c
|
@ -780,6 +780,12 @@ static int tap_open(char *ifname, int ifname_size)
|
||||||
fcntl(fd, F_SETFL, O_NONBLOCK);
|
fcntl(fd, F_SETFL, O_NONBLOCK);
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
#elif defined (_AIX)
|
||||||
|
static int tap_open(char *ifname, int ifname_size)
|
||||||
|
{
|
||||||
|
fprintf (stderr, "no tap on AIX\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
static int tap_open(char *ifname, int ifname_size)
|
static int tap_open(char *ifname, int ifname_size)
|
||||||
{
|
{
|
||||||
|
@ -1441,6 +1447,7 @@ int net_client_init(const char *device, const char *p)
|
||||||
vlan->nb_host_devs++;
|
vlan->nb_host_devs++;
|
||||||
ret = tap_win32_init(vlan, ifname);
|
ret = tap_win32_init(vlan, ifname);
|
||||||
} else
|
} else
|
||||||
|
#elif defined (_AIX)
|
||||||
#else
|
#else
|
||||||
if (!strcmp(device, "tap")) {
|
if (!strcmp(device, "tap")) {
|
||||||
char ifname[64];
|
char ifname[64];
|
||||||
|
|
|
@ -27,6 +27,9 @@ static uint8_t *tb_ret_addr;
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define LINKAGE_AREA_SIZE 24
|
#define LINKAGE_AREA_SIZE 24
|
||||||
#define LR_OFFSET 8
|
#define LR_OFFSET 8
|
||||||
|
#elif defined _AIX
|
||||||
|
#define LINKAGE_AREA_SIZE 52
|
||||||
|
#define LR_OFFSET 8
|
||||||
#else
|
#else
|
||||||
#define LINKAGE_AREA_SIZE 8
|
#define LINKAGE_AREA_SIZE 8
|
||||||
#define LR_OFFSET 4
|
#define LR_OFFSET 4
|
||||||
|
@ -136,6 +139,9 @@ static const int tcg_target_callee_save_regs[] = {
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
TCG_REG_R11,
|
TCG_REG_R11,
|
||||||
TCG_REG_R13,
|
TCG_REG_R13,
|
||||||
|
#endif
|
||||||
|
#ifdef _AIX
|
||||||
|
TCG_REG_R13,
|
||||||
#endif
|
#endif
|
||||||
TCG_REG_R14,
|
TCG_REG_R14,
|
||||||
TCG_REG_R15,
|
TCG_REG_R15,
|
||||||
|
@ -455,6 +461,24 @@ static void tcg_out_b (TCGContext *s, int mask, tcg_target_long target)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _AIX
|
||||||
|
static void tcg_out_call (TCGContext *s, tcg_target_long arg, int const_arg)
|
||||||
|
{
|
||||||
|
int reg;
|
||||||
|
|
||||||
|
if (const_arg) {
|
||||||
|
reg = 2;
|
||||||
|
tcg_out_movi (s, TCG_TYPE_I32, reg, arg);
|
||||||
|
}
|
||||||
|
else reg = arg;
|
||||||
|
|
||||||
|
tcg_out32 (s, LWZ | RT (0) | RA (reg));
|
||||||
|
tcg_out32 (s, MTSPR | RA (0) | CTR);
|
||||||
|
tcg_out32 (s, LWZ | RT (2) | RA (reg) | 4);
|
||||||
|
tcg_out32 (s, BCCTR | BO_ALWAYS | LK);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_SOFTMMU)
|
#if defined(CONFIG_SOFTMMU)
|
||||||
|
|
||||||
#include "../../softmmu_defs.h"
|
#include "../../softmmu_defs.h"
|
||||||
|
@ -548,7 +572,11 @@ static void tcg_out_qemu_ld (TCGContext *s, const TCGArg *args, int opc)
|
||||||
tcg_out_movi (s, TCG_TYPE_I32, 5, mem_index);
|
tcg_out_movi (s, TCG_TYPE_I32, 5, mem_index);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _AIX
|
||||||
|
tcg_out_call (s, (tcg_target_long) qemu_ld_helpers[s_bits], 1);
|
||||||
|
#else
|
||||||
tcg_out_b (s, LK, (tcg_target_long) qemu_ld_helpers[s_bits]);
|
tcg_out_b (s, LK, (tcg_target_long) qemu_ld_helpers[s_bits]);
|
||||||
|
#endif
|
||||||
switch (opc) {
|
switch (opc) {
|
||||||
case 0|4:
|
case 0|4:
|
||||||
tcg_out32 (s, EXTSB | RA (data_reg) | RS (3));
|
tcg_out32 (s, EXTSB | RA (data_reg) | RS (3));
|
||||||
|
@ -766,7 +794,11 @@ static void tcg_out_qemu_st (TCGContext *s, const TCGArg *args, int opc)
|
||||||
ir++;
|
ir++;
|
||||||
|
|
||||||
tcg_out_movi (s, TCG_TYPE_I32, ir, mem_index);
|
tcg_out_movi (s, TCG_TYPE_I32, ir, mem_index);
|
||||||
|
#ifdef _AIX
|
||||||
|
tcg_out_call (s, (tcg_target_long) qemu_st_helpers[opc], 1);
|
||||||
|
#else
|
||||||
tcg_out_b (s, LK, (tcg_target_long) qemu_st_helpers[opc]);
|
tcg_out_b (s, LK, (tcg_target_long) qemu_st_helpers[opc]);
|
||||||
|
#endif
|
||||||
label2_ptr = s->code_ptr;
|
label2_ptr = s->code_ptr;
|
||||||
tcg_out32 (s, B);
|
tcg_out32 (s, B);
|
||||||
|
|
||||||
|
@ -836,6 +868,16 @@ void tcg_target_qemu_prologue (TCGContext *s)
|
||||||
;
|
;
|
||||||
frame_size = (frame_size + 15) & ~15;
|
frame_size = (frame_size + 15) & ~15;
|
||||||
|
|
||||||
|
#ifdef _AIX
|
||||||
|
{
|
||||||
|
uint32_t addr;
|
||||||
|
|
||||||
|
/* First emit adhoc function descriptor */
|
||||||
|
addr = (uint32_t) s->code_ptr + 12;
|
||||||
|
tcg_out32 (s, addr); /* entry point */
|
||||||
|
s->code_ptr += 8; /* skip TOC and environment pointer */
|
||||||
|
}
|
||||||
|
#endif
|
||||||
tcg_out32 (s, MFSPR | RT (0) | LR);
|
tcg_out32 (s, MFSPR | RT (0) | LR);
|
||||||
tcg_out32 (s, STWU | RS (1) | RA (1) | (-frame_size & 0xffff));
|
tcg_out32 (s, STWU | RS (1) | RA (1) | (-frame_size & 0xffff));
|
||||||
for (i = 0; i < ARRAY_SIZE (tcg_target_callee_save_regs); ++i)
|
for (i = 0; i < ARRAY_SIZE (tcg_target_callee_save_regs); ++i)
|
||||||
|
@ -1106,6 +1148,9 @@ static void tcg_out_op(TCGContext *s, int opc, const TCGArg *args,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case INDEX_op_call:
|
case INDEX_op_call:
|
||||||
|
#ifdef _AIX
|
||||||
|
tcg_out_call (s, args[0], const_args[0]);
|
||||||
|
#else
|
||||||
if (const_args[0]) {
|
if (const_args[0]) {
|
||||||
tcg_out_b (s, LK, args[0]);
|
tcg_out_b (s, LK, args[0]);
|
||||||
}
|
}
|
||||||
|
@ -1113,6 +1158,7 @@ static void tcg_out_op(TCGContext *s, int opc, const TCGArg *args,
|
||||||
tcg_out32 (s, MTSPR | RS (args[0]) | LR);
|
tcg_out32 (s, MTSPR | RS (args[0]) | LR);
|
||||||
tcg_out32 (s, BCLR | BO_ALWAYS | LK);
|
tcg_out32 (s, BCLR | BO_ALWAYS | LK);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case INDEX_op_jmp:
|
case INDEX_op_jmp:
|
||||||
if (const_args[0]) {
|
if (const_args[0]) {
|
||||||
|
|
|
@ -65,11 +65,15 @@ enum {
|
||||||
/* used for function call generation */
|
/* used for function call generation */
|
||||||
#define TCG_REG_CALL_STACK TCG_REG_R1
|
#define TCG_REG_CALL_STACK TCG_REG_R1
|
||||||
#define TCG_TARGET_STACK_ALIGN 16
|
#define TCG_TARGET_STACK_ALIGN 16
|
||||||
#ifdef __APPLE__
|
#if defined __APPLE__
|
||||||
#define TCG_TARGET_CALL_STACK_OFFSET 24
|
#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_ALIGN_ARGS 1
|
||||||
#define TCG_TARGET_CALL_STACK_OFFSET 8
|
#define TCG_TARGET_CALL_STACK_OFFSET 8
|
||||||
|
#else
|
||||||
|
#error Unsupported system
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* optional instructions */
|
/* optional instructions */
|
||||||
|
|
Loading…
Reference in New Issue