ia64 fixes
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>
Mon, 24 Apr 2006 20:32:17 +0000 (20:32 +0000)
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>
Mon, 24 Apr 2006 20:32:17 +0000 (20:32 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1846 c046a42c-6fe2-441c-8c8c-71466251a162

Makefile.target
cpu-exec.c
dyngen.c
dyngen.h
ia64-syscall.S [deleted file]
linux-user/syscall.c

index 9b5ebcd..20fb8f0 100644 (file)
@@ -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
index 872f51f..ca46953 100644 (file)
@@ -1363,7 +1363,6 @@ int cpu_signal_handler(int host_signum, struct siginfo *info,
 #ifndef __ISR_VALID
   /* This ought to be in <bits/siginfo.h>... */
 # 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;
index fc4722e..c1f348a 100644 (file)
--- 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 */ 
index 76866d4..5bb170e 100644 (file)
--- 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 (file)
index ab073f2..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/* derived from glibc sysdeps/unix/sysv/linux/ia64/sysdep.S */
-       
-#define __ASSEMBLY__
-       
-#include <asm/asmmacro.h>
-#include <asm/unistd.h>
-
-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
index 516b32b..c3b22ce 100644 (file)
@@ -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