patch-2.4.15 linux/arch/ia64/ia32/ia32_entry.S

Next file: linux/arch/ia64/ia32/ia32_ioctl.c
Previous file: linux/arch/ia64/ia32/binfmt_elf32.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.14/linux/arch/ia64/ia32/ia32_entry.S linux/arch/ia64/ia32/ia32_entry.S
@@ -2,7 +2,7 @@
 #include <asm/offsets.h>
 #include <asm/signal.h>
 
-#include "../kernel/entry.h"
+#include "../kernel/minstate.h"
 
 	/*
 	 * execve() is special because in case of success, we need to
@@ -14,13 +14,13 @@
 	alloc loc1=ar.pfs,3,2,4,0
 	mov loc0=rp
 	.body
-	mov out0=in0			// filename
+	zxt4 out0=in0			// filename
 	;;				// stop bit between alloc and call
-	mov out1=in1			// argv
-	mov out2=in2			// envp
+	zxt4 out1=in1			// argv
+	zxt4 out2=in2			// envp
 	add out3=16,sp			// regs
 	br.call.sptk.few rp=sys32_execve
-1:	cmp4.ge p6,p0=r8,r0
+1:	cmp.ge p6,p0=r8,r0
 	mov ar.pfs=loc1			// restore ar.pfs
 	;;
 (p6)	mov ar.pfs=r0			// clear ar.pfs in case of success
@@ -29,31 +29,80 @@
 	br.ret.sptk.few rp
 END(ia32_execve)
 
-	//
-	// Get possibly unaligned sigmask argument into an aligned
-	//   kernel buffer
-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.
-	// We copy this 4-byte aligned value to an 8-byte aligned buffer
-	// in the task structure and then jump to the IA64 code.
+ENTRY(ia32_clone)
+	.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(2)
+	alloc r16=ar.pfs,2,2,4,0
+	DO_SAVE_SWITCH_STACK
+	mov loc0=rp
+	mov loc1=r16				// save ar.pfs across do_fork
+	.body
+	zxt4 out1=in1				// newsp
+	mov out3=0				// stacksize
+	adds out2=IA64_SWITCH_STACK_SIZE+16,sp	// out2 = &regs
+	zxt4 out0=in0				// out0 = clone_flags
+	br.call.sptk.many rp=do_fork
+.ret0:	.restore sp
+	adds sp=IA64_SWITCH_STACK_SIZE,sp	// pop the switch stack
+	mov ar.pfs=loc1
+	mov rp=loc0
+	br.ret.sptk.many rp
+END(ia32_clone)
 
-	EX(.Lfail, ld4 r2=[r32],4)		// load low part of sigmask
-	;;
-	EX(.Lfail, ld4 r3=[r32])		// load high part of sigmask
-	adds r32=IA64_TASK_THREAD_SIGMASK_OFFSET,r13
-	;;
-	st8 [r32]=r2
-	adds r10=IA64_TASK_THREAD_SIGMASK_OFFSET+4,r13
+ENTRY(sys32_rt_sigsuspend)
+	.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8)
+	alloc loc1=ar.pfs,8,2,3,0		// preserve all eight input regs
+	mov loc0=rp
+	mov out0=in0				// mask
+	mov out1=in1				// sigsetsize
+	mov out2=sp				// out2 = &sigscratch
+	.fframe 16
+	adds sp=-16,sp				// allocate dummy "sigscratch"
 	;;
+	.body
+	br.call.sptk.many rp=ia32_rt_sigsuspend
+1:	.restore sp
+	adds sp=16,sp
+	mov rp=loc0
+	mov ar.pfs=loc1
+	br.ret.sptk.many rp
+END(sys32_rt_sigsuspend)
 
-	st4 [r10]=r3
-	br.cond.sptk.many sys_rt_sigsuspend
-
-.Lfail:	br.ret.sptk.many rp	// failed to read sigmask
-END(ia32_rt_sigsuspend)
+ENTRY(sys32_sigsuspend)
+	.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8)
+	alloc loc1=ar.pfs,8,2,3,0		// preserve all eight input regs
+	mov loc0=rp
+	mov out0=in2				// mask (first two args are ignored)
+	;;
+	mov out1=sp				// out1 = &sigscratch
+	.fframe 16
+	adds sp=-16,sp				// allocate dummy "sigscratch"
+	.body
+	br.call.sptk.many rp=ia32_sigsuspend
+1:	.restore sp
+	adds sp=16,sp
+	mov rp=loc0
+	mov ar.pfs=loc1
+	br.ret.sptk.many rp
+END(sys32_sigsuspend)
 
+GLOBAL_ENTRY(ia32_ret_from_clone)
+	PT_REGS_UNWIND_INFO(0)
+	/*
+	 * We need to call schedule_tail() to complete the scheduling process.
+	 * Called by ia64_switch_to after do_fork()->copy_thread().  r8 contains the
+	 * address of the previously executing task.
+	 */
+	br.call.sptk.many rp=ia64_invoke_schedule_tail
+.ret1:	adds r2=IA64_TASK_PTRACE_OFFSET,r13
+	;;
+	ld8 r2=[r2]
+	;;
+	mov r8=0
+	tbit.nz p6,p0=r2,PT_TRACESYS_BIT
+(p6)	br.cond.spnt .ia32_strace_check_retval
+	;;					// prevent RAW on r8
+END(ia32_ret_from_clone)
+	// fall thrugh
 GLOBAL_ENTRY(ia32_ret_from_syscall)
 	PT_REGS_UNWIND_INFO(0)
 
