Mark Pearson
|
MsgSendPulse to wake up an Interrupt Handler
|
Mark Pearson
08/10/2009 9:44 AM
post35552
|
MsgSendPulse to wake up an Interrupt Handler
Hi,
I've written two device drivers which have currently interrupt service routines which return an event upon determining
that an interrupt of interest has occured.
I've used InterruptAttach to define my interrupt service routine and have associated a pulse with an event handler, to
allow the calling of the event handler when the interrupt service routine returns an event, i.e.
const struct sigevent *mailboxISR(void *pArea, int id)
{
mailboxDev_t *mbxDev = pArea;
if(SomeInterrupt)
return &mbxDev->event;
else
return NULL;
}
int mailboxEventHandler(message_context_t *pMsgCtp, int code, unsigned flags, void *pHandle)
{
/* Do the work for the interrupt */
}
const struct sigevent *frameISR(void *pArea, int id)
{
frameDev_t *frameDev = pArea;
if(SomeInterrupt)
return &frameDev->event;
else
return NULL;
}
int frameEventHandler(message_context_t *pMsgCtp, int code, unsigned flags, void *pHandle)
{
/* Do the work for the interrupt */
}
Both drivers have their own ISR and EventHandlers, but now I have to write a single ISR for both drivers, as there is
only one interrupt source for both drivers.
For this I have written a new driver which simply contains the ISR and an EventHandler.
My idea was that the new EventHandler would wake up the frameEventHandler or mailboxEventHandler upon detecting an
interrupt for those two devices.
But my question is, how can I send an pulse to wake-up the frameEventHandler or mailboxEventHandler from my new
interrupt driver EventHandler?
I thought I may be able to use MsgSendPulse with the appropriate coid and code for frameEventHandler/mailboxEventHandler
, but I can't get this to work.
I'm trying to minimise the amount of changes I need to do to my two existing drivers.
Any help would be greatly appriciated.
Cheers, Mark.
|
|
|