EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Why ISR contains no arguments and return type is void

Started by sudheervemana August 24, 2004
On 24 Aug 2004 02:56:56 -0700, sudheervemana <sudheervemana@hotmail.com> 
wrote:

> Can any one clear me why cant we pass the arguments to an > ISR and also why the ISR returns nothing.
You've got a lot of answers already, so you might have grasped the concept. In some cases though, when the interrupt handler is called by the OS, the former can have arguments and return value. In QNX6 we (tinw) use the interrupt handlers that have the following prototype const struct sigevent* handler (void* area, int id); The handler is called by the OS kernel and returns to the OS kernel. It does not (and should not) deal with interrupt controller directly, has it's own rather limited stack and can be preempted by a handler of higher priority interrupt. BTW, in QNX4 the prototype was pid_t handler (void); HTH, Vadim
"Grant Edwards" <grante@visi.com> escribi&#4294967295; en el mensaje
news:412b6af1$0$65603$a1866201@newsreader.visi.com...
> On 2004-08-24, Al Borowski <al.borowski@EraseThis.gmail.com> wrote: > > > I'm curious. What arguments would you want to pass to an ISR? > > And where would the returned thing go? > > I'm not the OP, but the interrupt number/index/vector/whatever > might be handy. That way you could hook the same ISR to > multiple interrupts and have it behave slightly differently > based on which interrupt caused it. > > For example, you've got 4 UARTs and the receive processing for > all of the is identical (except for which UART you access and > which buffer you put data into). Hooking one ISR to all four > and then using the "parameter" to determine which > UART/buffer-pair to service would be elegent. > > -- > Grant Edwards grante Yow! An air of FRENCH > at FRIES permeates my > visi.com nostrils!!
what about polling the "interrupt" flag (of all the devices connected to that interrupt line) which is set when an interrupt gets serviced?

Memfault Beyond the Launch