diff mbox

powerpc: syscall support up to 6 arguments

Message ID 1389736377-2446-1-git-send-email-kristof@codepro.be
State Accepted, archived
Headers show

Commit Message

Kristof Provost Jan. 14, 2014, 9:52 p.m. UTC
C calls to syscall like 'syscall(351, 1, 2, 3, 4, 5, 6);' resulted in
the following ftrace: 'sys_enter: NR 351 (1, 2, 3, 4, 5, 5)'.

This is because the syscall function failed to copy the 6th argument
into the appropriate register. In combination with the function calling
convention this meant that the 5th argument was repeated into the 6th.
---
 libc/sysdeps/linux/powerpc/syscall.S | 1 +
 1 file changed, 1 insertion(+)

Comments

Bernhard Reutner-Fischer Jan. 22, 2014, 10:09 p.m. UTC | #1
On Tue, Jan 14, 2014 at 10:52:57PM +0100, Kristof Provost wrote:
> C calls to syscall like 'syscall(351, 1, 2, 3, 4, 5, 6);' resulted in
> the following ftrace: 'sys_enter: NR 351 (1, 2, 3, 4, 5, 5)'.
> 
> This is because the syscall function failed to copy the 6th argument
> into the appropriate register. In combination with the function calling
> convention this meant that the 5th argument was repeated into the 6th.

Applied.
wasn't there a subtle difference between the bnslr ''/+/- variants?
Don't remeber offhand..

PS: missing SOB line as per uclibc.org/developing#contrib but the patch
is obvious from the description this time.
thanks,
diff mbox

Patch

diff --git a/libc/sysdeps/linux/powerpc/syscall.S b/libc/sysdeps/linux/powerpc/syscall.S
index 3cb048a..248df69 100644
--- a/libc/sysdeps/linux/powerpc/syscall.S
+++ b/libc/sysdeps/linux/powerpc/syscall.S
@@ -29,6 +29,7 @@  syscall:
 	mr 5,6
 	mr 6,7
 	mr 7,8
+	mr 8,9
 	sc
 	bnslr;