[PATCH] ARM: Implement __attribute__((interrupt(...)))

Tim Northover t.p.northover at gmail.com
Mon Sep 23 08:26:59 PDT 2013

Hi all,

These two patches should implement something very much like the GNU
extension allowing C-functions to be used as interrupt handlers on
ARM. This has a couple of high-level effects: special return
instructions (except for M-class CPUs) and many more callee-saved

Some issues that may be debatable:

1. I don't automatically save d0-d31. That would be insane (and also
isn't what GCC does).
2. On the LLVM side, I've modelled it as an attribute rather than a
calling-convention. Either could be made to work, but "cc(64)" seemed
a little less obvious and ARM's already got more than its fair share
of official calling conventions.
3. I completely co-opted the Thumb2 SUBS_PC_LR to match what CodeGen
actually expects of a return rather than, necessarily, reality.

Any comments or suggestions would be appreciated.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: interrupt-attr-clang.diff
Type: application/octet-stream
Size: 12398 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130923/25c8aa84/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: interrupt-attr-llvm.diff
Type: application/octet-stream
Size: 20597 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130923/25c8aa84/attachment-0001.obj>

More information about the cfe-commits mailing list