sign extension for 32bit syscalls on ppc64

Stephen Rothwell sfr at canb.auug.org.au
Mon May 1 13:44:40 EST 2006


On Mon, 1 May 2006 10:05:18 +1000 Stephen Rothwell <sfr at canb.auug.org.au> wrote:
>
> Try mkdirat. openat has a compat wrapper that has the dfd paramater
> declared as a unsigned int and passes it to sys_openat, whose first
> paramter is decalred to be int, so the sign extension gets done.

OK, I actually tried this and it works! :-(

I traced the code path and it turns out that the place we check for the
-100 (in do_path_lookup), the compiler has used a cmpwi instruction and so
ignores the top 32 bits.  Thus we get away with the ABI abuse!

-- 
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/20060501/50254bf6/attachment.pgp>


More information about the Linuxppc-dev mailing list