lkml.org 
[lkml]   [2010]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: 64-syscall args on 32-bit vs syscall()
From
Date
On Mon, 2010-03-15 at 14:44 +0100, Ralf Baechle wrote:
> Syscall is most often used for new syscalls that have no syscall stub in
> glibc yet, so the user of syscall() encodes this ABI knowledge. If at a
> later stage syscall() is changed to have this sort of knowledge we break
> the API. This is something only the kernel can get right.

Well, no. The change I propose would not break the ABI on powerpc and
would auto-magically fix thoses cases :-) But again, you don't have to
do the same thing on MIPS or sparc, it's definitely arch specific.

IE. What you are saying is that a syscall defined in the kernel as:

sys_foo(u64 arg);

To be called from userspace would require something like:

u64 arg = 0x123456789abcdef01;

#if defined(__powerpc__) && WORDSIZE == 32
syscall(SYS_foo, (u32)(arg >> 32), (u32)arg);
#ese
syscall(SYS_foo, arg);

While with the trick of making syscall a macro wrapping an underlying
__syscall that has an added dummy argument, the register alignment is
"corrected" and thus -both- forms above suddenly work for me. That might
actually work for you too.

Cheers,
Ben.




\
 
 \ /
  Last update: 2010-03-15 21:31    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site