[PATCH] MIPS function attributes for interrupt handlers

Richard Sandiford rdsandiford@googlemail.com
Wed Oct 22 20:28:00 GMT 2008


Mark Mitchell <mark@codesourcery.com> writes:
> Richard Sandiford wrote:
>>> For example, writing:
>>>
>>>   void mylock()
>>>     __attribute__((hidden))
>>>     __attribute__((naked)) {
>>>     ARCH_MYLOCK;
>>>   }
>>>
>>> where ARCH_MYLOCK is a macro that expands to the CPU-specific assembly
>>> implementation of a locking primitive seems likely to be useful.  Much
>>> better than lots of #ifdef __linux__ and #ifdef __mips__ goo in a pure
>>> assembler file.
>> 
>> I'm not convinced by this example.  GCC already provides a much
>> more powerful way of doing this: extended asms.  Such an extended
>> asm has many benefits over naked functions:
>
> Sure, but it has one serious drawback: you can't use a non-standard
> calling convention.

Is that really an issue?  You wouldn't be able to call the function
from GCC in that case either, so why tell GCC about it at all?

> What is the harm in allowing it for MIPS?

I think at this point we're going round in circles ;)  I don't think
I can explain it any better than I already have.

Richard



More information about the Gcc-patches mailing list