[PATCH] compat: add compat functions for *at syscalls

Heiko Carstens heiko.carstens at de.ibm.com
Tue Feb 7 20:31:54 EST 2006


> How about the following (modifiying Linus' suggestion and copying what
> sparc64 already does)?
> 
> The assumption is that all arguments have been zero extended by the compat
> syscall entry code, so we just sign extend those that need it.
> 
> I am not sure of the sparc64 code below, s390 doesn't seem to follow our
> "all arguments are zero extended" assumption and x86_64 may not need any
> of these wrappers anyway.

On s390 we do already sign extension for int/long and zero extension for
the unsigned parameters. Even though I wasn't aware that we should do zero
extension for _all_ parameters of the compat system calls, regardless of
their type.
In addition we must do pointer conversion to 64 bit, since the compat tasks
have the most significant bit set (to distinguish between 24- and 31-bit
addressing mode).

Therefore I think Linus' suggestion with having something like

	compat_fn6(sys_waitif, SARG, UARG, UARG, SARG, UARG);

would be better. Just that we would need something for pointers as well.
And to make things just a bit more complicated: only the first five
parameters are in registers. Number six and the following are already on
the stack. E.g. the compat wrapper for the futex syscall would need extra
assembly code to do conversion on the stack.

Maybe having defines like SARG1..SARG6 that would define assembly code
instead of the register would do the job.


Thanks,
Heiko



More information about the Linuxppc64-dev mailing list