This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/25967] Add attribute naked for x86


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25967

Bryan O'Donoghue <bryan.odonoghue at linux dot intel.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bryan.odonoghue at linux
                   |                            |dot intel.com

--- Comment #8 from Bryan O'Donoghue <bryan.odonoghue at linux dot intel.com> 2012-03-23 11:25:19 UTC ---
Guys.

I'd like to add to the calls for __attribute__((naked)) to be implemented on
x86.

For the case of interrupts particularly, naked attribute would allow us to
control the procedure prologue and epilogue more effectively and hence have
less code and fewer cycles in order to service an IRQ on x86, which is clearly
a good thing for everybody.

attribute naked is a highly useful and widely used gcc extension on ARM and all
of the valid use-cases for naked on ARM are also valid reasons on x86.
Particularly with attribute naked on x86 we could write a C function and stuff
that directly into an interrupt gate - using macros for procedure
prologue/epilogue as necessary for interrupts or exceptions (which have
different stack arrangements on x86).

Most OS implementations have 256 separate functions as some sort of macro
generated assembly - specifically to put into the interrupt gate.

These entry/exit functions then typically go to a lookup table and call into
the 'real' interrupt handler.

That long process of indirection (and the unnecessary stub functions for the
interrupt gate) could be gotten rid of, if gcc would implement naked attribute
on x86, in the same fashion as on ARM.

Basically the developer should have the same freedom to implement solutions as
appropriate on x86 as on ARM.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]