Thread (6 messages) flat view 6 messages, 4 authors, 2007-03-17

Re: [PATCH] [POWERPC] Wire up sys_sync_file_range

From: Stephen Rothwell <hidden>
Date: 2007-03-15 10:23:17
Also in: linux-arch

On Fri, 9 Mar 2007 11:59:02 +0000 Ralf Baechle [off-list ref] 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@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help