@@ -72,20 +121,25 @@
 	// manipulate ar.pfs.
 	//
 	// Input:
-	//	r15 = syscall number
-	//	b6  = syscall entry point
+	//	r8 = syscall number
+	//	b6 = syscall entry point
 	//
 GLOBAL_ENTRY(ia32_trace_syscall)
 	PT_REGS_UNWIND_INFO(0)
+	mov r3=-38
+	adds r2=IA64_PT_REGS_R8_OFFSET+16,sp
+	;;
+	st8 [r2]=r3				// initialize return code to -ENOSYS
 	br.call.sptk.few rp=invoke_syscall_trace // give parent a chance to catch syscall args
-.ret0:	br.call.sptk.few rp=b6			// do the syscall
-.ret1:	cmp.lt p6,p0=r8,r0			// syscall failed?
+.ret2:	br.call.sptk.few rp=b6			// do the syscall
+.ia32_strace_check_retval:
+	cmp.lt p6,p0=r8,r0			// syscall failed?
 	adds r2=IA64_PT_REGS_R8_OFFSET+16,sp	// r2 = &pt_regs.r8
 	;;
 	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
-.ret2:	alloc r2=ar.pfs,0,0,0,0			// drop the syscall argument frame
-	br.cond.sptk.many ia64_leave_kernel	// rp MUST be != ia64_leave_kernel!
+.ret4:	alloc r2=ar.pfs,0,0,0,0			// drop the syscall argument frame
+	br.cond.sptk.many ia64_leave_kernel
 END(ia32_trace_syscall)
 
 GLOBAL_ENTRY(sys32_vfork)
@@ -110,7 +164,7 @@
 	mov out3=0
 	adds out2=IA64_SWITCH_STACK_SIZE+16,sp	// out2 = &regs
 	br.call.sptk.few rp=do_fork
-.ret3:	mov ar.pfs=loc1
+.ret5:	mov ar.pfs=loc1
 	.restore sp
 	adds sp=IA64_SWITCH_STACK_SIZE,sp	// pop the switch stack
 	mov rp=loc0
@@ -137,21 +191,21 @@
 	data8 sys32_time
 	data8 sys_mknod
 	data8 sys_chmod		  /* 15 */
-	data8 sys_lchown
+	data8 sys_lchown	/* 16-bit version */
 	data8 sys32_ni_syscall	  /* old break syscall holder */
 	data8 sys32_ni_syscall
 	data8 sys32_lseek
 	data8 sys_getpid	  /* 20 */
 	data8 sys_mount
 	data8 sys_oldumount
-	data8 sys_setuid
-	data8 sys_getuid
+	data8 sys_setuid	/* 16-bit version */
+	data8 sys_getuid	/* 16-bit version */
 	data8 sys32_ni_syscall /* sys_stime is not supported on IA64 */  /* 25 */
 	data8 sys32_ptrace
 	data8 sys32_alarm
 	data8 sys32_ni_syscall
-	data8 sys_pause
-	data8 ia32_utime	  /* 30 */
+	data8 sys32_pause
+	data8 sys32_utime	  /* 30 */
 	data8 sys32_ni_syscall	  /* old stty syscall holder */
 	data8 sys32_ni_syscall	  /* old gtty syscall holder */
 	data8 sys_access
@@ -167,15 +221,15 @@
 	data8 sys32_times
 	data8 sys32_ni_syscall	  /* old prof syscall holder */
 	data8 sys_brk		  /* 45 */
-	data8 sys_setgid
-	data8 sys_getgid
+	data8 sys_setgid	/* 16-bit version */
+	data8 sys_getgid	/* 16-bit version */
 	data8 sys32_signal
-	data8 sys_geteuid
-	data8 sys_getegid	  /* 50 */
+	data8 sys_geteuid	/* 16-bit version */
+	data8 sys_getegid	/* 16-bit version */	  /* 50 */
 	data8 sys_acct
 	data8 sys_umount	  /* recycled never used phys( */
 	data8 sys32_ni_syscall	  /* old lock syscall holder */
