[PATCH] [POWERPC] Wire up sys_sync_file_range

Stephen Rothwell sfr at canb.auug.org.au
Thu Mar 15 21:23:19 EST 2007


On Fri, 9 Mar 2007 11:59:02 +0000 Ralf Baechle <ralf at linux-mips.org> wrote:
>
> I'd rather let the C compiler sort it out:
>
> asmlinkage long compat_sys_sync_file_range(int fd, int dummy,
> 	loff_t offset, loff_t nbytes, unsigned int flags)
> {
> 	sys_sync_file_range(fd, offset, nbytes, flags);
> }
>
> Which looks like it could be portable to PPC even, so maybe a little cpp
> magic like:
>
> #ifdef CONFIG_ABI_NEEDS_PADDING_
> #define PAD_64BIT_ARG(x)	unsigned int x,
> #else
> #define PAD_64BIT_ARG(x)
> #endif
>
> [...]
> asmlinkage long sys_sync_file_range(int fd,  PAD_64BIT_ARG(pad1)
> 	loff_t offset, loff_t nbytes, unsigned int flags)

Except the compat routines are built with a 64 bit compiler and the
callinf convention is different for 64 bit.  i.e. on ppc64 that routine
uses a single register for each parameter, while on 32 bit it uses 2
registers for each of the loff_t's.  It is this difference that we have
to cope with in the 64 bit kernel when the user process is 32 bit.
--
Cheers,
Stephen Rothwell                    sfr at canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20070315/22a12f1b/attachment.pgp>


More information about the Linuxppc-dev mailing list