mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Support for 32 bit ABI on 64 bit targets (only enabled Sparc64)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3396 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
+9
-1
@@ -31,7 +31,10 @@ CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
|
|||||||
endif
|
endif
|
||||||
ifdef CONFIG_LINUX_USER
|
ifdef CONFIG_LINUX_USER
|
||||||
VPATH+=:$(SRC_PATH)/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
|
endif
|
||||||
BASE_CFLAGS=
|
BASE_CFLAGS=
|
||||||
BASE_LDFLAGS=
|
BASE_LDFLAGS=
|
||||||
@@ -66,6 +69,11 @@ ifeq ($(TARGET_ARCH),mips64)
|
|||||||
TARGET_ARCH2=mips64el
|
TARGET_ARCH2=mips64el
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(TARGET_ARCH),sparc64)
|
||||||
|
ifeq ($(TARGET_ABI_DIR),sparc)
|
||||||
|
TARGET_ARCH2=sparc32plus
|
||||||
|
endif
|
||||||
|
endif
|
||||||
QEMU_USER=qemu-$(TARGET_ARCH2)
|
QEMU_USER=qemu-$(TARGET_ARCH2)
|
||||||
# system emulator name
|
# system emulator name
|
||||||
ifdef CONFIG_SOFTMMU
|
ifdef CONFIG_SOFTMMU
|
||||||
|
|||||||
@@ -504,7 +504,7 @@ if test -z "$target_list" ; then
|
|||||||
fi
|
fi
|
||||||
# the following are Linux specific
|
# the following are Linux specific
|
||||||
if [ "$linux_user" = "yes" ] ; then
|
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
|
fi
|
||||||
# the following are Darwin specific
|
# the following are Darwin specific
|
||||||
if [ "$darwin_user" = "yes" ] ; then
|
if [ "$darwin_user" = "yes" ] ; then
|
||||||
@@ -933,6 +933,7 @@ target_bigendian="no"
|
|||||||
[ "$target_cpu" = "armeb" ] && target_bigendian=yes
|
[ "$target_cpu" = "armeb" ] && target_bigendian=yes
|
||||||
[ "$target_cpu" = "sparc" ] && target_bigendian=yes
|
[ "$target_cpu" = "sparc" ] && target_bigendian=yes
|
||||||
[ "$target_cpu" = "sparc64" ] && target_bigendian=yes
|
[ "$target_cpu" = "sparc64" ] && target_bigendian=yes
|
||||||
|
[ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes
|
||||||
[ "$target_cpu" = "ppc" ] && target_bigendian=yes
|
[ "$target_cpu" = "ppc" ] && target_bigendian=yes
|
||||||
[ "$target_cpu" = "ppcemb" ] && target_bigendian=yes
|
[ "$target_cpu" = "ppcemb" ] && target_bigendian=yes
|
||||||
[ "$target_cpu" = "ppc64" ] && target_bigendian=yes
|
[ "$target_cpu" = "ppc64" ] && target_bigendian=yes
|
||||||
@@ -1026,6 +1027,13 @@ elif test "$target_cpu" = "sparc64" ; then
|
|||||||
echo "#define TARGET_SPARC 1" >> $config_h
|
echo "#define TARGET_SPARC 1" >> $config_h
|
||||||
echo "#define TARGET_SPARC64 1" >> $config_h
|
echo "#define TARGET_SPARC64 1" >> $config_h
|
||||||
elfload32="yes"
|
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
|
elif test "$target_cpu" = "ppc" ; then
|
||||||
echo "TARGET_ARCH=ppc" >> $config_mak
|
echo "TARGET_ARCH=ppc" >> $config_mak
|
||||||
echo "#define TARGET_ARCH \"ppc\"" >> $config_h
|
echo "#define TARGET_ARCH \"ppc\"" >> $config_h
|
||||||
@@ -1113,7 +1121,7 @@ if test "$target_darwin_user" = "yes" ; then
|
|||||||
echo "#define CONFIG_DARWIN_USER 1" >> $config_h
|
echo "#define CONFIG_DARWIN_USER 1" >> $config_h
|
||||||
fi
|
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 "CONFIG_SOFTFLOAT=yes" >> $config_mak
|
||||||
echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
|
echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
|
||||||
fi
|
fi
|
||||||
|
|||||||
+31
-31
@@ -2,40 +2,40 @@
|
|||||||
#define __USER_DS (1)
|
#define __USER_DS (1)
|
||||||
|
|
||||||
struct target_pt_regs {
|
struct target_pt_regs {
|
||||||
target_ulong r0;
|
abi_ulong r0;
|
||||||
target_ulong r1;
|
abi_ulong r1;
|
||||||
target_ulong r2;
|
abi_ulong r2;
|
||||||
target_ulong r3;
|
abi_ulong r3;
|
||||||
target_ulong r4;
|
abi_ulong r4;
|
||||||
target_ulong r5;
|
abi_ulong r5;
|
||||||
target_ulong r6;
|
abi_ulong r6;
|
||||||
target_ulong r7;
|
abi_ulong r7;
|
||||||
target_ulong r8;
|
abi_ulong r8;
|
||||||
target_ulong r19;
|
abi_ulong r19;
|
||||||
target_ulong r20;
|
abi_ulong r20;
|
||||||
target_ulong r21;
|
abi_ulong r21;
|
||||||
target_ulong r22;
|
abi_ulong r22;
|
||||||
target_ulong r23;
|
abi_ulong r23;
|
||||||
target_ulong r24;
|
abi_ulong r24;
|
||||||
target_ulong r25;
|
abi_ulong r25;
|
||||||
target_ulong r26;
|
abi_ulong r26;
|
||||||
target_ulong r27;
|
abi_ulong r27;
|
||||||
target_ulong r28;
|
abi_ulong r28;
|
||||||
target_ulong hae;
|
abi_ulong hae;
|
||||||
/* JRP - These are the values provided to a0-a2 by PALcode */
|
/* JRP - These are the values provided to a0-a2 by PALcode */
|
||||||
target_ulong trap_a0;
|
abi_ulong trap_a0;
|
||||||
target_ulong trap_a1;
|
abi_ulong trap_a1;
|
||||||
target_ulong trap_a2;
|
abi_ulong trap_a2;
|
||||||
/* These are saved by PAL-code: */
|
/* These are saved by PAL-code: */
|
||||||
target_ulong ps;
|
abi_ulong ps;
|
||||||
target_ulong pc;
|
abi_ulong pc;
|
||||||
target_ulong gp;
|
abi_ulong gp;
|
||||||
target_ulong r16;
|
abi_ulong r16;
|
||||||
target_ulong r17;
|
abi_ulong r17;
|
||||||
target_ulong r18;
|
abi_ulong r18;
|
||||||
/* Those is needed by qemu to temporary store the user stack pointer */
|
/* Those is needed by qemu to temporary store the user stack pointer */
|
||||||
target_ulong usp;
|
abi_ulong usp;
|
||||||
target_ulong unique;
|
abi_ulong unique;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define UNAME_MACHINE "alpha"
|
#define UNAME_MACHINE "alpha"
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
/* this struct defines a stack used during syscall handling */
|
/* this struct defines a stack used during syscall handling */
|
||||||
|
|
||||||
typedef struct target_sigaltstack {
|
typedef struct target_sigaltstack {
|
||||||
target_ulong ss_sp;
|
abi_ulong ss_sp;
|
||||||
target_long ss_flags;
|
abi_long ss_flags;
|
||||||
target_ulong ss_size;
|
abi_ulong ss_size;
|
||||||
} target_stack_t;
|
} target_stack_t;
|
||||||
|
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ typedef struct target_sigaltstack {
|
|||||||
#define TARGET_MINSIGSTKSZ 4096
|
#define TARGET_MINSIGSTKSZ 4096
|
||||||
#define TARGET_SIGSTKSZ 16384
|
#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];
|
return state->ir[IR_SP];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
stack during a system call. */
|
stack during a system call. */
|
||||||
|
|
||||||
struct target_pt_regs {
|
struct target_pt_regs {
|
||||||
target_long uregs[18];
|
abi_long uregs[18];
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ARM_cpsr uregs[16]
|
#define ARM_cpsr uregs[16]
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
/* this struct defines a stack used during syscall handling */
|
/* this struct defines a stack used during syscall handling */
|
||||||
|
|
||||||
typedef struct target_sigaltstack {
|
typedef struct target_sigaltstack {
|
||||||
target_ulong ss_sp;
|
abi_ulong ss_sp;
|
||||||
target_long ss_flags;
|
abi_long ss_flags;
|
||||||
target_ulong ss_size;
|
abi_ulong ss_size;
|
||||||
} target_stack_t;
|
} target_stack_t;
|
||||||
|
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ typedef struct target_sigaltstack {
|
|||||||
#define TARGET_MINSIGSTKSZ 2048
|
#define TARGET_MINSIGSTKSZ 2048
|
||||||
#define TARGET_SIGSTKSZ 8192
|
#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];
|
return state->regs[13];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
/* this struct defines a stack used during syscall handling */
|
/* this struct defines a stack used during syscall handling */
|
||||||
|
|
||||||
typedef struct target_sigaltstack {
|
typedef struct target_sigaltstack {
|
||||||
target_ulong ss_sp;
|
abi_ulong ss_sp;
|
||||||
target_ulong ss_size;
|
abi_ulong ss_size;
|
||||||
target_long ss_flags;
|
abi_long ss_flags;
|
||||||
} target_stack_t;
|
} target_stack_t;
|
||||||
|
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ typedef struct target_sigaltstack {
|
|||||||
#define TARGET_MINSIGSTKSZ 2048
|
#define TARGET_MINSIGSTKSZ 2048
|
||||||
#define TARGET_SIGSTKSZ 8192
|
#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];
|
return state->regs[14];
|
||||||
}
|
}
|
||||||
|
|||||||
+74
-64
@@ -172,7 +172,7 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i
|
|||||||
|
|
||||||
static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)
|
static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)
|
||||||
{
|
{
|
||||||
target_long stack = infop->start_stack;
|
abi_long stack = infop->start_stack;
|
||||||
memset(regs, 0, sizeof(*regs));
|
memset(regs, 0, sizeof(*regs));
|
||||||
regs->ARM_cpsr = 0x10;
|
regs->ARM_cpsr = 0x10;
|
||||||
if (infop->entry & 1)
|
if (infop->entry & 1)
|
||||||
@@ -214,7 +214,11 @@ enum
|
|||||||
|
|
||||||
#define ELF_START_MMAP 0x80000000
|
#define ELF_START_MMAP 0x80000000
|
||||||
|
|
||||||
|
#ifndef TARGET_ABI32
|
||||||
#define elf_check_arch(x) ( (x) == EM_SPARCV9 || (x) == EM_SPARC32PLUS )
|
#define elf_check_arch(x) ( (x) == EM_SPARCV9 || (x) == EM_SPARC32PLUS )
|
||||||
|
#else
|
||||||
|
#define elf_check_arch(x) ( (x) == EM_SPARC32PLUS || (x) == EM_SPARC )
|
||||||
|
#endif
|
||||||
|
|
||||||
#define ELF_CLASS ELFCLASS64
|
#define ELF_CLASS ELFCLASS64
|
||||||
#define ELF_DATA ELFDATA2MSB
|
#define ELF_DATA ELFDATA2MSB
|
||||||
@@ -224,14 +228,20 @@ enum
|
|||||||
|
|
||||||
static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)
|
static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)
|
||||||
{
|
{
|
||||||
|
#ifndef TARGET_ABI32
|
||||||
regs->tstate = 0;
|
regs->tstate = 0;
|
||||||
|
#endif
|
||||||
regs->pc = infop->entry;
|
regs->pc = infop->entry;
|
||||||
regs->npc = regs->pc + 4;
|
regs->npc = regs->pc + 4;
|
||||||
regs->y = 0;
|
regs->y = 0;
|
||||||
|
#ifdef TARGET_ABI32
|
||||||
|
regs->u_regs[14] = infop->start_stack - 16 * 4;
|
||||||
|
#else
|
||||||
if (personality(infop->personality) == PER_LINUX32)
|
if (personality(infop->personality) == PER_LINUX32)
|
||||||
regs->u_regs[14] = infop->start_stack - 16 * 4;
|
regs->u_regs[14] = infop->start_stack - 16 * 4;
|
||||||
else
|
else
|
||||||
regs->u_regs[14] = infop->start_stack - 16 * 8 - STACK_BIAS;
|
regs->u_regs[14] = infop->start_stack - 16 * 8 - STACK_BIAS;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
@@ -313,10 +323,10 @@ do { \
|
|||||||
|
|
||||||
static inline void init_thread(struct target_pt_regs *_regs, struct image_info *infop)
|
static inline void init_thread(struct target_pt_regs *_regs, struct image_info *infop)
|
||||||
{
|
{
|
||||||
target_ulong pos = infop->start_stack;
|
abi_ulong pos = infop->start_stack;
|
||||||
target_ulong tmp;
|
abi_ulong tmp;
|
||||||
#ifdef TARGET_PPC64
|
#ifdef TARGET_PPC64
|
||||||
target_ulong entry, toc;
|
abi_ulong entry, toc;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
_regs->msr = 1 << MSR_PR; /* Set user mode */
|
_regs->msr = 1 << MSR_PR; /* Set user mode */
|
||||||
@@ -333,9 +343,9 @@ static inline void init_thread(struct target_pt_regs *_regs, struct image_info *
|
|||||||
* execution of PPC BSD programs.
|
* execution of PPC BSD programs.
|
||||||
*/
|
*/
|
||||||
_regs->gpr[3] = tgetl(pos);
|
_regs->gpr[3] = tgetl(pos);
|
||||||
pos += sizeof(target_ulong);
|
pos += sizeof(abi_ulong);
|
||||||
_regs->gpr[4] = pos;
|
_regs->gpr[4] = pos;
|
||||||
for (tmp = 1; tmp != 0; pos += sizeof(target_ulong))
|
for (tmp = 1; tmp != 0; pos += sizeof(abi_ulong))
|
||||||
tmp = ldl(pos);
|
tmp = ldl(pos);
|
||||||
_regs->gpr[5] = pos;
|
_regs->gpr[5] = pos;
|
||||||
}
|
}
|
||||||
@@ -475,9 +485,9 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i
|
|||||||
#define ELF_HWCAP 0
|
#define ELF_HWCAP 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef OVERRIDE_ELF_CLASS
|
#ifdef TARGET_ABI32
|
||||||
#undef ELF_CLASS
|
#undef ELF_CLASS
|
||||||
#define ELF_CLASS OVERRIDE_ELF_CLASS
|
#define ELF_CLASS ELFCLASS32
|
||||||
#undef bswaptls
|
#undef bswaptls
|
||||||
#define bswaptls(ptr) bswap32s(ptr)
|
#define bswaptls(ptr) bswap32s(ptr)
|
||||||
#endif
|
#endif
|
||||||
@@ -588,8 +598,8 @@ static void bswap_sym(struct elf_sym *sym)
|
|||||||
* to be put directly into the top of new user memory.
|
* to be put directly into the top of new user memory.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static target_ulong copy_elf_strings(int argc,char ** argv, void **page,
|
static abi_ulong copy_elf_strings(int argc,char ** argv, void **page,
|
||||||
target_ulong p)
|
abi_ulong p)
|
||||||
{
|
{
|
||||||
char *tmp, *tmp1, *pag = NULL;
|
char *tmp, *tmp1, *pag = NULL;
|
||||||
int len, offset = 0;
|
int len, offset = 0;
|
||||||
@@ -638,10 +648,10 @@ static target_ulong copy_elf_strings(int argc,char ** argv, void **page,
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
static target_ulong setup_arg_pages(target_ulong p, struct linux_binprm *bprm,
|
static abi_ulong setup_arg_pages(abi_ulong p, struct linux_binprm *bprm,
|
||||||
struct image_info *info)
|
struct image_info *info)
|
||||||
{
|
{
|
||||||
target_ulong stack_base, size, error;
|
abi_ulong stack_base, size, error;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Create enough stack to hold everything. If we don't use
|
/* Create enough stack to hold everything. If we don't use
|
||||||
@@ -677,7 +687,7 @@ static target_ulong setup_arg_pages(target_ulong p, struct linux_binprm *bprm,
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_brk(target_ulong start, target_ulong end)
|
static void set_brk(abi_ulong start, abi_ulong end)
|
||||||
{
|
{
|
||||||
/* page-align the start and end addresses... */
|
/* page-align the start and end addresses... */
|
||||||
start = HOST_PAGE_ALIGN(start);
|
start = HOST_PAGE_ALIGN(start);
|
||||||
@@ -696,9 +706,9 @@ static void set_brk(target_ulong start, target_ulong end)
|
|||||||
/* We need to explicitly zero any fractional pages after the data
|
/* We need to explicitly zero any fractional pages after the data
|
||||||
section (i.e. bss). This would contain the junk from the file that
|
section (i.e. bss). This would contain the junk from the file that
|
||||||
should not be in memory. */
|
should not be in memory. */
|
||||||
static void padzero(target_ulong elf_bss, target_ulong last_bss)
|
static void padzero(abi_ulong elf_bss, abi_ulong last_bss)
|
||||||
{
|
{
|
||||||
target_ulong nbyte;
|
abi_ulong nbyte;
|
||||||
|
|
||||||
if (elf_bss >= last_bss)
|
if (elf_bss >= last_bss)
|
||||||
return;
|
return;
|
||||||
@@ -709,7 +719,7 @@ static void padzero(target_ulong elf_bss, target_ulong last_bss)
|
|||||||
patch target_mmap(), but it is more complicated as the file
|
patch target_mmap(), but it is more complicated as the file
|
||||||
size must be known */
|
size must be known */
|
||||||
if (qemu_real_host_page_size < qemu_host_page_size) {
|
if (qemu_real_host_page_size < qemu_host_page_size) {
|
||||||
target_ulong end_addr, end_addr1;
|
abi_ulong end_addr, end_addr1;
|
||||||
end_addr1 = (elf_bss + qemu_real_host_page_size - 1) &
|
end_addr1 = (elf_bss + qemu_real_host_page_size - 1) &
|
||||||
~(qemu_real_host_page_size - 1);
|
~(qemu_real_host_page_size - 1);
|
||||||
end_addr = HOST_PAGE_ALIGN(elf_bss);
|
end_addr = HOST_PAGE_ALIGN(elf_bss);
|
||||||
@@ -731,16 +741,16 @@ static void padzero(target_ulong elf_bss, target_ulong last_bss)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static target_ulong create_elf_tables(target_ulong p, int argc, int envc,
|
static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc,
|
||||||
struct elfhdr * exec,
|
struct elfhdr * exec,
|
||||||
target_ulong load_addr,
|
abi_ulong load_addr,
|
||||||
target_ulong load_bias,
|
abi_ulong load_bias,
|
||||||
target_ulong interp_load_addr, int ibcs,
|
abi_ulong interp_load_addr, int ibcs,
|
||||||
struct image_info *info)
|
struct image_info *info)
|
||||||
{
|
{
|
||||||
target_ulong sp;
|
abi_ulong sp;
|
||||||
int size;
|
int size;
|
||||||
target_ulong u_platform;
|
abi_ulong u_platform;
|
||||||
const char *k_platform;
|
const char *k_platform;
|
||||||
const int n = sizeof(elf_addr_t);
|
const int n = sizeof(elf_addr_t);
|
||||||
|
|
||||||
@@ -756,7 +766,7 @@ static target_ulong create_elf_tables(target_ulong p, int argc, int envc,
|
|||||||
/*
|
/*
|
||||||
* Force 16 byte _final_ alignment here for generality.
|
* Force 16 byte _final_ alignment here for generality.
|
||||||
*/
|
*/
|
||||||
sp = sp &~ (target_ulong)15;
|
sp = sp &~ (abi_ulong)15;
|
||||||
size = (DLINFO_ITEMS + 1) * 2;
|
size = (DLINFO_ITEMS + 1) * 2;
|
||||||
if (k_platform)
|
if (k_platform)
|
||||||
size += 2;
|
size += 2;
|
||||||
@@ -786,18 +796,18 @@ static target_ulong create_elf_tables(target_ulong p, int argc, int envc,
|
|||||||
NEW_AUX_ENT (AT_NULL, 0);
|
NEW_AUX_ENT (AT_NULL, 0);
|
||||||
|
|
||||||
/* There must be exactly DLINFO_ITEMS entries here. */
|
/* There must be exactly DLINFO_ITEMS entries here. */
|
||||||
NEW_AUX_ENT(AT_PHDR, (target_ulong)(load_addr + exec->e_phoff));
|
NEW_AUX_ENT(AT_PHDR, (abi_ulong)(load_addr + exec->e_phoff));
|
||||||
NEW_AUX_ENT(AT_PHENT, (target_ulong)(sizeof (struct elf_phdr)));
|
NEW_AUX_ENT(AT_PHENT, (abi_ulong)(sizeof (struct elf_phdr)));
|
||||||
NEW_AUX_ENT(AT_PHNUM, (target_ulong)(exec->e_phnum));
|
NEW_AUX_ENT(AT_PHNUM, (abi_ulong)(exec->e_phnum));
|
||||||
NEW_AUX_ENT(AT_PAGESZ, (target_ulong)(TARGET_PAGE_SIZE));
|
NEW_AUX_ENT(AT_PAGESZ, (abi_ulong)(TARGET_PAGE_SIZE));
|
||||||
NEW_AUX_ENT(AT_BASE, (target_ulong)(interp_load_addr));
|
NEW_AUX_ENT(AT_BASE, (abi_ulong)(interp_load_addr));
|
||||||
NEW_AUX_ENT(AT_FLAGS, (target_ulong)0);
|
NEW_AUX_ENT(AT_FLAGS, (abi_ulong)0);
|
||||||
NEW_AUX_ENT(AT_ENTRY, load_bias + exec->e_entry);
|
NEW_AUX_ENT(AT_ENTRY, load_bias + exec->e_entry);
|
||||||
NEW_AUX_ENT(AT_UID, (target_ulong) getuid());
|
NEW_AUX_ENT(AT_UID, (abi_ulong) getuid());
|
||||||
NEW_AUX_ENT(AT_EUID, (target_ulong) geteuid());
|
NEW_AUX_ENT(AT_EUID, (abi_ulong) geteuid());
|
||||||
NEW_AUX_ENT(AT_GID, (target_ulong) getgid());
|
NEW_AUX_ENT(AT_GID, (abi_ulong) getgid());
|
||||||
NEW_AUX_ENT(AT_EGID, (target_ulong) getegid());
|
NEW_AUX_ENT(AT_EGID, (abi_ulong) getegid());
|
||||||
NEW_AUX_ENT(AT_HWCAP, (target_ulong) ELF_HWCAP);
|
NEW_AUX_ENT(AT_HWCAP, (abi_ulong) ELF_HWCAP);
|
||||||
if (k_platform)
|
if (k_platform)
|
||||||
NEW_AUX_ENT(AT_PLATFORM, u_platform);
|
NEW_AUX_ENT(AT_PLATFORM, u_platform);
|
||||||
#ifdef ARCH_DLINFO
|
#ifdef ARCH_DLINFO
|
||||||
@@ -814,17 +824,17 @@ static target_ulong create_elf_tables(target_ulong p, int argc, int envc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static target_ulong load_elf_interp(struct elfhdr * interp_elf_ex,
|
static abi_ulong load_elf_interp(struct elfhdr * interp_elf_ex,
|
||||||
int interpreter_fd,
|
int interpreter_fd,
|
||||||
target_ulong *interp_load_addr)
|
abi_ulong *interp_load_addr)
|
||||||
{
|
{
|
||||||
struct elf_phdr *elf_phdata = NULL;
|
struct elf_phdr *elf_phdata = NULL;
|
||||||
struct elf_phdr *eppnt;
|
struct elf_phdr *eppnt;
|
||||||
target_ulong load_addr = 0;
|
abi_ulong load_addr = 0;
|
||||||
int load_addr_set = 0;
|
int load_addr_set = 0;
|
||||||
int retval;
|
int retval;
|
||||||
target_ulong last_bss, elf_bss;
|
abi_ulong last_bss, elf_bss;
|
||||||
target_ulong error;
|
abi_ulong error;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
elf_bss = 0;
|
elf_bss = 0;
|
||||||
@@ -838,20 +848,20 @@ static target_ulong load_elf_interp(struct elfhdr * interp_elf_ex,
|
|||||||
if ((interp_elf_ex->e_type != ET_EXEC &&
|
if ((interp_elf_ex->e_type != ET_EXEC &&
|
||||||
interp_elf_ex->e_type != ET_DYN) ||
|
interp_elf_ex->e_type != ET_DYN) ||
|
||||||
!elf_check_arch(interp_elf_ex->e_machine)) {
|
!elf_check_arch(interp_elf_ex->e_machine)) {
|
||||||
return ~((target_ulong)0UL);
|
return ~((abi_ulong)0UL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Now read in all of the header information */
|
/* Now read in all of the header information */
|
||||||
|
|
||||||
if (sizeof(struct elf_phdr) * interp_elf_ex->e_phnum > TARGET_PAGE_SIZE)
|
if (sizeof(struct elf_phdr) * interp_elf_ex->e_phnum > TARGET_PAGE_SIZE)
|
||||||
return ~(target_ulong)0UL;
|
return ~(abi_ulong)0UL;
|
||||||
|
|
||||||
elf_phdata = (struct elf_phdr *)
|
elf_phdata = (struct elf_phdr *)
|
||||||
malloc(sizeof(struct elf_phdr) * interp_elf_ex->e_phnum);
|
malloc(sizeof(struct elf_phdr) * interp_elf_ex->e_phnum);
|
||||||
|
|
||||||
if (!elf_phdata)
|
if (!elf_phdata)
|
||||||
return ~((target_ulong)0UL);
|
return ~((abi_ulong)0UL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the size of this structure has changed, then punt, since
|
* If the size of this structure has changed, then punt, since
|
||||||
@@ -859,7 +869,7 @@ static target_ulong load_elf_interp(struct elfhdr * interp_elf_ex,
|
|||||||
*/
|
*/
|
||||||
if (interp_elf_ex->e_phentsize != sizeof(struct elf_phdr)) {
|
if (interp_elf_ex->e_phentsize != sizeof(struct elf_phdr)) {
|
||||||
free(elf_phdata);
|
free(elf_phdata);
|
||||||
return ~((target_ulong)0UL);
|
return ~((abi_ulong)0UL);
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = lseek(interpreter_fd, interp_elf_ex->e_phoff, SEEK_SET);
|
retval = lseek(interpreter_fd, interp_elf_ex->e_phoff, SEEK_SET);
|
||||||
@@ -900,8 +910,8 @@ static target_ulong load_elf_interp(struct elfhdr * interp_elf_ex,
|
|||||||
if (eppnt->p_type == PT_LOAD) {
|
if (eppnt->p_type == PT_LOAD) {
|
||||||
int elf_type = MAP_PRIVATE | MAP_DENYWRITE;
|
int elf_type = MAP_PRIVATE | MAP_DENYWRITE;
|
||||||
int elf_prot = 0;
|
int elf_prot = 0;
|
||||||
target_ulong vaddr = 0;
|
abi_ulong vaddr = 0;
|
||||||
target_ulong k;
|
abi_ulong k;
|
||||||
|
|
||||||
if (eppnt->p_flags & PF_R) elf_prot = PROT_READ;
|
if (eppnt->p_flags & PF_R) elf_prot = PROT_READ;
|
||||||
if (eppnt->p_flags & PF_W) elf_prot |= PROT_WRITE;
|
if (eppnt->p_flags & PF_W) elf_prot |= PROT_WRITE;
|
||||||
@@ -921,7 +931,7 @@ static target_ulong load_elf_interp(struct elfhdr * interp_elf_ex,
|
|||||||
/* Real error */
|
/* Real error */
|
||||||
close(interpreter_fd);
|
close(interpreter_fd);
|
||||||
free(elf_phdata);
|
free(elf_phdata);
|
||||||
return ~((target_ulong)0UL);
|
return ~((abi_ulong)0UL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!load_addr_set && interp_elf_ex->e_type == ET_DYN) {
|
if (!load_addr_set && interp_elf_ex->e_type == ET_DYN) {
|
||||||
@@ -966,7 +976,7 @@ static target_ulong load_elf_interp(struct elfhdr * interp_elf_ex,
|
|||||||
free(elf_phdata);
|
free(elf_phdata);
|
||||||
|
|
||||||
*interp_load_addr = load_addr;
|
*interp_load_addr = load_addr;
|
||||||
return ((target_ulong) interp_elf_ex->e_entry) + load_addr;
|
return ((abi_ulong) interp_elf_ex->e_entry) + load_addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Best attempt to load symbols from this ELF object. */
|
/* Best attempt to load symbols from this ELF object. */
|
||||||
@@ -1054,22 +1064,22 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
|
|||||||
struct elfhdr interp_elf_ex;
|
struct elfhdr interp_elf_ex;
|
||||||
struct exec interp_ex;
|
struct exec interp_ex;
|
||||||
int interpreter_fd = -1; /* avoid warning */
|
int interpreter_fd = -1; /* avoid warning */
|
||||||
target_ulong load_addr, load_bias;
|
abi_ulong load_addr, load_bias;
|
||||||
int load_addr_set = 0;
|
int load_addr_set = 0;
|
||||||
unsigned int interpreter_type = INTERPRETER_NONE;
|
unsigned int interpreter_type = INTERPRETER_NONE;
|
||||||
unsigned char ibcs2_interpreter;
|
unsigned char ibcs2_interpreter;
|
||||||
int i;
|
int i;
|
||||||
target_ulong mapped_addr;
|
abi_ulong mapped_addr;
|
||||||
struct elf_phdr * elf_ppnt;
|
struct elf_phdr * elf_ppnt;
|
||||||
struct elf_phdr *elf_phdata;
|
struct elf_phdr *elf_phdata;
|
||||||
target_ulong elf_bss, k, elf_brk;
|
abi_ulong elf_bss, k, elf_brk;
|
||||||
int retval;
|
int retval;
|
||||||
char * elf_interpreter;
|
char * elf_interpreter;
|
||||||
target_ulong elf_entry, interp_load_addr = 0;
|
abi_ulong elf_entry, interp_load_addr = 0;
|
||||||
int status;
|
int status;
|
||||||
target_ulong start_code, end_code, start_data, end_data;
|
abi_ulong start_code, end_code, start_data, end_data;
|
||||||
target_ulong reloc_func_desc = 0;
|
abi_ulong reloc_func_desc = 0;
|
||||||
target_ulong elf_stack;
|
abi_ulong elf_stack;
|
||||||
char passed_fileno[6];
|
char passed_fileno[6];
|
||||||
|
|
||||||
ibcs2_interpreter = 0;
|
ibcs2_interpreter = 0;
|
||||||
@@ -1125,9 +1135,9 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
|
|||||||
elf_brk = 0;
|
elf_brk = 0;
|
||||||
|
|
||||||
|
|
||||||
elf_stack = ~((target_ulong)0UL);
|
elf_stack = ~((abi_ulong)0UL);
|
||||||
elf_interpreter = NULL;
|
elf_interpreter = NULL;
|
||||||
start_code = ~((target_ulong)0UL);
|
start_code = ~((abi_ulong)0UL);
|
||||||
end_code = 0;
|
end_code = 0;
|
||||||
start_data = 0;
|
start_data = 0;
|
||||||
end_data = 0;
|
end_data = 0;
|
||||||
@@ -1263,9 +1273,9 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
|
|||||||
/* OK, This is the point of no return */
|
/* OK, This is the point of no return */
|
||||||
info->end_data = 0;
|
info->end_data = 0;
|
||||||
info->end_code = 0;
|
info->end_code = 0;
|
||||||
info->start_mmap = (target_ulong)ELF_START_MMAP;
|
info->start_mmap = (abi_ulong)ELF_START_MMAP;
|
||||||
info->mmap = 0;
|
info->mmap = 0;
|
||||||
elf_entry = (target_ulong) elf_ex.e_entry;
|
elf_entry = (abi_ulong) elf_ex.e_entry;
|
||||||
|
|
||||||
/* Do this so that we can load the interpreter, if need be. We will
|
/* Do this so that we can load the interpreter, if need be. We will
|
||||||
change some of these later */
|
change some of these later */
|
||||||
@@ -1282,7 +1292,7 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
|
|||||||
for(i = 0, elf_ppnt = elf_phdata; i < elf_ex.e_phnum; i++, elf_ppnt++) {
|
for(i = 0, elf_ppnt = elf_phdata; i < elf_ex.e_phnum; i++, elf_ppnt++) {
|
||||||
int elf_prot = 0;
|
int elf_prot = 0;
|
||||||
int elf_flags = 0;
|
int elf_flags = 0;
|
||||||
target_ulong error;
|
abi_ulong error;
|
||||||
|
|
||||||
if (elf_ppnt->p_type != PT_LOAD)
|
if (elf_ppnt->p_type != PT_LOAD)
|
||||||
continue;
|
continue;
|
||||||
@@ -1374,7 +1384,7 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
|
|||||||
close(interpreter_fd);
|
close(interpreter_fd);
|
||||||
free(elf_interpreter);
|
free(elf_interpreter);
|
||||||
|
|
||||||
if (elf_entry == ~((target_ulong)0UL)) {
|
if (elf_entry == ~((abi_ulong)0UL)) {
|
||||||
printf("Unable to load interpreter\n");
|
printf("Unable to load interpreter\n");
|
||||||
free(elf_phdata);
|
free(elf_phdata);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#define OVERRIDE_ELF_CLASS ELFCLASS32
|
#define TARGET_ABI32
|
||||||
#define load_elf_binary load_elf_binary32
|
#define load_elf_binary load_elf_binary32
|
||||||
#define do_init_thread do_init_thread32
|
#define do_init_thread do_init_thread32
|
||||||
|
|
||||||
|
|||||||
+16
-16
@@ -22,25 +22,25 @@
|
|||||||
|
|
||||||
struct flat_hdr {
|
struct flat_hdr {
|
||||||
char magic[4];
|
char magic[4];
|
||||||
target_ulong rev; /* version (as above) */
|
abi_ulong rev; /* version (as above) */
|
||||||
target_ulong entry; /* Offset of first executable instruction
|
abi_ulong entry; /* Offset of first executable instruction
|
||||||
with text segment from beginning of file */
|
with text segment from beginning of file */
|
||||||
target_ulong data_start; /* Offset of data segment from beginning of
|
abi_ulong data_start; /* Offset of data segment from beginning of
|
||||||
file */
|
file */
|
||||||
target_ulong data_end; /* Offset of end of data segment
|
abi_ulong data_end; /* Offset of end of data segment
|
||||||
from beginning of file */
|
from beginning of file */
|
||||||
target_ulong bss_end; /* Offset of end of bss segment from beginning
|
abi_ulong bss_end; /* Offset of end of bss segment from beginning
|
||||||
of file */
|
of file */
|
||||||
|
|
||||||
/* (It is assumed that data_end through bss_end forms the bss segment.) */
|
/* (It is assumed that data_end through bss_end forms the bss segment.) */
|
||||||
|
|
||||||
target_ulong stack_size; /* Size of stack, in bytes */
|
abi_ulong stack_size; /* Size of stack, in bytes */
|
||||||
target_ulong reloc_start; /* Offset of relocation records from
|
abi_ulong reloc_start; /* Offset of relocation records from
|
||||||
beginning of file */
|
beginning of file */
|
||||||
target_ulong reloc_count; /* Number of relocation records */
|
abi_ulong reloc_count; /* Number of relocation records */
|
||||||
target_ulong flags;
|
abi_ulong flags;
|
||||||
target_ulong build_date; /* When the program/library was built */
|
abi_ulong build_date; /* When the program/library was built */
|
||||||
target_ulong filler[5]; /* Reservered, set to zero */
|
abi_ulong filler[5]; /* Reservered, set to zero */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define FLAT_FLAG_RAM 0x0001 /* load program entirely into RAM */
|
#define FLAT_FLAG_RAM 0x0001 /* load program entirely into RAM */
|
||||||
|
|||||||
+46
-46
@@ -63,13 +63,13 @@
|
|||||||
#define UNLOADED_LIB 0x7ff000ff /* Placeholder for unused library */
|
#define UNLOADED_LIB 0x7ff000ff /* Placeholder for unused library */
|
||||||
|
|
||||||
struct lib_info {
|
struct lib_info {
|
||||||
target_ulong start_code; /* Start of text segment */
|
abi_ulong start_code; /* Start of text segment */
|
||||||
target_ulong start_data; /* Start of data segment */
|
abi_ulong start_data; /* Start of data segment */
|
||||||
target_ulong end_data; /* Start of bss section */
|
abi_ulong end_data; /* Start of bss section */
|
||||||
target_ulong start_brk; /* End of data segment */
|
abi_ulong start_brk; /* End of data segment */
|
||||||
target_ulong text_len; /* Length of text segment */
|
abi_ulong text_len; /* Length of text segment */
|
||||||
target_ulong entry; /* Start address for this module */
|
abi_ulong entry; /* Start address for this module */
|
||||||
target_ulong build_date; /* When this one was compiled */
|
abi_ulong build_date; /* When this one was compiled */
|
||||||
short loaded; /* Has this library been loaded? */
|
short loaded; /* Has this library been loaded? */
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ struct linux_binprm;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Push a block of strings onto the guest stack. */
|
/* Push a block of strings onto the guest stack. */
|
||||||
static target_ulong copy_strings(target_ulong p, int n, char **s)
|
static abi_ulong copy_strings(abi_ulong p, int n, char **s)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
@@ -102,8 +102,8 @@ static target_ulong copy_strings(target_ulong p, int n, char **s)
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
int target_pread(int fd, target_ulong ptr, target_ulong len,
|
int target_pread(int fd, abi_ulong ptr, abi_ulong len,
|
||||||
target_ulong offset)
|
abi_ulong offset)
|
||||||
{
|
{
|
||||||
void *buf;
|
void *buf;
|
||||||
int ret;
|
int ret;
|
||||||
@@ -262,15 +262,15 @@ out:
|
|||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
static target_ulong
|
static abi_ulong
|
||||||
calc_reloc(target_ulong r, struct lib_info *p, int curid, int internalp)
|
calc_reloc(abi_ulong r, struct lib_info *p, int curid, int internalp)
|
||||||
{
|
{
|
||||||
target_ulong addr;
|
abi_ulong addr;
|
||||||
int id;
|
int id;
|
||||||
target_ulong start_brk;
|
abi_ulong start_brk;
|
||||||
target_ulong start_data;
|
abi_ulong start_data;
|
||||||
target_ulong text_len;
|
abi_ulong text_len;
|
||||||
target_ulong start_code;
|
abi_ulong start_code;
|
||||||
|
|
||||||
#ifdef CONFIG_BINFMT_SHARED_FLAT
|
#ifdef CONFIG_BINFMT_SHARED_FLAT
|
||||||
#error needs checking
|
#error needs checking
|
||||||
@@ -381,19 +381,19 @@ void old_reloc(struct lib_info *libinfo, uint32_t rl)
|
|||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
static int load_flat_file(struct linux_binprm * bprm,
|
static int load_flat_file(struct linux_binprm * bprm,
|
||||||
struct lib_info *libinfo, int id, target_ulong *extra_stack)
|
struct lib_info *libinfo, int id, abi_ulong *extra_stack)
|
||||||
{
|
{
|
||||||
struct flat_hdr * hdr;
|
struct flat_hdr * hdr;
|
||||||
target_ulong textpos = 0, datapos = 0, result;
|
abi_ulong textpos = 0, datapos = 0, result;
|
||||||
target_ulong realdatastart = 0;
|
abi_ulong realdatastart = 0;
|
||||||
target_ulong text_len, data_len, bss_len, stack_len, flags;
|
abi_ulong text_len, data_len, bss_len, stack_len, flags;
|
||||||
target_ulong memp = 0; /* for finding the brk area */
|
abi_ulong memp = 0; /* for finding the brk area */
|
||||||
target_ulong extra;
|
abi_ulong extra;
|
||||||
target_ulong reloc = 0, rp;
|
abi_ulong reloc = 0, rp;
|
||||||
int i, rev, relocs = 0;
|
int i, rev, relocs = 0;
|
||||||
target_ulong fpos;
|
abi_ulong fpos;
|
||||||
target_ulong start_code, end_code;
|
abi_ulong start_code, end_code;
|
||||||
target_ulong indx_len;
|
abi_ulong indx_len;
|
||||||
|
|
||||||
hdr = ((struct flat_hdr *) bprm->buf); /* exec-header */
|
hdr = ((struct flat_hdr *) bprm->buf); /* exec-header */
|
||||||
|
|
||||||
@@ -440,14 +440,14 @@ static int load_flat_file(struct linux_binprm * bprm,
|
|||||||
/*
|
/*
|
||||||
* calculate the extra space we need to map in
|
* calculate the extra space we need to map in
|
||||||
*/
|
*/
|
||||||
extra = relocs * sizeof(target_ulong);
|
extra = relocs * sizeof(abi_ulong);
|
||||||
if (extra < bss_len + stack_len)
|
if (extra < bss_len + stack_len)
|
||||||
extra = bss_len + stack_len;
|
extra = bss_len + stack_len;
|
||||||
|
|
||||||
/* Add space for library base pointers. Make sure this does not
|
/* Add space for library base pointers. Make sure this does not
|
||||||
misalign the doesn't misalign the data segment. */
|
misalign the doesn't misalign the data segment. */
|
||||||
indx_len = MAX_SHARED_LIBS * sizeof(target_ulong);
|
indx_len = MAX_SHARED_LIBS * sizeof(abi_ulong);
|
||||||
indx_len = (indx_len + 15) & ~(target_ulong)15;
|
indx_len = (indx_len + 15) & ~(abi_ulong)15;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* there are a couple of cases here, the separate code/data
|
* there are a couple of cases here, the separate code/data
|
||||||
@@ -485,12 +485,12 @@ static int load_flat_file(struct linux_binprm * bprm,
|
|||||||
#ifdef CONFIG_BINFMT_ZFLAT
|
#ifdef CONFIG_BINFMT_ZFLAT
|
||||||
if (flags & FLAT_FLAG_GZDATA) {
|
if (flags & FLAT_FLAG_GZDATA) {
|
||||||
result = decompress_exec(bprm, fpos, (char *) datapos,
|
result = decompress_exec(bprm, fpos, (char *) datapos,
|
||||||
data_len + (relocs * sizeof(target_ulong)))
|
data_len + (relocs * sizeof(abi_ulong)))
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
result = target_pread(bprm->fd, datapos,
|
result = target_pread(bprm->fd, datapos,
|
||||||
data_len + (relocs * sizeof(target_ulong)),
|
data_len + (relocs * sizeof(abi_ulong)),
|
||||||
fpos);
|
fpos);
|
||||||
}
|
}
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
@@ -544,7 +544,7 @@ static int load_flat_file(struct linux_binprm * bprm,
|
|||||||
text_len, 0);
|
text_len, 0);
|
||||||
if (result >= 0) {
|
if (result >= 0) {
|
||||||
result = target_pread(bprm->fd, datapos,
|
result = target_pread(bprm->fd, datapos,
|
||||||
data_len + (relocs * sizeof(target_ulong)),
|
data_len + (relocs * sizeof(abi_ulong)),
|
||||||
ntohl(hdr->data_start));
|
ntohl(hdr->data_start));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -597,7 +597,7 @@ static int load_flat_file(struct linux_binprm * bprm,
|
|||||||
if (flags & FLAT_FLAG_GOTPIC) {
|
if (flags & FLAT_FLAG_GOTPIC) {
|
||||||
rp = datapos;
|
rp = datapos;
|
||||||
while (1) {
|
while (1) {
|
||||||
target_ulong addr;
|
abi_ulong addr;
|
||||||
addr = tgetl(rp);
|
addr = tgetl(rp);
|
||||||
if (addr == -1)
|
if (addr == -1)
|
||||||
break;
|
break;
|
||||||
@@ -607,7 +607,7 @@ static int load_flat_file(struct linux_binprm * bprm,
|
|||||||
return -ENOEXEC;
|
return -ENOEXEC;
|
||||||
tputl(rp, addr);
|
tputl(rp, addr);
|
||||||
}
|
}
|
||||||
rp += sizeof(target_ulong);
|
rp += sizeof(abi_ulong);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -624,12 +624,12 @@ static int load_flat_file(struct linux_binprm * bprm,
|
|||||||
*/
|
*/
|
||||||
if (rev > OLD_FLAT_VERSION) {
|
if (rev > OLD_FLAT_VERSION) {
|
||||||
for (i = 0; i < relocs; i++) {
|
for (i = 0; i < relocs; i++) {
|
||||||
target_ulong addr, relval;
|
abi_ulong addr, relval;
|
||||||
|
|
||||||
/* Get the address of the pointer to be
|
/* Get the address of the pointer to be
|
||||||
relocated (of course, the address has to be
|
relocated (of course, the address has to be
|
||||||
relocated first). */
|
relocated first). */
|
||||||
relval = tgetl(reloc + i * sizeof (target_ulong));
|
relval = tgetl(reloc + i * sizeof (abi_ulong));
|
||||||
addr = flat_get_relocate_addr(relval);
|
addr = flat_get_relocate_addr(relval);
|
||||||
rp = calc_reloc(addr, libinfo, id, 1);
|
rp = calc_reloc(addr, libinfo, id, 1);
|
||||||
if (rp == RELOC_FAILED)
|
if (rp == RELOC_FAILED)
|
||||||
@@ -657,8 +657,8 @@ static int load_flat_file(struct linux_binprm * bprm,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < relocs; i++) {
|
for (i = 0; i < relocs; i++) {
|
||||||
target_ulong relval;
|
abi_ulong relval;
|
||||||
relval = tgetl(reloc + i * sizeof (target_ulong));
|
relval = tgetl(reloc + i * sizeof (abi_ulong));
|
||||||
old_reloc(&libinfo[0], relval);
|
old_reloc(&libinfo[0], relval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -712,10 +712,10 @@ int load_flt_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
|
|||||||
struct image_info * info)
|
struct image_info * info)
|
||||||
{
|
{
|
||||||
struct lib_info libinfo[MAX_SHARED_LIBS];
|
struct lib_info libinfo[MAX_SHARED_LIBS];
|
||||||
target_ulong p = bprm->p;
|
abi_ulong p = bprm->p;
|
||||||
target_ulong stack_len;
|
abi_ulong stack_len;
|
||||||
target_ulong start_addr;
|
abi_ulong start_addr;
|
||||||
target_ulong sp;
|
abi_ulong sp;
|
||||||
int res;
|
int res;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
@@ -740,7 +740,7 @@ int load_flt_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
|
|||||||
/* Update data segment pointers for all libraries */
|
/* Update data segment pointers for all libraries */
|
||||||
for (i=0; i<MAX_SHARED_LIBS; i++) {
|
for (i=0; i<MAX_SHARED_LIBS; i++) {
|
||||||
if (libinfo[i].loaded) {
|
if (libinfo[i].loaded) {
|
||||||
target_ulong p;
|
abi_ulong p;
|
||||||
p = libinfo[i].start_data;
|
p = libinfo[i].start_data;
|
||||||
for (j=0; j<MAX_SHARED_LIBS; j++) {
|
for (j=0; j<MAX_SHARED_LIBS; j++) {
|
||||||
p -= 4;
|
p -= 4;
|
||||||
@@ -758,12 +758,12 @@ int load_flt_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
|
|||||||
p = copy_strings(p, bprm->envc, bprm->envp);
|
p = copy_strings(p, bprm->envc, bprm->envp);
|
||||||
p = copy_strings(p, bprm->argc, bprm->argv);
|
p = copy_strings(p, bprm->argc, bprm->argv);
|
||||||
/* Align stack. */
|
/* Align stack. */
|
||||||
sp = p & ~(target_ulong)(sizeof(target_ulong) - 1);
|
sp = p & ~(abi_ulong)(sizeof(abi_ulong) - 1);
|
||||||
/* Enforce final stack alignment of 16 bytes. This is sufficient
|
/* Enforce final stack alignment of 16 bytes. This is sufficient
|
||||||
for all current targets, and excess alignment is harmless. */
|
for all current targets, and excess alignment is harmless. */
|
||||||
stack_len = bprm->envc + bprm->argc + 2;
|
stack_len = bprm->envc + bprm->argc + 2;
|
||||||
stack_len += 3; /* argc, arvg, argp */
|
stack_len += 3; /* argc, arvg, argp */
|
||||||
stack_len *= sizeof(target_ulong);
|
stack_len *= sizeof(abi_ulong);
|
||||||
if ((sp + stack_len) & 15)
|
if ((sp + stack_len) & 15)
|
||||||
sp -= 16 - ((sp + stack_len) & 15);
|
sp -= 16 - ((sp + stack_len) & 15);
|
||||||
sp = loader_build_argptr(bprm->envc, bprm->argc, sp, p, 1);
|
sp = loader_build_argptr(bprm->envc, bprm->argc, sp, p, 1);
|
||||||
|
|||||||
+24
-24
@@ -31,7 +31,7 @@ struct target_pt_regs {
|
|||||||
|
|
||||||
struct target_modify_ldt_ldt_s {
|
struct target_modify_ldt_ldt_s {
|
||||||
unsigned int entry_number;
|
unsigned int entry_number;
|
||||||
target_ulong base_addr;
|
abi_ulong base_addr;
|
||||||
unsigned int limit;
|
unsigned int limit;
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
};
|
};
|
||||||
@@ -79,22 +79,22 @@ struct target_vm86_regs {
|
|||||||
/*
|
/*
|
||||||
* normal regs, with special meaning for the segment descriptors..
|
* normal regs, with special meaning for the segment descriptors..
|
||||||
*/
|
*/
|
||||||
target_long ebx;
|
abi_long ebx;
|
||||||
target_long ecx;
|
abi_long ecx;
|
||||||
target_long edx;
|
abi_long edx;
|
||||||
target_long esi;
|
abi_long esi;
|
||||||
target_long edi;
|
abi_long edi;
|
||||||
target_long ebp;
|
abi_long ebp;
|
||||||
target_long eax;
|
abi_long eax;
|
||||||
target_long __null_ds;
|
abi_long __null_ds;
|
||||||
target_long __null_es;
|
abi_long __null_es;
|
||||||
target_long __null_fs;
|
abi_long __null_fs;
|
||||||
target_long __null_gs;
|
abi_long __null_gs;
|
||||||
target_long orig_eax;
|
abi_long orig_eax;
|
||||||
target_long eip;
|
abi_long eip;
|
||||||
unsigned short cs, __csh;
|
unsigned short cs, __csh;
|
||||||
target_long eflags;
|
abi_long eflags;
|
||||||
target_long esp;
|
abi_long esp;
|
||||||
unsigned short ss, __ssh;
|
unsigned short ss, __ssh;
|
||||||
/*
|
/*
|
||||||
* these are specific to v86 mode:
|
* these are specific to v86 mode:
|
||||||
@@ -106,14 +106,14 @@ struct target_vm86_regs {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct target_revectored_struct {
|
struct target_revectored_struct {
|
||||||
target_ulong __map[8]; /* 256 bits */
|
abi_ulong __map[8]; /* 256 bits */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct target_vm86_struct {
|
struct target_vm86_struct {
|
||||||
struct target_vm86_regs regs;
|
struct target_vm86_regs regs;
|
||||||
target_ulong flags;
|
abi_ulong flags;
|
||||||
target_ulong screen_bitmap;
|
abi_ulong screen_bitmap;
|
||||||
target_ulong cpu_type;
|
abi_ulong cpu_type;
|
||||||
struct target_revectored_struct int_revectored;
|
struct target_revectored_struct int_revectored;
|
||||||
struct target_revectored_struct int21_revectored;
|
struct target_revectored_struct int21_revectored;
|
||||||
};
|
};
|
||||||
@@ -124,7 +124,7 @@ struct target_vm86_struct {
|
|||||||
#define TARGET_VM86_SCREEN_BITMAP 0x0001
|
#define TARGET_VM86_SCREEN_BITMAP 0x0001
|
||||||
|
|
||||||
struct target_vm86plus_info_struct {
|
struct target_vm86plus_info_struct {
|
||||||
target_ulong flags;
|
abi_ulong flags;
|
||||||
#define TARGET_force_return_for_pic (1 << 0)
|
#define TARGET_force_return_for_pic (1 << 0)
|
||||||
#define TARGET_vm86dbg_active (1 << 1) /* for debugger */
|
#define TARGET_vm86dbg_active (1 << 1) /* for debugger */
|
||||||
#define TARGET_vm86dbg_TFpendig (1 << 2) /* for debugger */
|
#define TARGET_vm86dbg_TFpendig (1 << 2) /* for debugger */
|
||||||
@@ -134,9 +134,9 @@ struct target_vm86plus_info_struct {
|
|||||||
|
|
||||||
struct target_vm86plus_struct {
|
struct target_vm86plus_struct {
|
||||||
struct target_vm86_regs regs;
|
struct target_vm86_regs regs;
|
||||||
target_ulong flags;
|
abi_ulong flags;
|
||||||
target_ulong screen_bitmap;
|
abi_ulong screen_bitmap;
|
||||||
target_ulong cpu_type;
|
abi_ulong cpu_type;
|
||||||
struct target_revectored_struct int_revectored;
|
struct target_revectored_struct int_revectored;
|
||||||
struct target_revectored_struct int21_revectored;
|
struct target_revectored_struct int21_revectored;
|
||||||
struct target_vm86plus_info_struct vm86plus;
|
struct target_vm86plus_info_struct vm86plus;
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
/* this struct defines a stack used during syscall handling */
|
/* this struct defines a stack used during syscall handling */
|
||||||
|
|
||||||
typedef struct target_sigaltstack {
|
typedef struct target_sigaltstack {
|
||||||
target_ulong ss_sp;
|
abi_ulong ss_sp;
|
||||||
target_long ss_flags;
|
abi_long ss_flags;
|
||||||
target_ulong ss_size;
|
abi_ulong ss_size;
|
||||||
} target_stack_t;
|
} target_stack_t;
|
||||||
|
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ typedef struct target_sigaltstack {
|
|||||||
#define TARGET_MINSIGSTKSZ 2048
|
#define TARGET_MINSIGSTKSZ 2048
|
||||||
#define TARGET_SIGSTKSZ 8192
|
#define TARGET_SIGSTKSZ 8192
|
||||||
|
|
||||||
static inline target_ulong get_sp_from_cpustate(CPUX86State *state)
|
static inline abi_ulong get_sp_from_cpustate(CPUX86State *state)
|
||||||
{
|
{
|
||||||
return state->regs[R_ESP];
|
return state->regs[R_ESP];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#define NGROUPS 32
|
#define NGROUPS 32
|
||||||
|
|
||||||
/* ??? This should really be somewhere else. */
|
/* ??? This should really be somewhere else. */
|
||||||
void memcpy_to_target(target_ulong dest, const void *src,
|
void memcpy_to_target(abi_ulong dest, const void *src,
|
||||||
unsigned long len)
|
unsigned long len)
|
||||||
{
|
{
|
||||||
void *host_ptr;
|
void *host_ptr;
|
||||||
@@ -109,12 +109,12 @@ static int prepare_binprm(struct linux_binprm *bprm)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Construct the envp and argv tables on the target stack. */
|
/* Construct the envp and argv tables on the target stack. */
|
||||||
target_ulong loader_build_argptr(int envc, int argc, target_ulong sp,
|
abi_ulong loader_build_argptr(int envc, int argc, abi_ulong sp,
|
||||||
target_ulong stringp, int push_ptr)
|
abi_ulong stringp, int push_ptr)
|
||||||
{
|
{
|
||||||
int n = sizeof(target_ulong);
|
int n = sizeof(abi_ulong);
|
||||||
target_ulong envp;
|
abi_ulong envp;
|
||||||
target_ulong argv;
|
abi_ulong argv;
|
||||||
|
|
||||||
sp -= (envc + 1) * n;
|
sp -= (envc + 1) * n;
|
||||||
envp = sp;
|
envp = sp;
|
||||||
|
|||||||
@@ -3,14 +3,14 @@
|
|||||||
stack during a system call. */
|
stack during a system call. */
|
||||||
|
|
||||||
struct target_pt_regs {
|
struct target_pt_regs {
|
||||||
target_long d1, d2, d3, d4, d5, d6, d7;
|
abi_long d1, d2, d3, d4, d5, d6, d7;
|
||||||
target_long a0, a1, a2, a3, a4, a5, a6;
|
abi_long a0, a1, a2, a3, a4, a5, a6;
|
||||||
target_ulong d0;
|
abi_ulong d0;
|
||||||
target_ulong usp;
|
abi_ulong usp;
|
||||||
target_ulong orig_d0;
|
abi_ulong orig_d0;
|
||||||
int16_t stkadj;
|
int16_t stkadj;
|
||||||
uint16_t sr;
|
uint16_t sr;
|
||||||
target_ulong pc;
|
abi_ulong pc;
|
||||||
uint16_t fntvex;
|
uint16_t fntvex;
|
||||||
uint16_t __fill;
|
uint16_t __fill;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
/* this struct defines a stack used during syscall handling */
|
/* this struct defines a stack used during syscall handling */
|
||||||
|
|
||||||
typedef struct target_sigaltstack {
|
typedef struct target_sigaltstack {
|
||||||
target_ulong ss_sp;
|
abi_ulong ss_sp;
|
||||||
target_long ss_flags;
|
abi_long ss_flags;
|
||||||
target_ulong ss_size;
|
abi_ulong ss_size;
|
||||||
} target_stack_t;
|
} target_stack_t;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+16
-13
@@ -168,7 +168,7 @@ static void set_idt(int n, unsigned int dpl)
|
|||||||
void cpu_loop(CPUX86State *env)
|
void cpu_loop(CPUX86State *env)
|
||||||
{
|
{
|
||||||
int trapnr;
|
int trapnr;
|
||||||
target_ulong pc;
|
abi_ulong pc;
|
||||||
target_siginfo_t info;
|
target_siginfo_t info;
|
||||||
|
|
||||||
for(;;) {
|
for(;;) {
|
||||||
@@ -305,11 +305,11 @@ void cpu_loop(CPUX86State *env)
|
|||||||
#ifdef TARGET_ARM
|
#ifdef TARGET_ARM
|
||||||
|
|
||||||
/* XXX: find a better solution */
|
/* XXX: find a better solution */
|
||||||
extern void tb_invalidate_page_range(target_ulong start, target_ulong end);
|
extern void tb_invalidate_page_range(abi_ulong start, abi_ulong end);
|
||||||
|
|
||||||
static void arm_cache_flush(target_ulong start, target_ulong last)
|
static void arm_cache_flush(abi_ulong start, abi_ulong last)
|
||||||
{
|
{
|
||||||
target_ulong addr, last1;
|
abi_ulong addr, last1;
|
||||||
|
|
||||||
if (last < start)
|
if (last < start)
|
||||||
return;
|
return;
|
||||||
@@ -474,7 +474,7 @@ static inline int get_reg_index(CPUSPARCState *env, int cwp, int index)
|
|||||||
static inline void save_window_offset(CPUSPARCState *env, int cwp1)
|
static inline void save_window_offset(CPUSPARCState *env, int cwp1)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
target_ulong sp_ptr;
|
abi_ulong sp_ptr;
|
||||||
|
|
||||||
sp_ptr = env->regbase[get_reg_index(env, cwp1, 6)];
|
sp_ptr = env->regbase[get_reg_index(env, cwp1, 6)];
|
||||||
#if defined(DEBUG_WIN)
|
#if defined(DEBUG_WIN)
|
||||||
@@ -483,7 +483,7 @@ static inline void save_window_offset(CPUSPARCState *env, int cwp1)
|
|||||||
#endif
|
#endif
|
||||||
for(i = 0; i < 16; i++) {
|
for(i = 0; i < 16; i++) {
|
||||||
tputl(sp_ptr, env->regbase[get_reg_index(env, cwp1, 8 + i)]);
|
tputl(sp_ptr, env->regbase[get_reg_index(env, cwp1, 8 + i)]);
|
||||||
sp_ptr += sizeof(target_ulong);
|
sp_ptr += sizeof(abi_ulong);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -505,7 +505,7 @@ static void save_window(CPUSPARCState *env)
|
|||||||
static void restore_window(CPUSPARCState *env)
|
static void restore_window(CPUSPARCState *env)
|
||||||
{
|
{
|
||||||
unsigned int new_wim, i, cwp1;
|
unsigned int new_wim, i, cwp1;
|
||||||
target_ulong sp_ptr;
|
abi_ulong sp_ptr;
|
||||||
|
|
||||||
new_wim = ((env->wim << 1) | (env->wim >> (NWINDOWS - 1))) &
|
new_wim = ((env->wim << 1) | (env->wim >> (NWINDOWS - 1))) &
|
||||||
((1LL << NWINDOWS) - 1);
|
((1LL << NWINDOWS) - 1);
|
||||||
@@ -519,7 +519,7 @@ static void restore_window(CPUSPARCState *env)
|
|||||||
#endif
|
#endif
|
||||||
for(i = 0; i < 16; i++) {
|
for(i = 0; i < 16; i++) {
|
||||||
env->regbase[get_reg_index(env, cwp1, 8 + i)] = tgetl(sp_ptr);
|
env->regbase[get_reg_index(env, cwp1, 8 + i)] = tgetl(sp_ptr);
|
||||||
sp_ptr += sizeof(target_ulong);
|
sp_ptr += sizeof(abi_ulong);
|
||||||
}
|
}
|
||||||
env->wim = new_wim;
|
env->wim = new_wim;
|
||||||
#ifdef TARGET_SPARC64
|
#ifdef TARGET_SPARC64
|
||||||
@@ -572,14 +572,14 @@ void cpu_loop (CPUSPARCState *env)
|
|||||||
env->regwptr[2], env->regwptr[3],
|
env->regwptr[2], env->regwptr[3],
|
||||||
env->regwptr[4], env->regwptr[5]);
|
env->regwptr[4], env->regwptr[5]);
|
||||||
if ((unsigned int)ret >= (unsigned int)(-515)) {
|
if ((unsigned int)ret >= (unsigned int)(-515)) {
|
||||||
#ifdef TARGET_SPARC64
|
#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32)
|
||||||
env->xcc |= PSR_CARRY;
|
env->xcc |= PSR_CARRY;
|
||||||
#else
|
#else
|
||||||
env->psr |= PSR_CARRY;
|
env->psr |= PSR_CARRY;
|
||||||
#endif
|
#endif
|
||||||
ret = -ret;
|
ret = -ret;
|
||||||
} else {
|
} else {
|
||||||
#ifdef TARGET_SPARC64
|
#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32)
|
||||||
env->xcc &= ~PSR_CARRY;
|
env->xcc &= ~PSR_CARRY;
|
||||||
#else
|
#else
|
||||||
env->psr &= ~PSR_CARRY;
|
env->psr &= ~PSR_CARRY;
|
||||||
@@ -591,6 +591,9 @@ void cpu_loop (CPUSPARCState *env)
|
|||||||
env->npc = env->npc + 4;
|
env->npc = env->npc + 4;
|
||||||
break;
|
break;
|
||||||
case 0x83: /* flush windows */
|
case 0x83: /* flush windows */
|
||||||
|
#ifdef TARGET_ABI32
|
||||||
|
case 0x103:
|
||||||
|
#endif
|
||||||
flush_windows(env);
|
flush_windows(env);
|
||||||
/* next instruction */
|
/* next instruction */
|
||||||
env->pc = env->npc;
|
env->pc = env->npc;
|
||||||
@@ -1489,8 +1492,8 @@ void cpu_loop(CPUMIPSState *env)
|
|||||||
ret = -ENOSYS;
|
ret = -ENOSYS;
|
||||||
} else {
|
} else {
|
||||||
int nb_args;
|
int nb_args;
|
||||||
target_ulong sp_reg;
|
abi_ulong sp_reg;
|
||||||
target_ulong arg5 = 0, arg6 = 0, arg7 = 0, arg8 = 0;
|
abi_ulong arg5 = 0, arg6 = 0, arg7 = 0, arg8 = 0;
|
||||||
|
|
||||||
nb_args = mips_syscall_args[syscall_num];
|
nb_args = mips_syscall_args[syscall_num];
|
||||||
sp_reg = env->gpr[29][env->current_tc];
|
sp_reg = env->gpr[29][env->current_tc];
|
||||||
@@ -2239,7 +2242,7 @@ int main(int argc, char **argv)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for(i = 0; i < 28; i++) {
|
for(i = 0; i < 28; i++) {
|
||||||
env->ir[i] = ((target_ulong *)regs)[i];
|
env->ir[i] = ((abi_ulong *)regs)[i];
|
||||||
}
|
}
|
||||||
env->ipr[IPR_USP] = regs->usp;
|
env->ipr[IPR_USP] = regs->usp;
|
||||||
env->ir[30] = regs->usp;
|
env->ir[30] = regs->usp;
|
||||||
|
|||||||
@@ -4,18 +4,18 @@
|
|||||||
|
|
||||||
struct target_pt_regs {
|
struct target_pt_regs {
|
||||||
/* Pad bytes for argument save space on the stack. */
|
/* Pad bytes for argument save space on the stack. */
|
||||||
target_ulong pad0[6];
|
abi_ulong pad0[6];
|
||||||
|
|
||||||
/* Saved main processor registers. */
|
/* Saved main processor registers. */
|
||||||
target_ulong regs[32];
|
abi_ulong regs[32];
|
||||||
|
|
||||||
/* Saved special registers. */
|
/* Saved special registers. */
|
||||||
target_ulong cp0_status;
|
abi_ulong cp0_status;
|
||||||
target_ulong lo;
|
abi_ulong lo;
|
||||||
target_ulong hi;
|
abi_ulong hi;
|
||||||
target_ulong cp0_badvaddr;
|
abi_ulong cp0_badvaddr;
|
||||||
target_ulong cp0_cause;
|
abi_ulong cp0_cause;
|
||||||
target_ulong cp0_epc;
|
abi_ulong cp0_epc;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Target errno definitions taken from asm-mips/errno.h */
|
/* Target errno definitions taken from asm-mips/errno.h */
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
/* this struct defines a stack used during syscall handling */
|
/* this struct defines a stack used during syscall handling */
|
||||||
|
|
||||||
typedef struct target_sigaltstack {
|
typedef struct target_sigaltstack {
|
||||||
target_long ss_sp;
|
abi_long ss_sp;
|
||||||
target_ulong ss_size;
|
abi_ulong ss_size;
|
||||||
target_long ss_flags;
|
abi_long ss_flags;
|
||||||
} target_stack_t;
|
} target_stack_t;
|
||||||
|
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ typedef struct target_sigaltstack {
|
|||||||
#define TARGET_MINSIGSTKSZ 2048
|
#define TARGET_MINSIGSTKSZ 2048
|
||||||
#define TARGET_SIGSTKSZ 8192
|
#define TARGET_SIGSTKSZ 8192
|
||||||
|
|
||||||
static inline target_ulong get_sp_from_cpustate(CPUMIPSState *state)
|
static inline abi_ulong get_sp_from_cpustate(CPUMIPSState *state)
|
||||||
{
|
{
|
||||||
return state->gpr[29][state->current_tc];
|
return state->gpr[29][state->current_tc];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,15 +4,15 @@
|
|||||||
|
|
||||||
struct target_pt_regs {
|
struct target_pt_regs {
|
||||||
/* Saved main processor registers. */
|
/* Saved main processor registers. */
|
||||||
target_ulong regs[32];
|
abi_ulong regs[32];
|
||||||
|
|
||||||
/* Saved special registers. */
|
/* Saved special registers. */
|
||||||
target_ulong cp0_status;
|
abi_ulong cp0_status;
|
||||||
target_ulong lo;
|
abi_ulong lo;
|
||||||
target_ulong hi;
|
abi_ulong hi;
|
||||||
target_ulong cp0_badvaddr;
|
abi_ulong cp0_badvaddr;
|
||||||
target_ulong cp0_cause;
|
abi_ulong cp0_cause;
|
||||||
target_ulong cp0_epc;
|
abi_ulong cp0_epc;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Target errno definitions taken from asm-mips/errno.h */
|
/* Target errno definitions taken from asm-mips/errno.h */
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user