-	data8 ia32_ioctl
+	data8 sys32_ioctl
 	data8 sys32_fcntl	  /* 55 */
 	data8 sys32_ni_syscall	  /* old mpx syscall holder */
 	data8 sys_setpgid
@@ -191,19 +245,19 @@
 	data8 sys32_sigaction
 	data8 sys32_ni_syscall
 	data8 sys32_ni_syscall
-	data8 sys_setreuid	  /* 70 */
-	data8 sys_setregid
-	data8 sys32_ni_syscall
-	data8 sys_sigpending
+	data8 sys_setreuid	/* 16-bit version */	  /* 70 */
+	data8 sys_setregid	/* 16-bit version */
+	data8 sys32_sigsuspend
+	data8 sys32_sigpending
 	data8 sys_sethostname
 	data8 sys32_setrlimit	  /* 75 */
-	data8 sys32_getrlimit
+	data8 sys32_old_getrlimit
 	data8 sys32_getrusage
 	data8 sys32_gettimeofday
 	data8 sys32_settimeofday
-	data8 sys_getgroups	  /* 80 */
-	data8 sys_setgroups
-	data8 old_select
+	data8 sys32_getgroups16	  /* 80 */
+	data8 sys32_setgroups16
+	data8 sys32_old_select
 	data8 sys_symlink
 	data8 sys32_ni_syscall
 	data8 sys_readlink	  /* 85 */
@@ -212,17 +266,17 @@
 	data8 sys_reboot
 	data8 sys32_readdir
 	data8 sys32_mmap	  /* 90 */
-	data8 sys_munmap
+	data8 sys32_munmap
 	data8 sys_truncate
 	data8 sys_ftruncate
 	data8 sys_fchmod
-	data8 sys_fchown	  /* 95 */
+	data8 sys_fchown	/* 16-bit version */	  /* 95 */
 	data8 sys_getpriority
 	data8 sys_setpriority
 	data8 sys32_ni_syscall	  /* old profil syscall holder */
 	data8 sys32_statfs
 	data8 sys32_fstatfs	  /* 100 */
-	data8 sys_ioperm
+	data8 sys32_ioperm
 	data8 sys32_socketcall
 	data8 sys_syslog
 	data8 sys32_setitimer
@@ -231,36 +285,36 @@
 	data8 sys32_newlstat
 	data8 sys32_newfstat
 	data8 sys32_ni_syscall
-	data8 sys_iopl		  /* 110 */
+	data8 sys32_iopl		  /* 110 */
 	data8 sys_vhangup
 	data8 sys32_ni_syscall		/* used to be sys_idle */
 	data8 sys32_ni_syscall
 	data8 sys32_wait4
 	data8 sys_swapoff	  /* 115 */
-	data8 sys_sysinfo
+	data8 sys32_sysinfo
 	data8 sys32_ipc
 	data8 sys_fsync
 	data8 sys32_sigreturn
-	data8 sys_clone		  /* 120 */
+	data8 ia32_clone	  /* 120 */
 	data8 sys_setdomainname
 	data8 sys32_newuname
 	data8 sys32_modify_ldt
-	data8 sys_adjtimex
+	data8 sys32_ni_syscall	/* adjtimex */
 	data8 sys32_mprotect	  /* 125 */
-	data8 sys_sigprocmask
-	data8 sys_create_module
-	data8 sys_init_module
-	data8 sys_delete_module
-	data8 sys_get_kernel_syms  /* 130 */
-	data8 sys_quotactl
+	data8 sys32_sigprocmask
+	data8 sys32_ni_syscall	/* create_module */
+	data8 sys32_ni_syscall	/* init_module */
+	data8 sys32_ni_syscall	/* delete_module */
+	data8 sys32_ni_syscall	/* get_kernel_syms */  /* 130 */
+	data8 sys32_quotactl
 	data8 sys_getpgid
 	data8 sys_fchdir
-	data8 sys_bdflush
-	data8 sys_sysfs		  /* 135 */
-	data8 sys_personality
+	data8 sys32_ni_syscall	/* sys_bdflush */
+	data8 sys_sysfs		/* 135 */
+	data8 sys32_personality
 	data8 sys32_ni_syscall	  /* for afs_syscall */
-	data8 sys_setfsuid
-	data8 sys_setfsgid
+	data8 sys_setfsuid	/* 16-bit version */
+	data8 sys_setfsgid	/* 16-bit version */
 	data8 sys_llseek	  /* 140 */
 	data8 sys32_getdents
 	data8 sys32_select
@@ -282,66 +336,73 @@
 	data8 sys_sched_yield
 	data8 sys_sched_get_priority_max
 	data8 sys_sched_get_priority_min	 /* 160 */
