[Click] [PATCH 02/12] Configury: fixincludes update to fix c++ keywords in inline assembly

Eddie Kohler kohler at cs.ucla.edu
Sun Jan 16 17:26:39 EST 2011


Thanks for the explanation!  I'll check in a version of this too, but 
one that operates on the string-protected version.

Eddie



On 10/3/10 8:08 PM, Joonwoo Park wrote:
> Hi Eddie,
>
> Please refer to ./arch/x86/include/asm/alternative.h of linux 2.6.35
>
> ---
> /* Like alternative_io, but for replacing a direct call with another one. */
> #define alternative_call(oldfunc, newfunc, feature, output, input...)   \
>          asm volatile (ALTERNATIVE("call %P[old]", "call %P[new]", feature) \
>                  : output : [old] "i" (oldfunc), [new] "i" (newfunc), ## input)
> ---
>
> Thanks,
> Joonwoo
>
> On Wed, Sep 29, 2010 at 4:02 PM, Eddie Kohler<kohler at cs.ucla.edu>  wrote:
>> Hi Joonwoo,
>>
>> This one also I don't understand.  fixincludes is already supposed to be
>> doing new conversion in asm operands.  And something inside quotes -- which
>> it looks like your stuff checks for -- shouldn't be parsed by C++.  The code
>> in 2.6.35.6 doesn't look like it has "new" in it any more.  Can you send the
>> example?
>>
>> Eddie
>>
>>
>> On 09/25/2010 10:29 PM, Joonwoo Park wrote:
>>>
>>> eliminate following build error on linux 2.6.35 arch x86_64
>>> include/click-linuxmodule/include0/asm/uaccess_64.h: In function
>>> ‘copy_user_generic’:
>>> include/click-linuxmodule/include0/asm/uaccess_64.h:32: error: undefined
>>> named operand ‘new’
>>>
>>> Signed-off-by: Joonwoo Park<joonwpark81 at gmail.com>
>>> ---
>>>   linuxmodule/fixincludes.pl |    5 +++++
>>>   1 files changed, 5 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/linuxmodule/fixincludes.pl b/linuxmodule/fixincludes.pl
>>> index 54a0813..a4c9aa7 100755
>>> --- a/linuxmodule/fixincludes.pl
>>> +++ b/linuxmodule/fixincludes.pl
>>> @@ -209,6 +209,11 @@ sub one_includeroot ($$) {
>>>             # unquote.
>>>             $_ = sunprotect($_);
>>>
>>> +           # "new" and other keywords in inline assembler
>>> +           s{(\basm\b.*)+(".*?[^\\])(\bnew\b)(.*")}{$1$2new_value$4}g;
>>> +           s{(\basm\b.*)+(".*?[^\\])(\band\b)(.*")}{$1$2and_value$4}g;
>>> +           s{(\basm\b.*)+(".*?[^\\])(\bswap\b)(.*")}{$1$2swap_value$4}g;
>>> +
>>>             # perhaps nothing has changed; avoid changing the timestamp
>>>             if (-f "$outputroot$dd/$d") {
>>>                 open(F, "$outputroot$dd/$d");
>>



More information about the click mailing list