sign extension for 32bit syscalls on ppc64

Christoph Hellwig hch at lst.de
Fri Apr 28 23:12:54 EST 2006


For 32bit syscalls implemented in arch/powerpc/ we're doing our own
sign-extension where an int argument is passed as u32 in the prototype
and then casted to int later on:

asmlinkage long compat_sys_sendfile(u32 out_fd, u32 in_fd, compat_off_t
__user * offset, u32 count)

{
	...
	ret = sys_sendfile((int)out_fd, (int)in_fd, up, count);
	..
}

OTOH various syscalls in the generic code don't do that and it seems to
still work fine.  I have patches for various new generic compat
routines, and they all seem to work fine without this sign extension.

What's the exact sign extention rules for ppc64?



More information about the Linuxppc-dev mailing list