Re: long long on 32-bit machines

From: H. Peter Anvin
Date: Wed Jan 28 2004 - 20:36:32 EST


Ulrich Weigand wrote:
> Arnd Bergmann wrote:
>
>
>>Some architectures require long long arguments to be passed as an
>>even/odd register pair. For example on s390,
>>
>> void f(int a, int b, long long x)
>>
>>uses registers 2, 3, 4 and 5, while
>>
>> void f(int a, long long x, int b)
>>
>>uses registers 2, 4, 5 and 6.
>
>
> Actually, this isn't quite true -- the second case will also
> use registers 2, 3, 4, and 5.
>
> However, there is still a case where a single long long is
> passed differently from a pair of longs: when there is only
> a single register remaining for parameters.
>
> This means that
> void f(int a, int b, int c, int d, long e, long f)
> is passed as
> a-d in register 2-5
> e in register 6
> f on the stack (4 bytes)
>
> while
> void f(int a, int b, int c, int d, long long e)
> is passed as
> a-d in register 2-5
> nothing in register 6
> e on the stack (8 bytes)
>

If I remember correctly, a 6-argument system call on s390 will put a
pointer to the last two arguments as the effective 5th argument, so this
would not affect the system call calling convention, correct?

-hpa

-
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/