diff options
Diffstat (limited to 'arch/ia64/kernel/entry.S')
-rw-r--r-- | arch/ia64/kernel/entry.S | 53 |
1 files changed, 29 insertions, 24 deletions
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S index 1ccbe12a4d84..e25b784a2b72 100644 --- a/arch/ia64/kernel/entry.S +++ b/arch/ia64/kernel/entry.S | |||
@@ -61,14 +61,13 @@ ENTRY(ia64_execve) | |||
61 | * Allocate 8 input registers since ptrace() may clobber them | 61 | * Allocate 8 input registers since ptrace() may clobber them |
62 | */ | 62 | */ |
63 | .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8) | 63 | .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8) |
64 | alloc loc1=ar.pfs,8,2,4,0 | 64 | alloc loc1=ar.pfs,8,2,3,0 |
65 | mov loc0=rp | 65 | mov loc0=rp |
66 | .body | 66 | .body |
67 | mov out0=in0 // filename | 67 | mov out0=in0 // filename |
68 | ;; // stop bit between alloc and call | 68 | ;; // stop bit between alloc and call |
69 | mov out1=in1 // argv | 69 | mov out1=in1 // argv |
70 | mov out2=in2 // envp | 70 | mov out2=in2 // envp |
71 | add out3=16,sp // regs | ||
72 | br.call.sptk.many rp=sys_execve | 71 | br.call.sptk.many rp=sys_execve |
73 | .ret0: | 72 | .ret0: |
74 | cmp4.ge p6,p7=r8,r0 | 73 | cmp4.ge p6,p7=r8,r0 |
@@ -76,7 +75,6 @@ ENTRY(ia64_execve) | |||
76 | sxt4 r8=r8 // return 64-bit result | 75 | sxt4 r8=r8 // return 64-bit result |
77 | ;; | 76 | ;; |
78 | stf.spill [sp]=f0 | 77 | stf.spill [sp]=f0 |
79 | (p6) cmp.ne pKStk,pUStk=r0,r0 // a successful execve() lands us in user-mode... | ||
80 | mov rp=loc0 | 78 | mov rp=loc0 |
81 | (p6) mov ar.pfs=r0 // clear ar.pfs on success | 79 | (p6) mov ar.pfs=r0 // clear ar.pfs on success |
82 | (p7) br.ret.sptk.many rp | 80 | (p7) br.ret.sptk.many rp |
@@ -118,13 +116,12 @@ GLOBAL_ENTRY(sys_clone2) | |||
118 | mov loc1=r16 // save ar.pfs across do_fork | 116 | mov loc1=r16 // save ar.pfs across do_fork |
119 | .body | 117 | .body |
120 | mov out1=in1 | 118 | mov out1=in1 |
121 | mov out3=in2 | 119 | mov out2=in2 |
122 | tbit.nz p6,p0=in0,CLONE_SETTLS_BIT | 120 | tbit.nz p6,p0=in0,CLONE_SETTLS_BIT |
123 | mov out4=in3 // parent_tidptr: valid only w/CLONE_PARENT_SETTID | 121 | mov out3=in3 // parent_tidptr: valid only w/CLONE_PARENT_SETTID |
124 | ;; | 122 | ;; |
125 | (p6) st8 [r2]=in5 // store TLS in r16 for copy_thread() | 123 | (p6) st8 [r2]=in5 // store TLS in r16 for copy_thread() |
126 | mov out5=in4 // child_tidptr: valid only w/CLONE_CHILD_SETTID or CLONE_CHILD_CLEARTID | 124 | mov out4=in4 // child_tidptr: valid only w/CLONE_CHILD_SETTID or CLONE_CHILD_CLEARTID |
127 | adds out2=IA64_SWITCH_STACK_SIZE+16,sp // out2 = ®s | ||
128 | mov out0=in0 // out0 = clone_flags | 125 | mov out0=in0 // out0 = clone_flags |
129 | br.call.sptk.many rp=do_fork | 126 | br.call.sptk.many rp=do_fork |
130 | .ret1: .restore sp | 127 | .ret1: .restore sp |
@@ -150,13 +147,12 @@ GLOBAL_ENTRY(sys_clone) | |||
150 | mov loc1=r16 // save ar.pfs across do_fork | 147 | mov loc1=r16 // save ar.pfs across do_fork |
151 | .body | 148 | .body |
152 | mov out1=in1 | 149 | mov out1=in1 |
153 | mov out3=16 // stacksize (compensates for 16-byte scratch area) | 150 | mov out2=16 // stacksize (compensates for 16-byte scratch area) |
154 | tbit.nz p6,p0=in0,CLONE_SETTLS_BIT | 151 | tbit.nz p6,p0=in0,CLONE_SETTLS_BIT |
155 | mov out4=in2 // parent_tidptr: valid only w/CLONE_PARENT_SETTID | 152 | mov out3=in2 // parent_tidptr: valid only w/CLONE_PARENT_SETTID |
156 | ;; | 153 | ;; |
157 | (p6) st8 [r2]=in4 // store TLS in r13 (tp) | 154 | (p6) st8 [r2]=in4 // store TLS in r13 (tp) |
158 | mov out5=in3 // child_tidptr: valid only w/CLONE_CHILD_SETTID or CLONE_CHILD_CLEARTID | 155 | mov out4=in3 // child_tidptr: valid only w/CLONE_CHILD_SETTID or CLONE_CHILD_CLEARTID |
159 | adds out2=IA64_SWITCH_STACK_SIZE+16,sp // out2 = ®s | ||
160 | mov out0=in0 // out0 = clone_flags | 156 | mov out0=in0 // out0 = clone_flags |
161 | br.call.sptk.many rp=do_fork | 157 | br.call.sptk.many rp=do_fork |
162 | .ret2: .restore sp | 158 | .ret2: .restore sp |
@@ -484,19 +480,6 @@ GLOBAL_ENTRY(prefetch_stack) | |||
484 | br.ret.sptk.many rp | 480 | br.ret.sptk.many rp |
485 | END(prefetch_stack) | 481 | END(prefetch_stack) |
486 | 482 | ||
487 | GLOBAL_ENTRY(kernel_execve) | ||
488 | rum psr.ac | ||
489 | mov r15=__NR_execve // put syscall number in place | ||
490 | break __BREAK_SYSCALL | ||
491 | br.ret.sptk.many rp | ||
492 | END(kernel_execve) | ||
493 | |||
494 | GLOBAL_ENTRY(clone) | ||
495 | mov r15=__NR_clone // put syscall number in place | ||
496 | break __BREAK_SYSCALL | ||
497 | br.ret.sptk.many rp | ||
498 | END(clone) | ||
499 | |||
500 | /* | 483 | /* |
501 | * Invoke a system call, but do some tracing before and after the call. | 484 | * Invoke a system call, but do some tracing before and after the call. |
502 | * We MUST preserve the current register frame throughout this routine | 485 | * We MUST preserve the current register frame throughout this routine |
@@ -600,6 +583,27 @@ GLOBAL_ENTRY(ia64_strace_leave_kernel) | |||
600 | .ret4: br.cond.sptk ia64_leave_kernel | 583 | .ret4: br.cond.sptk ia64_leave_kernel |
601 | END(ia64_strace_leave_kernel) | 584 | END(ia64_strace_leave_kernel) |
602 | 585 | ||
586 | ENTRY(call_payload) | ||
587 | .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(0) | ||
588 | /* call the kernel_thread payload; fn is in r4, arg - in r5 */ | ||
589 | alloc loc1=ar.pfs,0,3,1,0 | ||
590 | mov loc0=rp | ||
591 | mov loc2=gp | ||
592 | mov out0=r5 // arg | ||
593 | ld8 r14 = [r4], 8 // fn.address | ||
594 | ;; | ||
595 | mov b6 = r14 | ||
596 | ld8 gp = [r4] // fn.gp | ||
597 | ;; | ||
598 | br.call.sptk.many rp=b6 // fn(arg) | ||
599 | .ret12: mov gp=loc2 | ||
600 | mov rp=loc0 | ||
601 | mov ar.pfs=loc1 | ||
602 | /* ... and if it has returned, we are going to userland */ | ||
603 | cmp.ne pKStk,pUStk=r0,r0 | ||
604 | br.ret.sptk.many rp | ||
605 | END(call_payload) | ||
606 | |||
603 | GLOBAL_ENTRY(ia64_ret_from_clone) | 607 | GLOBAL_ENTRY(ia64_ret_from_clone) |
604 | PT_REGS_UNWIND_INFO(0) | 608 | PT_REGS_UNWIND_INFO(0) |
605 | { /* | 609 | { /* |
@@ -616,6 +620,7 @@ GLOBAL_ENTRY(ia64_ret_from_clone) | |||
616 | br.call.sptk.many rp=ia64_invoke_schedule_tail | 620 | br.call.sptk.many rp=ia64_invoke_schedule_tail |
617 | } | 621 | } |
618 | .ret8: | 622 | .ret8: |
623 | (pKStk) br.call.sptk.many rp=call_payload | ||
619 | adds r2=TI_FLAGS+IA64_TASK_SIZE,r13 | 624 | adds r2=TI_FLAGS+IA64_TASK_SIZE,r13 |
620 | ;; | 625 | ;; |
621 | ld4 r2=[r2] | 626 | ld4 r2=[r2] |