Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Mar 2010 09:29:12 +0000 (UTC)
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r204631 - user/jmallett/octeon/lib/libc/mips/sys
Message-ID:  <201003030929.o239TCht008889@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jmallett
Date: Wed Mar  3 09:29:12 2010
New Revision: 204631
URL: http://svn.freebsd.org/changeset/base/204631

Log:
  Update with ABI/PIC stuff.  Some of these may not be quite right...

Modified:
  user/jmallett/octeon/lib/libc/mips/sys/Ovfork.S
  user/jmallett/octeon/lib/libc/mips/sys/brk.S
  user/jmallett/octeon/lib/libc/mips/sys/exect.S
  user/jmallett/octeon/lib/libc/mips/sys/fork.S
  user/jmallett/octeon/lib/libc/mips/sys/pipe.S
  user/jmallett/octeon/lib/libc/mips/sys/sbrk.S

Modified: user/jmallett/octeon/lib/libc/mips/sys/Ovfork.S
==============================================================================
--- user/jmallett/octeon/lib/libc/mips/sys/Ovfork.S	Wed Mar  3 09:02:55 2010	(r204630)
+++ user/jmallett/octeon/lib/libc/mips/sys/Ovfork.S	Wed Mar  3 09:29:12 2010	(r204631)
@@ -49,21 +49,16 @@ __FBSDID("$FreeBSD$");
  */
 
 LEAF(__sys_vfork)
-#ifdef __ABICALLS__
-	.set	noreorder
-	.cpload	t9
-	.set	reorder
-#endif
 	WEAK_ALIAS(vfork, __sys_vfork)
 	WEAK_ALIAS(_vfork, __sys_vfork)
+	PIC_PROLOGUE(__sys_vfork)
 	li	v0, SYS_vfork		# system call number for vfork
 	syscall
 	beq	a3, zero, 1f		# jump if no errors
-	la	t9, __cerror
-	jr	t9
+	PIC_TAILCALL(__cerror)
 1:
 	beq	v1, zero, 2f		# parent process ?
 	move	v0, zero		# return zero in child
 2:
-	j	ra
+	PIC_RETURN()
 END(__sys_vfork)

Modified: user/jmallett/octeon/lib/libc/mips/sys/brk.S
==============================================================================
--- user/jmallett/octeon/lib/libc/mips/sys/brk.S	Wed Mar  3 09:02:55 2010	(r204630)
+++ user/jmallett/octeon/lib/libc/mips/sys/brk.S	Wed Mar  3 09:29:12 2010	(r204631)
@@ -52,22 +52,19 @@ _C_LABEL(minbrk):
 LEAF(__sys_brk)
 	WEAK_ALIAS(brk, __sys_brk)
 	WEAK_ALIAS(_brk, __sys_brk)
-#ifdef __ABICALLS__
-	.set	noreorder
-	.cpload	t9
-	.set	reorder
-#endif
-	lw	v0, _C_LABEL(minbrk)
+	PIC_PROLOGUE(__sys_brk)
+	PTR_LA	v0, _C_LABEL(minbrk)
+	PTR_L	v0, 0(v0)
 	bgeu	a0, v0, 1f
 	move	a0, v0		# dont allow break < minbrk
 1:
 	li	v0, SYS_break
 	syscall
 	bne	a3, zero, 2f
-	sw	a0, _C_LABEL(__curbrk)
+	PTR_LA	t0, _C_LABEL(__curbrk)
+	PTR_S	a0, 0(t0)
 	move	v0, zero
-	j	ra
+	PIC_RETURN()
 2:
-	la	t9, _C_LABEL(__cerror)
-	jr	t9
+	PIC_TAILCALL(__cerror)
 END(__sys_brk)

Modified: user/jmallett/octeon/lib/libc/mips/sys/exect.S
==============================================================================
--- user/jmallett/octeon/lib/libc/mips/sys/exect.S	Wed Mar  3 09:02:55 2010	(r204630)
+++ user/jmallett/octeon/lib/libc/mips/sys/exect.S	Wed Mar  3 09:29:12 2010	(r204631)
@@ -41,16 +41,11 @@ __FBSDID("$FreeBSD$");
 #endif /* LIBC_SCCS and not lint */
 
 LEAF(exect)
-#ifdef __ABICALLS__
-	.set    noreorder
-	.cpload t9
-	.set    reorder
-#endif
+	PIC_PROLOGUE(exect)
 	li	v0, SYS_execve
 	syscall
 	bne	a3, zero, 1f
-	j	ra
+	PIC_RETURN()
 1:
-	la      t9, _C_LABEL(__cerror)
-	jr      t9
+	PIC_TAILCALL(__cerror)
 END(exect)

