This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH]: Fix syscall() on sparc.


From: Roland McGrath <roland@redhat.com>
Date: Thu,  1 May 2008 14:46:28 -0700 (PDT)

> > > > +	ldx	[%sp+2223],%o5
> > > 
> > > That seems like a really unlikely stack frame size :-)
> > 
> > The stack is biased by 2047 bytes on sparc64, so that more local
> > variables are accessible from the frame pointer.
> 
> You don't stay sane by writing it as [%sp + 2047 - 176]?
> (Or even some macro or built-in assembler shorthand for same.)

You mean [%sp + STACK_BIAS + 176].

Sure, we could, but what I wrote is the same thing the compiler
outputs. :)

Anyways, here you are:

2008-05-01  David S. Miller  <davem@davemloft.net>

	* sysdeps/unix/sysv/linux/sparc/sparc32/syscall.S: Add support for
	six system call parameters.
	* sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S: Likewise.

diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/syscall.S b/sysdeps/unix/sysv/linux/sparc/sparc32/syscall.S
index 1610745..5786880 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/syscall.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/syscall.S
@@ -27,6 +27,7 @@ ENTRY(syscall)
 	mov	%o3, %o2
 	mov	%o4, %o3
 	mov	%o5, %o4
+	ld	[%sp + 92], %o5
 	ta	0x10
 	bcc	1f
 	 mov	%o7, %g1
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S b/sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S
index 27487d8..2c89558 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S
@@ -27,6 +27,7 @@ ENTRY(syscall)
 	mov	%o3,%o2
 	mov	%o4,%o3
 	mov	%o5,%o4
+	ldx	[%sp + STACK_BIAS + 176],%o5
 
 	ta	0x6d
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]