All of lore.kernel.org
 help / color / mirror / Atom feed
* N32 fallocate syscall
@ 2008-12-18  0:14 Joseph S. Myers
  2008-12-18  1:43 ` David Daney
  2008-12-18  7:10 ` Ralf Baechle
  0 siblings, 2 replies; 3+ messages in thread
From: Joseph S. Myers @ 2008-12-18  0:14 UTC (permalink / raw)
  To: linux-mips

The N32 syscall table uses sys_fallocate instead of sys32_fallocate.  
However, glibc expects to be using the syscall version with 32-bit 
arguments on N32, which should work with sys32_fallocate but not 
sys_fallocate.

What should the N32 interface for this syscall be?  My inclination is that 
glibc is right not to do anything special and different from other 32-bit 
ABIs here, and so sys32_fallocate should be used.

(glibc is also expecting the 32-bit version for N64, but that's a clear 
bug in glibc that I'll be fixing.)

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: N32 fallocate syscall
  2008-12-18  0:14 N32 fallocate syscall Joseph S. Myers
@ 2008-12-18  1:43 ` David Daney
  2008-12-18  7:10 ` Ralf Baechle
  1 sibling, 0 replies; 3+ messages in thread
From: David Daney @ 2008-12-18  1:43 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: linux-mips

Joseph S. Myers wrote:
> The N32 syscall table uses sys_fallocate instead of sys32_fallocate.  
> However, glibc expects to be using the syscall version with 32-bit 
> arguments on N32, which should work with sys32_fallocate but not 
> sys_fallocate.
> 
> What should the N32 interface for this syscall be?  My inclination is that 
> glibc is right not to do anything special and different from other 32-bit 
> ABIs here, and so sys32_fallocate should be used.
> 

The prototype for that would be something like:

sys_fallocate(int32_t, int32_t, int64_t, int64_t);

The N32 and N64 ABIs treat this identically, the parameters are passed
in a0, a1, a2, and a3.  As you noted, the current (2.6.28-rc8) kernel
sources follow the ABI for N32 and N64.  I think the kernel is
correct.

If glibc is not using the ABI calling convention for both N32 and N64 (I
haven't checked), it should probably be fixed.

> (glibc is also expecting the 32-bit version for N64, but that's a clear 
> bug in glibc that I'll be fixing.)
> 

David Daney

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: N32 fallocate syscall
  2008-12-18  0:14 N32 fallocate syscall Joseph S. Myers
  2008-12-18  1:43 ` David Daney
@ 2008-12-18  7:10 ` Ralf Baechle
  1 sibling, 0 replies; 3+ messages in thread
From: Ralf Baechle @ 2008-12-18  7:10 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: linux-mips

On Thu, Dec 18, 2008 at 12:14:12AM +0000, Joseph S. Myers wrote:

> The N32 syscall table uses sys_fallocate instead of sys32_fallocate.  
> However, glibc expects to be using the syscall version with 32-bit 
> arguments on N32, which should work with sys32_fallocate but not 
> sys_fallocate.
> 
> What should the N32 interface for this syscall be?  My inclination is that 
> glibc is right not to do anything special and different from other 32-bit 
> ABIs here, and so sys32_fallocate should be used.
> 
> (glibc is also expecting the 32-bit version for N64, but that's a clear 
> bug in glibc that I'll be fixing.)

There are exceptions such as pipe(2) or clone(2) but the calling convention
of most syscalls in all ABIs is following the C calling conventions for the
respective ABI, so N32 fallocate(2) receives it's syscalls like a N32
function call would.

o32-style arguments would require splitting the two 64-bit loff_t arguments
to be split into 2 32-bit halfs each in userspace and those pairs then to
be re-assembled into 64-bit arguments in kernel.  Bit messy, no?

  Ralf

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-12-18  7:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-18  0:14 N32 fallocate syscall Joseph S. Myers
2008-12-18  1:43 ` David Daney
2008-12-18  7:10 ` Ralf Baechle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.