patch-2.4.0-test2 linux/arch/ia64/ia32/ia32_entry.S
Next file: linux/arch/ia64/ia32/ia32_signal.c
Previous file: linux/arch/ia64/ia32/binfmt_elf32.c
Back to the patch index
Back to the overall index
- Lines: 129
- Date:
Thu Jun 22 07:09:44 2000
- Orig file:
v2.4.0-test1/linux/arch/ia64/ia32/ia32_entry.S
- Orig date:
Wed Apr 26 16:34:06 2000
diff -u --recursive --new-file v2.4.0-test1/linux/arch/ia64/ia32/ia32_entry.S linux/arch/ia64/ia32/ia32_entry.S
@@ -1,14 +1,15 @@
+#include <asm/asmmacro.h>
#include <asm/offsets.h>
#include <asm/signal.h>
+#include "../kernel/entry.h"
+
//
// Get possibly unaligned sigmask argument into an aligned
// kernel buffer
.text
- .proc ia32_rt_sigsuspend
- .global ia32_rt_sigsuspend
-ia32_rt_sigsuspend:
+GLOBAL_ENTRY(ia32_rt_sigsuspend)
// We'll cheat and not do an alloc here since we are ultimately
// going to do a simple branch to the IA64 sys_rt_sigsuspend.
// r32 is still the first argument which is the signal mask.
@@ -32,24 +33,22 @@
st4 [r32]=r2
st4 [r10]=r3
br.cond.sptk.many sys_rt_sigsuspend
+END(ia32_rt_sigsuspend)
.section __ex_table,"a"
data4 @gprel(1b)
data4 (2b-1b)|1
.previous
+GLOBAL_ENTRY(ia32_ret_from_syscall)
+ PT_REGS_UNWIND_INFO(0)
- .endp ia32_rt_sigsuspend
-
- .global ia32_ret_from_syscall
- .proc ia32_ret_from_syscall
-ia32_ret_from_syscall:
cmp.ge p6,p7=r8,r0 // syscall executed successfully?
adds r2=IA64_PT_REGS_R8_OFFSET+16,sp // r2 = &pt_regs.r8
;;
st8 [r2]=r8 // store return value in slot for r8
br.cond.sptk.few ia64_leave_kernel
- .endp ia32_ret_from_syscall
+END(ia32_ret_from_syscall)
//
// Invoke a system call, but do some tracing before and after the call.
@@ -61,9 +60,8 @@
// r15 = syscall number
// b6 = syscall entry point
//
- .global ia32_trace_syscall
- .proc ia32_trace_syscall
-ia32_trace_syscall:
+GLOBAL_ENTRY(ia32_trace_syscall)
+ PT_REGS_UNWIND_INFO(0)
br.call.sptk.few rp=invoke_syscall_trace // give parent a chance to catch syscall args
.Lret4: br.call.sptk.few rp=b6 // do the syscall
.Lret5: cmp.lt p6,p0=r8,r0 // syscall failed?
@@ -72,42 +70,38 @@
st8.spill [r2]=r8 // store return value in slot for r8
br.call.sptk.few rp=invoke_syscall_trace // give parent a chance to catch return value
.Lret6: br.cond.sptk.many ia64_leave_kernel // rp MUST be != ia64_leave_kernel!
+END(ia32_trace_syscall)
- .endp ia32_trace_syscall
-
- .align 16
- .global sys32_vfork
- .proc sys32_vfork
-sys32_vfork:
+GLOBAL_ENTRY(sys32_vfork)
alloc r16=ar.pfs,2,2,3,0;;
mov out0=IA64_CLONE_VFORK|IA64_CLONE_VM|SIGCHLD // out0 = clone_flags
br.cond.sptk.few .fork1 // do the work
- .endp sys32_vfork
+END(sys32_vfork)
- .align 16
- .global sys32_fork
- .proc sys32_fork
-sys32_fork:
- alloc r16=ar.pfs,2,2,3,0;;
+GLOBAL_ENTRY(sys32_fork)
+ UNW(.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(2))
+ alloc r16=ar.pfs,2,2,3,0
mov out0=SIGCHLD // out0 = clone_flags
+ ;;
.fork1:
- movl r28=1f
- mov loc1=rp
- br.cond.sptk.many save_switch_stack
-1:
- mov loc0=r16 // save ar.pfs across do_fork
+ mov loc0=rp
+ mov loc1=r16 // save ar.pfs across do_fork
+ DO_SAVE_SWITCH_STACK
+
+ UNW(.body)
+
adds out2=IA64_SWITCH_STACK_SIZE+16,sp
adds r2=IA64_SWITCH_STACK_SIZE+IA64_PT_REGS_R12_OFFSET+16,sp
;;
ld8 out1=[r2] // fetch usp from pt_regs.r12
br.call.sptk.few rp=do_fork
.ret1:
- mov ar.pfs=loc0
+ mov ar.pfs=loc1
+ UNW(.restore sp)
adds sp=IA64_SWITCH_STACK_SIZE,sp // pop the switch stack
- mov rp=loc1
- ;;
+ mov rp=loc0
br.ret.sptk.many rp
- .endp sys32_fork
+END(sys32_fork)
.rodata
.align 8
@@ -304,3 +298,8 @@
data8 sys_ni_syscall /* streams1 */
data8 sys_ni_syscall /* streams2 */
data8 sys32_vfork /* 190 */
+ /*
+ * CAUTION: If any system calls are added beyond this point
+ * then the check in `arch/ia64/kernel/ivt.S' will have
+ * to be modified also. You've been warned.
+ */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)