[cfe-dev] RFC: Support x86 interrupt and exception handlers

David Chisnall via cfe-dev cfe-dev at lists.llvm.org
Wed Sep 16 01:28:48 PDT 2015


On 15 Sep 2015, at 23:17, H.J. Lu via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> 
> In my proposal, there are only 2 handlers: interrupt and exception.
> __builtin_interrupt_data is provided to programmers to implement
> different variants of those handlers.

The thing that is still missing here is a use case.  Interrupt handlers in existing operating systems all contain some assembly code because they need to do complicated things, like mask interrupts long enough to get a consistent state, store things in OS-specific context switch structures, and so on.  I can’t imagine any OS using this feature in the compiler.

Existing compilers provide similar functionality for embedded targets, where you are not running an OS, but these often rely on some assembly code shipped with the compiler to allow the C versions to work (do you intend to contribute this code to compiler-rt for x86?).  Are enough (any?) people doing bare-metal x86 embedded work for this to be a useful feature?

David




More information about the cfe-dev mailing list