This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Implementing callback from driver to application
- From: "Mike Sweeney" <msweeney77 at gmail dot com>
- To: ecos-discuss at ecos dot sourceware dot org
- Date: Sun, 5 Aug 2007 18:51:10 -0400
- Subject: [ECOS] Implementing callback from driver to application
I have a custom device driver that needs to invoke a callback function
that is registered by the user's application. I have a 3 level
interrupt service mechanism within my device driver: an ISR, a DSR,
and an interrupt service thread. Basically in my interrupt service
thread I invoke the callback function. This is not a great design
because I don't want to be blocked in my interrupt service thread for
an unknown amount of time. I may have multiple application callbacks
to invoke depending on the device status.
I'm looking for some input on how best to tackle this within eCos. My
design requires the kernel so I can use any sort of kernel services
and am not restricting myself to the driver API. Should my driver have
another dedicated thread that receives mailbox messages from my
interrupt service thread and then calls the callbacks from within its
own context? All ideas are appreciated.
Thanks.
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss