Re: [PATCH] Add FUTEX_CMP_REQUEUE futex op

From: Jakub Jelinek
Date: Fri May 21 2004 - 02:45:39 EST


On Thu, May 20, 2004 at 11:36:39PM -0700, Andrew Morton wrote:
> > > It'll work OK on x86 because of the stack layout but is the same true of
> > > all other supported architectures?
> >
> > We add parameters at the end. This does not influence how previous
> > values are passed. And especially for syscalls it makes no difference.
> >
>
> what we're effectively doing is:
>
> void foo(int a, int b, int c)
> {
> }
>
> and from another compilation unit:
>
> foo(a, b);
>
> and we're expecting the a's and b's to line up across all architectures and
> compiler options. I thought that on some architectures that only works out
> if the function has a vararg declaration.

The kernel syscall ABI is on many arches different from the compiler ABI.
Adding an argument this way certainly works on the architectures I'm
familiar with (i386, x86_64, ia64, ppc, ppc64, s390, s390x, sparc, sparc64,
alpha). I believe arm will work too, don't keep track of the rest of
arches.

Well, for s390/s390x there is a problem that it doesn't allow (yet) 6
argument syscalls at all, so one possibility for s390* is adding a wrapper around
sys_futex which will take the 5th and 6th arguments for FUTEX_CMP_REQUEUE
from a structure pointed to by 5th argument and pass that to sys_futex.

If some weirdo arch has problems with this, it can certainly deal with it in
its architecture wrapper.

Jakub
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/