On Wed, 01 Feb 2006 21:56:44 -0800 (PST) "David S. Miller" <[email protected]> wrote: > > From: Linus Torvalds <[email protected]> > Date: Wed, 1 Feb 2006 21:36:40 -0800 (PST) > > > Wouldn't it be _much_ better to declare the argument as a "long", since > > some architectures (alpha, for example) may assume that 32-bit arguments > > have been _sign_extended, not zero-extended. > > > > Then, when the "compat_sys_xxxx()" function passes the "long" down to the > > _real_ function (which takes an "int"), those architectures (and only > > those architectures) that actually have assumptions about high bits will > > have the compiler automatically do the right zero- or sign-extensions at > > that call-site. > > There is the convention that for the compat system calls all the args > will be 32-bit zero extended by the platform syscall entry code before > the C code is invoked. This topic used to come up a lot and finally > we all decided that was the thing to do. > > It's important (at least I think so :-) for all of this generic compat > code to be able to have a well defined argument environment. > > Anyways, I think that's how Stephen arrived at his patch. Yes, that is it. I have tried using "long" and "unsigned int" for those first parameters and it produces exactly the same assembler output on ppc64 and x86_64. Everywhere else that we have a file descriptor argument to a compat syscall function it is declared "unsigned int". And for these compat functions, alpha is irrelevent of course. :-) -- Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
Attachment:
pgpE1GNUAfWun.pgp
Description: PGP signature
- Follow-Ups:
- Re: [PATCH] compat: fix compat_sys_openat and friends
- From: Linus Torvalds <[email protected]>
- Re: [PATCH] compat: fix compat_sys_openat and friends
- References:
- [PATCH] compat: fix compat_sys_openat and friends
- From: Stephen Rothwell <[email protected]>
- Re: [PATCH] compat: fix compat_sys_openat and friends
- From: Linus Torvalds <[email protected]>
- Re: [PATCH] compat: fix compat_sys_openat and friends
- From: "David S. Miller" <[email protected]>
- [PATCH] compat: fix compat_sys_openat and friends
- Prev by Date: Re: [PATCH 2/3] s390: avoid usage of 'new' in header files.
- Next by Date: Re: [PATCH] compat: fix compat_sys_openat and friends
- Previous by thread: Re: [PATCH] compat: fix compat_sys_openat and friends
- Next by thread: Re: [PATCH] compat: fix compat_sys_openat and friends
- Index(es):