[PATCH] ppc64: fix semtimedop compat syscall
Paul Mackerras
paulus at samba.org
Wed Mar 23 09:40:45 EST 2005
Stephen Rothwell writes:
> On Wed, 23 Mar 2005 07:19:31 +1100 Paul Mackerras <paulus at samba.org> wrote:
>
> > Arnd Bergmann writes:
> >
> > > One problem is that sign extension can not be expressed in architecture
> > > independent C code.
> >
> > On which architectures does (long)(int) x not give the desired result?
>
> Presumably for a u32 function argument x which has been zero extended?
Huh?? For a 64-bit architecture with 32-bit ints, (long)(int) x will
sign-extend the bottom 32 bits of x to 64 bits. The top 32 bits don't
matter, and in particular it doesn't matter if x has previously been
zero-extended to 64 bits, or if x is a u32.
Paul.
More information about the Linuxppc64-dev
mailing list