Commit fd4a43e4e28a594a20beefe78b0fe7ecd34bd981

Authored by bellard
1 parent ad1a5b78

ia64 fixes


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1846 c046a42c-6fe2-441c-8c8c-71466251a162
Makefile.target
@@ -252,9 +252,6 @@ ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k) @@ -252,9 +252,6 @@ ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k)
252 LIBOBJS+=m68k-dis.o 252 LIBOBJS+=m68k-dis.o
253 endif 253 endif
254 254
255 -ifeq ($(ARCH),ia64)  
256 -OBJS += ia64-syscall.o  
257 -endif  
258 ifdef CONFIG_GDBSTUB 255 ifdef CONFIG_GDBSTUB
259 OBJS+=gdbstub.o 256 OBJS+=gdbstub.o
260 endif 257 endif
cpu-exec.c
@@ -1363,7 +1363,6 @@ int cpu_signal_handler(int host_signum, struct siginfo *info, @@ -1363,7 +1363,6 @@ int cpu_signal_handler(int host_signum, struct siginfo *info,
1363 #ifndef __ISR_VALID 1363 #ifndef __ISR_VALID
1364 /* This ought to be in <bits/siginfo.h>... */ 1364 /* This ought to be in <bits/siginfo.h>... */
1365 # define __ISR_VALID 1 1365 # define __ISR_VALID 1
1366 -# define si_flags _sifields._sigfault._si_pad0  
1367 #endif 1366 #endif
1368 1367
1369 int cpu_signal_handler(int host_signum, struct siginfo *info, void *puc) 1368 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) @@ -1379,7 +1378,7 @@ int cpu_signal_handler(int host_signum, struct siginfo *info, void *puc)
1379 case SIGSEGV: 1378 case SIGSEGV:
1380 case SIGBUS: 1379 case SIGBUS:
1381 case SIGTRAP: 1380 case SIGTRAP:
1382 - if (info->si_code && (info->si_flags & __ISR_VALID)) 1381 + if (info->si_code && (info->si_segvflags & __ISR_VALID))
1383 /* ISR.W (write-access) is bit 33: */ 1382 /* ISR.W (write-access) is bit 33: */
1384 is_write = (info->si_isr >> 33) & 1; 1383 is_write = (info->si_isr >> 33) & 1;
1385 break; 1384 break;
dyngen.c
@@ -2475,10 +2475,12 @@ fprintf(outfile, @@ -2475,10 +2475,12 @@ fprintf(outfile,
2475 ); 2475 );
2476 #ifdef HOST_IA64 2476 #ifdef HOST_IA64
2477 fprintf(outfile, 2477 fprintf(outfile,
2478 - " ia64_apply_fixes(&gen_code_ptr, ltoff_fixes, " 2478 + " {\n"
  2479 + " extern char code_gen_buffer[];\n"
  2480 + " ia64_apply_fixes(&gen_code_ptr, ltoff_fixes, "
2479 "(uint64_t) code_gen_buffer + 2*(1<<20), plt_fixes,\n\t\t\t" 2481 "(uint64_t) code_gen_buffer + 2*(1<<20), plt_fixes,\n\t\t\t"
2480 "sizeof(plt_target)/sizeof(plt_target[0]),\n\t\t\t" 2482 "sizeof(plt_target)/sizeof(plt_target[0]),\n\t\t\t"
2481 - "plt_target, plt_offset);\n"); 2483 + "plt_target, plt_offset);\n }\n");
2482 #endif 2484 #endif
2483 2485
2484 /* generate some code patching */ 2486 /* generate some code patching */
dyngen.h
@@ -420,6 +420,9 @@ static inline void ia64_apply_fixes (uint8_t **gen_code_pp, @@ -420,6 +420,9 @@ static inline void ia64_apply_fixes (uint8_t **gen_code_pp,
420 } 420 }
421 ia64_imm22(fixup->addr, (long) vp - gp); 421 ia64_imm22(fixup->addr, (long) vp - gp);
422 } 422 }
  423 + /* Keep code ptr aligned. */
  424 + if ((long) gen_code_ptr & 15)
  425 + gen_code_ptr += 8;
423 *gen_code_pp = gen_code_ptr; 426 *gen_code_pp = gen_code_ptr;
424 } 427 }
425 428
ia64-syscall.S deleted 100644 → 0
1 -/* derived from glibc sysdeps/unix/sysv/linux/ia64/sysdep.S */  
2 -  
3 -#define __ASSEMBLY__  
4 -  
5 -#include <asm/asmmacro.h>  
6 -#include <asm/unistd.h>  
7 -  
8 -ENTRY(__syscall_error)  
9 - .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(0)  
10 - alloc r33=ar.pfs, 0, 4, 0, 0  
11 - mov r32=rp  
12 - .body  
13 - mov r35=r8  
14 - mov r34=r1  
15 - ;;  
16 - br.call.sptk.many b0 = __errno_location  
17 -.Lret0: /* force new bundle */  
18 - st4 [r8]=r35  
19 - mov r1=r34  
20 - mov rp=r32  
21 - mov r8=-1  
22 - mov ar.pfs=r33  
23 - br.ret.sptk.few b0  
24 -END(__syscall_error)  
25 -  
26 -GLOBAL_ENTRY(__ia64_syscall)  
27 - mov r15=r37 /* syscall number */  
28 - break __BREAK_SYSCALL  
29 - cmp.eq p6,p0=-1,r10 /* r10 = -1 on error */  
30 -(p6) br.cond.spnt.few __syscall_error  
31 - br.ret.sptk.few b0  
32 -.endp __ia64_syscall  
linux-user/syscall.c
@@ -1623,7 +1623,7 @@ int do_fork(CPUState *env, unsigned int flags, unsigned long newsp) @@ -1623,7 +1623,7 @@ int do_fork(CPUState *env, unsigned int flags, unsigned long newsp)
1623 #endif 1623 #endif
1624 new_env->opaque = ts; 1624 new_env->opaque = ts;
1625 #ifdef __ia64__ 1625 #ifdef __ia64__
1626 - ret = clone2(clone_func, new_stack + NEW_STACK_SIZE, flags, new_env); 1626 + ret = __clone2(clone_func, new_stack + NEW_STACK_SIZE, flags, new_env);
1627 #else 1627 #else
1628 ret = clone(clone_func, new_stack + NEW_STACK_SIZE, flags, new_env); 1628 ret = clone(clone_func, new_stack + NEW_STACK_SIZE, flags, new_env);
1629 #endif 1629 #endif