gcc --- __attribute__((interrupt( irq )))

2

i started with device driver for arm ... there i saw for each handler mention --- __attribute__((interrupt( irq ))) -.I am confused how this attribute will place a call to our driver routine ..??

IRQ of arm have following Vector address--- 0x00000018 (or 0xFFFF0018) As there can be many interrupt handler on same line. Suppose if we have 4 device driver each with its own IRQ to be reistered.

Means some startup code will be provided by the GCC compiler for the IRQ handler & compiler will place call to our routine in that startup code for interrupt handler ..... Am i right ...?

gcc
arm
linux-device-driver
embedded-linux
asked on Stack Overflow Dec 9, 2012 by Allan • edited Dec 9, 2012 by Luke Woodward

2 Answers

1

From GCC docs for interrupt attribute:

The compiler generates function entry and exit sequences suitable for use in an interrupt handler when this attribute is present.

You can use objdump easily to see how this attribute changes your binary which should clarify the situation for you much better.

answered on Stack Overflow Dec 9, 2012 by auselen
0

The attribute should ONLY be used by interrupt handler of the OS and NOT by interrupt handler of a specific driver. The OS will read the IRQ vector/number and call the appropriate driver function to service the IRQ. You only need to register your driver/ISR with the OS.

answered on Stack Overflow Dec 29, 2012 by sgupta

User contributions licensed under CC BY-SA 3.0