about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/mips/clone.S
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2003-03-17 15:47:13 +0000
committerAlexandre Oliva <aoliva@redhat.com>2003-03-17 15:47:13 +0000
commit4947b4b20f49324647a7cbcd2596b1f5b4639748 (patch)
tree0447ee1cce55994f03a92ba7413268c51be85d11 /sysdeps/unix/sysv/linux/mips/clone.S
parentde4471dd559ab27a8927135fb5a475eaa613c437 (diff)
downloadglibc-4947b4b20f49324647a7cbcd2596b1f5b4639748.tar.gz
glibc-4947b4b20f49324647a7cbcd2596b1f5b4639748.tar.xz
glibc-4947b4b20f49324647a7cbcd2596b1f5b4639748.zip
* sysdeps/mips/bits/wordsize.h: New file, appropriate for all 3 ABIs. * sysdeps/mips/mips64/gmp-mparam.h: New file. Define BITS_PER_LONGINT to __WORDSIZE, to match all 3 ABIs. * sysdeps/mips/setjmp_aux.c (STRINGXP, REGS, PTRS): New macros. (__sigsetjmp_aux): Use them. Adjust for all 3 ABIs. * sysdeps/mips/elf/start.S: Adjust for all 3 ABIs. * sysdeps/unix/mips/brk.S: Likewise. * sysdeps/unix/mips/sysdep.S: Likewise. * sysdeps/unix/sysv/linux/mips/clone.S: Likewise. * sysdeps/mips/bits/setjmp.h (__jmp_buf): Likewise. * sysdeps/mips/sys/ucontext.h: Likewise. * sysdeps/unix/sysv/linux/mips/sys/profcs.h: Likewise. * sysdeps/unix/sysv/linux/mips/sys/ucontext.h: Likewise. * sysdeps/unix/sysv/linux/mips/kernel_stat.h: Likewise. * sysdeps/mips/mips64/bsd-_setjmp.S: Likewise. * sysdeps/mips/mips64/bsd-setjmp.S: Likewise. * sysdeps/mips/mips64/setjmp.S: Likewise. * sysdeps/mips/mips64/bits/setjmp.h: Deleted, obsolete. * sysdeps/mips/mips64/soft-fp/sfp-machine.h: Use long long for 64-bit types.
2003-03-17  Alexandre Oliva  <aoliva@redhat.com>

	* sysdeps/mips/bits/wordsize.h: New file, appropriate for all
	3 ABIs.
	* sysdeps/mips/mips64/gmp-mparam.h: New file.  Define
	BITS_PER_LONGINT to __WORDSIZE, to match all 3 ABIs.
	* sysdeps/mips/setjmp_aux.c (STRINGXP, REGS, PTRS): New macros.
	(__sigsetjmp_aux): Use them.  Adjust for all 3 ABIs.
	* sysdeps/mips/elf/start.S: Adjust for all 3 ABIs.
	* sysdeps/unix/mips/brk.S: Likewise.
	* sysdeps/unix/mips/sysdep.S: Likewise.
	* sysdeps/unix/sysv/linux/mips/clone.S: Likewise.
	* sysdeps/mips/bits/setjmp.h (__jmp_buf): Likewise.
	* sysdeps/mips/sys/ucontext.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sys/profcs.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sys/ucontext.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/kernel_stat.h: Likewise.
	* sysdeps/mips/mips64/bsd-_setjmp.S: Likewise.
	* sysdeps/mips/mips64/bsd-setjmp.S: Likewise.
	* sysdeps/mips/mips64/setjmp.S: Likewise.
	* sysdeps/mips/mips64/bits/setjmp.h: Deleted, obsolete.
	* sysdeps/mips/mips64/soft-fp/sfp-machine.h: Use long long for
	64-bit types.
Diffstat (limited to 'sysdeps/unix/sysv/linux/mips/clone.S')
-rw-r--r--sysdeps/unix/sysv/linux/mips/clone.S40
1 files changed, 23 insertions, 17 deletions
diff --git a/sysdeps/unix/sysv/linux/mips/clone.S b/sysdeps/unix/sysv/linux/mips/clone.S
index 2b02a2ba9b..7af2a1652a 100644
--- a/sysdeps/unix/sysv/linux/mips/clone.S
+++ b/sysdeps/unix/sysv/linux/mips/clone.S
@@ -29,15 +29,17 @@
 /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg) */
 
 	.text
+LOCALSZ= 1
+FRAMESZ= (((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK
+GPOFF= FRAMESZ-(1*SZREG)
 NESTED(__clone,4*SZREG,sp)
 #ifdef __PIC__
-	.set		noreorder
-	.cpload		$25
-	.set		reorder
-	subu		sp,32
-	.cprestore	16
-#else
-	subu		sp,32
+	SETUP_GP
+#endif
+	PTR_SUBU sp, FRAMESZ
+	SETUP_GP64 (GPOFF, __clone)
+#ifdef __PIC__
+	SAVE_GP (GPOFF)
 #endif
 #ifdef PROF
 	.set		noat
@@ -52,9 +54,9 @@ NESTED(__clone,4*SZREG,sp)
 	beqz		a0,L(error)	/* No NULL function pointers.  */
 	beqz		a1,L(error)	/* No NULL stack pointers.  */
 
-	subu		a1,32		/* Reserve argument save space.  */
-	sw		a0,0(a1)	/* Save function pointer.  */
-	sw		a3,4(a1)	/* Save argument pointer.  */
+	PTR_SUBU	a1,32		/* Reserve argument save space.  */
+	PTR_S		a0,0(a1)	/* Save function pointer.  */
+	PTR_S		a3,PTRSIZE(a1)	/* Save argument pointer.  */
 
 
 	/* Do the system call */
@@ -66,16 +68,20 @@ NESTED(__clone,4*SZREG,sp)
 	beqz		v0,L(thread_start)
 
 	/* Successful return from the parent */
-	addiu		sp,32
+	RESTORE_GP64
+	PTR_ADDU	sp, FRAMESZ
 	ret
 
 	/* Something bad happened -- no child created */
 L(error):
-	addiu		sp,32
 #ifdef __PIC__
-	la		t9,__syscall_error
+	PTR_LA		t9,__syscall_error
+	RESTORE_GP64
+	PTR_ADDU	sp, FRAMESZ
 	jr		t9
 #else
+	RESTORE_GP64
+	PTR_ADDU	sp, FRAMESZ
 	j		__syscall_error
 #endif
 	END(__clone)
@@ -86,11 +92,11 @@ L(error):
 
 L(thread_start):
 	/* cp is already loaded.  */
-	.cprestore	16
+	SAVE_GP (GPOFF)
 	/* The stackframe has been created on entry of clone().  */
 	/* Restore the arg for user's function.  */
-	lw		t9,0(sp)	/* Function pointer.  */
-	lw		a0,4(sp)	/* Argument pointer.  */
+	PTR_L		t9,0(sp)	/* Function pointer.  */
+	PTR_L		a0,PTRSIZE(sp)	/* Argument pointer.  */
 
 	/* Call the user's function.  */
 	jal		t9
@@ -98,7 +104,7 @@ L(thread_start):
 	/* Call _exit rather than doing it inline for breakpoint purposes.  */
 	move		a0,v0
 #ifdef __PIC__
-	la		t9,_exit
+	PTR_LA		t9,_exit
 	jalr		t9
 #else
 	jal		_exit