www.digitalmars.com         C & C++   DMDScript  

D.gnu - [Bug 114] New: Add support for the GCC 'naked' attribute

Date: Wed, 2 Apr 2014 13:42:05 +0100
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"

http://bugzilla.gdcproject.org/show_bug.cgi?id=114

            Bug ID: 114
           Summary: Add support for the GCC 'naked' attribute
    Classification: Unclassified
           Product: GDC
           Version: development
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: Normal
         Component: gdc
          Assignee: ibuclaw gdcproject.org
          Reporter: slavo5150 yahoo.com

I'm targeting ARM Cortex-M bare metal, and I need my reset interrupt handler
marked with the 'naked' attribute as it will be called before I've initialized
my the hardware containing my stack.  

It can also be used to make a useful hard fault handler for finding elusive
bugs as described here. 
http://www.freertos.org/Debugging-Hard-Faults-On-Cortex-M-Microcontrollers.html

I could do what I need in assembly, but then I'd break my "do it all in D"
goal.

I propose the following syntax:

 attribute("naked") void myNakedFunction() { }

The GCC 'naked' attribute is documented here:
gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html

-- 
You are receiving this mail because:
You are watching all bug changes.
Apr 02 2014