-	data8 sys_sched_rr_get_interval
+	data8 sys32_sched_rr_get_interval
 	data8 sys32_nanosleep
 	data8 sys_mremap
-	data8 sys_setresuid
-	data8 sys32_getresuid	  /* 165 */
-	data8 sys_vm86
-	data8 sys_query_module
+	data8 sys_setresuid	/* 16-bit version */
+	data8 sys32_getresuid16	/* 16-bit version */	  /* 165 */
+	data8 sys32_ni_syscall	/* vm86 */
+	data8 sys32_ni_syscall	/* sys_query_module */
 	data8 sys_poll
-	data8 sys_nfsservctl
+	data8 sys32_ni_syscall	/* nfsservctl */
 	data8 sys_setresgid	  /* 170 */
-	data8 sys32_getresgid
+	data8 sys32_getresgid16
 	data8 sys_prctl
 	data8 sys32_rt_sigreturn
 	data8 sys32_rt_sigaction
 	data8 sys32_rt_sigprocmask /* 175 */
 	data8 sys_rt_sigpending
-	data8 sys_rt_sigtimedwait
-	data8 sys_rt_sigqueueinfo
-	data8 ia32_rt_sigsuspend
-	data8 sys_pread		  /* 180 */
-	data8 sys_pwrite
-	data8 sys_chown
+	data8 sys32_rt_sigtimedwait
+	data8 sys32_rt_sigqueueinfo
+	data8 sys32_rt_sigsuspend
+	data8 sys32_pread	  /* 180 */
+	data8 sys32_pwrite
+	data8 sys_chown	/* 16-bit version */
 	data8 sys_getcwd
 	data8 sys_capget
 	data8 sys_capset	  /* 185 */
 	data8 sys32_sigaltstack
-	data8 sys_sendfile
+	data8 sys32_sendfile
 	data8 sys32_ni_syscall		  /* streams1 */
 	data8 sys32_ni_syscall		  /* streams2 */
 	data8 sys32_vfork	  /* 190 */
+	data8 sys32_getrlimit
+	data8 sys32_mmap2
+	data8 sys32_truncate64
+	data8 sys32_ftruncate64
+	data8 sys32_stat64	  /* 195 */
+	data8 sys32_lstat64
+	data8 sys32_fstat64
+	data8 sys_lchown
+	data8 sys_getuid
+	data8 sys_getgid	  /* 200 */
+	data8 sys_geteuid
+	data8 sys_getegid
+	data8 sys_setreuid
+	data8 sys_setregid
+	data8 sys_getgroups	  /* 205 */
+	data8 sys_setgroups
+	data8 sys_fchown
+	data8 sys_setresuid
+	data8 sys_getresuid
+	data8 sys_setresgid	  /* 210 */
+	data8 sys_getresgid
+	data8 sys_chown
+	data8 sys_setuid
+	data8 sys_setgid
+	data8 sys_setfsuid	  /* 215 */
+	data8 sys_setfsgid
+	data8 sys_pivot_root
+	data8 sys_mincore
+	data8 sys_madvise
+	data8 sys_getdents64	  /* 220 */
+	data8 sys32_fcntl64
+	data8 sys_ni_syscall		/* reserved for TUX */
+	data8 sys_ni_syscall		/* reserved for Security */
+	data8 sys_gettid
+	data8 sys_readahead	  /* 225 */
 	data8 sys_ni_syscall
 	data8 sys_ni_syscall
-	data8 sys_ni_syscall
-	data8 sys_ni_syscall
-	data8 sys_ni_syscall	  /* 195 */
-	data8 sys_ni_syscall
-	data8 sys_ni_syscall
-	data8 sys_ni_syscall
-	data8 sys_ni_syscall
-	data8 sys_ni_syscall	  /* 200 */
-	data8 sys_ni_syscall
-	data8 sys_ni_syscall
-	data8 sys_ni_syscall
-	data8 sys_ni_syscall
-	data8 sys_ni_syscall	  /* 205 */
-	data8 sys_ni_syscall
-	data8 sys_ni_syscall
-	data8 sys_ni_syscall
-	data8 sys_ni_syscall
-	data8 sys_ni_syscall	  /* 210 */
-	data8 sys_ni_syscall
-	data8 sys_ni_syscall
-	data8 sys_ni_syscall
-	data8 sys_ni_syscall
-	data8 sys_ni_syscall	  /* 215 */
-	data8 sys_ni_syscall
-	data8 sys_ni_syscall
-	data8 sys_ni_syscall
-	data8 sys_ni_syscall
-	data8 sys_ni_syscall	  /* 220 */
 	data8 sys_ni_syscall
 	data8 sys_ni_syscall
 	/*

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)