Modified: user/jmallett/octeon/lib/libc/mips/sys/fork.S
==============================================================================
--- user/jmallett/octeon/lib/libc/mips/sys/fork.S	Wed Mar  3 09:02:55 2010	(r204630)
+++ user/jmallett/octeon/lib/libc/mips/sys/fork.S	Wed Mar  3 09:29:12 2010	(r204631)
@@ -44,20 +44,14 @@ __FBSDID("$FreeBSD$");
 LEAF(__sys_fork)
 	WEAK_ALIAS(fork, __sys_fork)
 	WEAK_ALIAS(_fork, __sys_fork)
-#ifdef __ABICALLS__
-	.set    noreorder
-	.cpload t9
-	.set    reorder
-#endif
-	fork = __sys_fork
+	PIC_PROLOGUE(__sys_fork)
 	li	v0, SYS_fork	# pid = fork()
 	syscall
 	bne	a3, zero, 2f
 	beq	v1, zero, 1f	# v1 == 0 in parent, 1 in child
 	move	v0, zero
 1:
-	j	ra
+	PIC_RETURN()
 2:
-	la	t9, _C_LABEL(__cerror)
-	jr	t9
+	PIC_TAILCALL(__cerror)
 END(__sys_fork)

Modified: user/jmallett/octeon/lib/libc/mips/sys/pipe.S
==============================================================================
--- user/jmallett/octeon/lib/libc/mips/sys/pipe.S	Wed Mar  3 09:02:55 2010	(r204630)
+++ user/jmallett/octeon/lib/libc/mips/sys/pipe.S	Wed Mar  3 09:29:12 2010	(r204631)
@@ -44,19 +44,14 @@ __FBSDID("$FreeBSD$");
 LEAF(__sys_pipe)
 	WEAK_ALIAS(pipe, __sys_pipe)
 	WEAK_ALIAS(_pipe, __sys_pipe)
-#ifdef __ABICALLS__
-	.set    noreorder
-	.cpload t9
-	.set    reorder
-#endif
+	PIC_PROLOGUE(__sys_pipe)
 	li	v0, SYS_pipe	# pipe(fildes) int fildes[2];
 	syscall
 	bne	a3, zero, 1f
 	sw	v0, 0(a0)	# store the two file descriptors
 	sw	v1, 4(a0)
 	move	v0, zero
-	j	ra
+	PIC_RETURN()
 1:
-	la	t9, _C_LABEL(__cerror)
-	jr	t9
+	PIC_TAILCALL(__cerror)
 END(__sys_pipe)

Modified: user/jmallett/octeon/lib/libc/mips/sys/sbrk.S
==============================================================================
--- user/jmallett/octeon/lib/libc/mips/sys/sbrk.S	Wed Mar  3 09:02:55 2010	(r204630)
+++ user/jmallett/octeon/lib/libc/mips/sys/sbrk.S	Wed Mar  3 09:29:12 2010	(r204631)
@@ -52,34 +52,22 @@ _C_LABEL(__curbrk):
 LEAF(__sys_sbrk)
 	WEAK_ALIAS(sbrk, __sys_sbrk)
 	WEAK_ALIAS(_sbrk, __sys_sbrk)
-#ifdef __ABICALLS__
-	.set	noreorder
-	.cpload	t9
-	.set	reorder
-#endif
-	addu	sp, sp, -16
-	sw	s0, 0(sp)		# Preserve s0 value in stack
-					# it should be the same on return
-					# We can't use v1 as temporary
-					# register since syscall uses it
-					# to return 64-bit values
-	lw	s0, _C_LABEL(__curbrk)
-	li	v0, SYS_break
-	addu	a0, a0, s0		# compute current break
+	PIC_PROLOGUE(__sys_sbrk)
+	PTR_LA	t0, _C_LABEL(__curbrk)
+	PTR_L	t0, 0(t0)
+	PTR_ADDU a0, a0, t0
 
+	li	v0, SYS_break
 	syscall
 
 	bne	a3, zero, 1f
 	nop
-	move	v0, s0			# return old val of curbrk from above
-	lw	s0, 0(sp)
-	addu	sp, sp, 16
-	sw	a0, _C_LABEL(__curbrk)	# save current val of curbrk from above
+	move	v0, t0			# return old val of curbrk from above
+	PTR_LA	t0, _C_LABEL(__curbrk)
+	PTR_S	a0, 0(t0)		# save current val of curbrk from above
+	PIC_RETURN()
 	j	ra
 
 1:
-	lw	s0, 0(sp)
-	addu	sp, sp, 16
-	la	t9, _C_LABEL(__cerror)
-	jr	t9
+	PIC_TAILCALL(__cerror)
 END(__sys_sbrk)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003030929.o239TCht008889>