Re: [RFC PATCH (take #2)] i386: kill CONFIG_REGPARM completely

From: linux-os (Dick Johnson)
Date: Mon May 22 2006 - 07:48:32 EST



On Sat, 20 May 2006, Matheus Izvekov wrote:

> On 5/20/06, Chris Wedgwood <cw@xxxxxxxx> wrote:
>> Take #2.
>>
>> Kill of CONFIG_REGPARM completely.
>>
>>
>> diff --git a/Documentation/stable_api_nonsense.txt b/Documentation/stable_api_nonsense.txt
>> index f39c9d7..ac11b81 100644
>> --- a/Documentation/stable_api_nonsense.txt
>> +++ b/Documentation/stable_api_nonsense.txt
>> @@ -62,9 +62,8 @@ consider the following facts about the L
>> - different structures can contain different fields
>> - Some functions may not be implemented at all, (i.e. some locks
>> compile away to nothing for non-SMP builds.)
>> - - Parameter passing of variables from function to function can be
>> - done in different ways (the CONFIG_REGPARM option controls
>> - this.)
>> + - Parameter passing of variables from function to function can
>> + be done in different ways.
>
> Why not kill those 2 lines too? Now that non-regparm is gone, it
> doesnt make sense to say there are different ways to pass parameters,
> there is only regparm now, right?
>

On ix86 there are not enough registers to pass a significant parameter
list all in registers! Like when you are printk()ing a dotted-quad IP
address, etc. Registers ESI, EDI, and EBX are precious, that leaves
EAX, ECX, EDX and possibly EBP for only 4 parameters. You need 5
for the dotted quad IP address. If the compiler were to use the
precious registers, the contents need to be saved on the stack.
That negates any advantage to passing parameters in registers.

This means that REGPARM will always remain a "hint" to the compiler,
not some absolute order.

Cheers,
Dick Johnson
Penguin : Linux version 2.6.16.4 on an i686 machine (5592.89 BogoMips).
New book: http://www.AbominableFirebug.com/
_


****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@xxxxxxxxxxxx - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.
-
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/