Skip to content

Commit

Permalink
Support for 32 bit ABI on 64 bit targets (only enabled Sparc64)
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3396 c046a42c-6fe2-441c-8c8c-71466251a162
  • Loading branch information
blueswir1 committed Oct 14, 2007
1 parent b227a8e commit 992f48a
Show file tree
Hide file tree
Showing 41 changed files with 1,042 additions and 997 deletions.
10 changes: 9 additions & 1 deletion Makefile.target
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
endif
ifdef CONFIG_LINUX_USER
VPATH+=:$(SRC_PATH)/linux-user
CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH)
ifndef TARGET_ABI_DIR
TARGET_ABI_DIR=$(TARGET_ARCH)
endif
CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
endif
BASE_CFLAGS=
BASE_LDFLAGS=
Expand Down Expand Up @@ -66,6 +69,11 @@ ifeq ($(TARGET_ARCH),mips64)
TARGET_ARCH2=mips64el
endif
endif
ifeq ($(TARGET_ARCH),sparc64)
ifeq ($(TARGET_ABI_DIR),sparc)
TARGET_ARCH2=sparc32plus
endif
endif
QEMU_USER=qemu-$(TARGET_ARCH2)
# system emulator name
ifdef CONFIG_SOFTMMU
Expand Down
12 changes: 10 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ if test -z "$target_list" ; then
fi
# the following are Linux specific
if [ "$linux_user" = "yes" ] ; then
target_list="i386-linux-user arm-linux-user armeb-linux-user sparc-linux-user mips-linux-user mipsel-linux-user m68k-linux-user alpha-linux-user sh4-linux-user ppc-linux-user ppc64-linux-user x86_64-linux-user cris-linux-user $target_list"
target_list="i386-linux-user arm-linux-user armeb-linux-user sparc-linux-user sparc64-linux-user sparc32plus-linux-user mips-linux-user mipsel-linux-user m68k-linux-user alpha-linux-user sh4-linux-user ppc-linux-user ppc64-linux-user x86_64-linux-user cris-linux-user $target_list"
fi
# the following are Darwin specific
if [ "$darwin_user" = "yes" ] ; then
Expand Down Expand Up @@ -933,6 +933,7 @@ target_bigendian="no"
[ "$target_cpu" = "armeb" ] && target_bigendian=yes
[ "$target_cpu" = "sparc" ] && target_bigendian=yes
[ "$target_cpu" = "sparc64" ] && target_bigendian=yes
[ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes
[ "$target_cpu" = "ppc" ] && target_bigendian=yes
[ "$target_cpu" = "ppcemb" ] && target_bigendian=yes
[ "$target_cpu" = "ppc64" ] && target_bigendian=yes
Expand Down Expand Up @@ -1026,6 +1027,13 @@ elif test "$target_cpu" = "sparc64" ; then
echo "#define TARGET_SPARC 1" >> $config_h
echo "#define TARGET_SPARC64 1" >> $config_h
elfload32="yes"
elif test "$target_cpu" = "sparc32plus" ; then
echo "TARGET_ARCH=sparc64" >> $config_mak
echo "TARGET_ABI_DIR=sparc" >> $config_mak
echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
echo "#define TARGET_SPARC 1" >> $config_h
echo "#define TARGET_SPARC64 1" >> $config_h
echo "#define TARGET_ABI32 1" >> $config_h
elif test "$target_cpu" = "ppc" ; then
echo "TARGET_ARCH=ppc" >> $config_mak
echo "#define TARGET_ARCH \"ppc\"" >> $config_h
Expand Down Expand Up @@ -1113,7 +1121,7 @@ if test "$target_darwin_user" = "yes" ; then
echo "#define CONFIG_DARWIN_USER 1" >> $config_h
fi

if test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" -o "$target_cpu" = "sparc" -o "$target_cpu" = "sparc64" -o "$target_cpu" = "m68k" -o "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" -o "$target_cpu" = "mipsn32" -o "$target_cpu" = "mipsn32el" -o "$target_cpu" = "mips64" -o "$target_cpu" = "mips64el"; then
if test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" -o "$target_cpu" = "sparc" -o "$target_cpu" = "sparc64" -o "$target_cpu" = "sparc32plus" -o "$target_cpu" = "m68k" -o "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" -o "$target_cpu" = "mipsn32" -o "$target_cpu" = "mipsn32el" -o "$target_cpu" = "mips64" -o "$target_cpu" = "mips64el"; then
echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
fi
Expand Down
62 changes: 31 additions & 31 deletions linux-user/alpha/syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,40 @@
#define __USER_DS (1)

struct target_pt_regs {
target_ulong r0;
target_ulong r1;
target_ulong r2;
target_ulong r3;
target_ulong r4;
target_ulong r5;
target_ulong r6;
target_ulong r7;
target_ulong r8;
target_ulong r19;
target_ulong r20;
target_ulong r21;
target_ulong r22;
target_ulong r23;
target_ulong r24;
target_ulong r25;
target_ulong r26;
target_ulong r27;
target_ulong r28;
target_ulong hae;
abi_ulong r0;
abi_ulong r1;
abi_ulong r2;
abi_ulong r3;
abi_ulong r4;
abi_ulong r5;
abi_ulong r6;
abi_ulong r7;
abi_ulong r8;
abi_ulong r19;
abi_ulong r20;
abi_ulong r21;
abi_ulong r22;
abi_ulong r23;
abi_ulong r24;
abi_ulong r25;
abi_ulong r26;
abi_ulong r27;
abi_ulong r28;
abi_ulong hae;
/* JRP - These are the values provided to a0-a2 by PALcode */
target_ulong trap_a0;
target_ulong trap_a1;
target_ulong trap_a2;
abi_ulong trap_a0;
abi_ulong trap_a1;
abi_ulong trap_a2;
/* These are saved by PAL-code: */
target_ulong ps;
target_ulong pc;
target_ulong gp;
target_ulong r16;
target_ulong r17;
target_ulong r18;
abi_ulong ps;
abi_ulong pc;
abi_ulong gp;
abi_ulong r16;
abi_ulong r17;
abi_ulong r18;
/* Those is needed by qemu to temporary store the user stack pointer */
target_ulong usp;
target_ulong unique;
abi_ulong usp;
abi_ulong unique;
};

#define UNAME_MACHINE "alpha"
8 changes: 4 additions & 4 deletions linux-user/alpha/target_signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
/* this struct defines a stack used during syscall handling */

typedef struct target_sigaltstack {
target_ulong ss_sp;
target_long ss_flags;
target_ulong ss_size;
abi_ulong ss_sp;
abi_long ss_flags;
abi_ulong ss_size;
} target_stack_t;


Expand All @@ -21,7 +21,7 @@ typedef struct target_sigaltstack {
#define TARGET_MINSIGSTKSZ 4096
#define TARGET_SIGSTKSZ 16384

static inline target_ulong get_sp_from_cpustate(CPUAlphaState *state)
static inline abi_ulong get_sp_from_cpustate(CPUAlphaState *state)
{
return state->ir[IR_SP];
}
Expand Down
2 changes: 1 addition & 1 deletion linux-user/arm/syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
stack during a system call. */

struct target_pt_regs {
target_long uregs[18];
abi_long uregs[18];
};

#define ARM_cpsr uregs[16]
Expand Down
8 changes: 4 additions & 4 deletions linux-user/arm/target_signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
/* this struct defines a stack used during syscall handling */

typedef struct target_sigaltstack {
target_ulong ss_sp;
target_long ss_flags;
target_ulong ss_size;
abi_ulong ss_sp;
abi_long ss_flags;
abi_ulong ss_size;
} target_stack_t;


Expand All @@ -21,7 +21,7 @@ typedef struct target_sigaltstack {
#define TARGET_MINSIGSTKSZ 2048
#define TARGET_SIGSTKSZ 8192

static inline target_ulong get_sp_from_cpustate(CPUARMState *state)
static inline abi_ulong get_sp_from_cpustate(CPUARMState *state)
{
return state->regs[13];
}
Expand Down
8 changes: 4 additions & 4 deletions linux-user/cris/target_signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
/* this struct defines a stack used during syscall handling */

typedef struct target_sigaltstack {
target_ulong ss_sp;
target_ulong ss_size;
target_long ss_flags;
abi_ulong ss_sp;
abi_ulong ss_size;
abi_long ss_flags;
} target_stack_t;


Expand All @@ -21,7 +21,7 @@ typedef struct target_sigaltstack {
#define TARGET_MINSIGSTKSZ 2048
#define TARGET_SIGSTKSZ 8192

static inline target_ulong get_sp_from_cpustate(CPUCRISState *state)
static inline abi_ulong get_sp_from_cpustate(CPUCRISState *state)
{
return state->regs[14];
}
Expand Down
Loading

0 comments on commit 992f48a

Please sign in to comment.