From fd4a43e4e28a594a20beefe78b0fe7ecd34bd981 Mon Sep 17 00:00:00 2001 From: bellard Date: Mon, 24 Apr 2006 20:32:17 +0000 Subject: [PATCH] ia64 fixes git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1846 c046a42c-6fe2-441c-8c8c-71466251a162 --- Makefile.target | 3 --- cpu-exec.c | 3 +-- dyngen.c | 6 ++++-- dyngen.h | 3 +++ ia64-syscall.S | 32 -------------------------------- linux-user/syscall.c | 2 +- 6 files changed, 9 insertions(+), 40 deletions(-) delete mode 100644 ia64-syscall.S diff --git a/Makefile.target b/Makefile.target index 9b5ebcde02..20fb8f0d13 100644 --- a/Makefile.target +++ b/Makefile.target @@ -252,9 +252,6 @@ ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k) LIBOBJS+=m68k-dis.o endif -ifeq ($(ARCH),ia64) -OBJS += ia64-syscall.o -endif ifdef CONFIG_GDBSTUB OBJS+=gdbstub.o endif diff --git a/cpu-exec.c b/cpu-exec.c index 872f51f62c..ca4695343e 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -1363,7 +1363,6 @@ int cpu_signal_handler(int host_signum, struct siginfo *info, #ifndef __ISR_VALID /* This ought to be in ... */ # define __ISR_VALID 1 -# define si_flags _sifields._sigfault._si_pad0 #endif int cpu_signal_handler(int host_signum, struct siginfo *info, void *puc) @@ -1379,7 +1378,7 @@ int cpu_signal_handler(int host_signum, struct siginfo *info, void *puc) case SIGSEGV: case SIGBUS: case SIGTRAP: - if (info->si_code && (info->si_flags & __ISR_VALID)) + if (info->si_code && (info->si_segvflags & __ISR_VALID)) /* ISR.W (write-access) is bit 33: */ is_write = (info->si_isr >> 33) & 1; break; diff --git a/dyngen.c b/dyngen.c index fc4722ef9c..c1f348a94f 100644 --- a/dyngen.c +++ b/dyngen.c @@ -2475,10 +2475,12 @@ fprintf(outfile, ); #ifdef HOST_IA64 fprintf(outfile, - " ia64_apply_fixes(&gen_code_ptr, ltoff_fixes, " + " {\n" + " extern char code_gen_buffer[];\n" + " ia64_apply_fixes(&gen_code_ptr, ltoff_fixes, " "(uint64_t) code_gen_buffer + 2*(1<<20), plt_fixes,\n\t\t\t" "sizeof(plt_target)/sizeof(plt_target[0]),\n\t\t\t" - "plt_target, plt_offset);\n"); + "plt_target, plt_offset);\n }\n"); #endif /* generate some code patching */ diff --git a/dyngen.h b/dyngen.h index 76866d4a19..5bb170e94d 100644 --- a/dyngen.h +++ b/dyngen.h @@ -420,6 +420,9 @@ static inline void ia64_apply_fixes (uint8_t **gen_code_pp, } ia64_imm22(fixup->addr, (long) vp - gp); } + /* Keep code ptr aligned. */ + if ((long) gen_code_ptr & 15) + gen_code_ptr += 8; *gen_code_pp = gen_code_ptr; } diff --git a/ia64-syscall.S b/ia64-syscall.S deleted file mode 100644 index ab073f22b9..0000000000 --- a/ia64-syscall.S +++ /dev/null @@ -1,32 +0,0 @@ -/* derived from glibc sysdeps/unix/sysv/linux/ia64/sysdep.S */ - -#define __ASSEMBLY__ - -#include -#include - -ENTRY(__syscall_error) - .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(0) - alloc r33=ar.pfs, 0, 4, 0, 0 - mov r32=rp - .body - mov r35=r8 - mov r34=r1 - ;; - br.call.sptk.many b0 = __errno_location -.Lret0: /* force new bundle */ - st4 [r8]=r35 - mov r1=r34 - mov rp=r32 - mov r8=-1 - mov ar.pfs=r33 - br.ret.sptk.few b0 -END(__syscall_error) - -GLOBAL_ENTRY(__ia64_syscall) - mov r15=r37 /* syscall number */ - break __BREAK_SYSCALL - cmp.eq p6,p0=-1,r10 /* r10 = -1 on error */ -(p6) br.cond.spnt.few __syscall_error - br.ret.sptk.few b0 -.endp __ia64_syscall diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 516b32bf92..c3b22ce721 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1623,7 +1623,7 @@ int do_fork(CPUState *env, unsigned int flags, unsigned long newsp) #endif new_env->opaque = ts; #ifdef __ia64__ - ret = clone2(clone_func, new_stack + NEW_STACK_SIZE, flags, new_env); + ret = __clone2(clone_func, new_stack + NEW_STACK_SIZE, flags, new_env); #else ret = clone(clone_func, new_stack + NEW_STACK_SIZE, flags, new_env); #endif