Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Queries related to InterruptAttach & InterruptAttachEvent: (4 Items)
   
Queries related to InterruptAttach & InterruptAttachEvent  
If I register an interrupt handler using InterruptAttach/InterruptAttachEvent calls to each of the SDMA channels 
whenever they are created, is it necessary for me to use InterruptWait seperately for each channel ? 
If I can attach multiple ISR handlers(or same ISR for each channel) one for each channel In the main thread how will I 
get to know for which channel interrupt has been generated(so that InterruptWait got unblocked) ?

Also if I want to attach an ISR for a DMA channel and the thread dies & later on every thing will get managed in ISR ...
. 
can I do something like this(i.e. there is no InterruptWait call & DMA transfer is enabled & left. It runs till somebody
 disables the DMA transfer). Does it make sense & can I do this ?

Also if I get piece of code to understand this will be very helpful
Re: Queries related to InterruptAttach & InterruptAttachEvent  
On 01/19/11 08:53, Girisha SG wrote:
>
> If I register an interrupt handler using
> InterruptAttach/InterruptAttachEvent calls to each of the SDMA
> channels whenever they are created, is it necessary for me to use
> InterruptWait seperately for each channel ?
> If I can attach multiple ISR handlers(or same ISR for each channel)
> one for each channel In the main thread how will I get to know for
> which channel interrupt has been generated(so that InterruptWait got
> unblocked) ?
>
> Also if I want to attach an ISR for a DMA channel and the thread dies
> & later on every thing will get managed in ISR ....
> can I do something like this(i.e. there is no InterruptWait call & DMA
> transfer is enabled & left. It runs till somebody disables the DMA
> transfer). Does it make 
sense & can I do this ?
>
> Also if I get piece of code to understand this will be very helpful
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post82474
>

Hello,

The following online documentation provides a few examples for you:

http://www.qnx.com/developers/docs/6.5.0/index.jsp?topic=/com.qnx.doc.neutrino_prog/inthandler.html

To answer your questions:

1. You only need to call InterruptWait() once to service multiple
threads (like calling MsgReceive() from a thread in order to service
multiple requests from other threads/processes). The documentation above
recommends using a dedicated thread to handle any interrupt specific work.

2. While the ISR is running - nothing else can execute (unless I think
the target is a multicore) so you can not kill the thread. Basically the
ISR will run until it is done. Now I am not sure what would happen if
after the ISR finished and the event was sent out to unblock
InterruptWait() but the thread that was waiting died. I believe the ISR
event will reach the thread before any cancellation can occur...Testing
will tell though.
Re: Queries related to InterruptAttach & InterruptAttachEvent  
Thanks for the input.
If I attach multiple interrupt & use single InterruptWait, when ISR returns how would I know that which ISR got executed
 based on that I can take further actions ?

If I use InterruptAttachEvent function to attach the interrupts then can I consume lot of clocks before I call 
InterruptUnmask ? if no why & what happens if I do so ?
Re: Queries related to InterruptAttach & InterruptAttachEvent  
1) Since you check for the interrupt source in your isr, use a variable in your application to store the interrupt 
source so you can take further action after returning from the isr and before you go back to interruptwait.

2) If you do not unmask you effectively ignore any new interrupts and the longer you delay to service the requests the 
less responsive your process/application becomes.

Good luck!

----- Original Message -----
From: Girisha SG [mailto:community-noreply@qnx.com]
Sent: Thursday, January 20, 2011 01:13 AM
To: general-toolchain <post82492@community.qnx.com>
Subject: Re: Queries related to InterruptAttach & InterruptAttachEvent

Thanks for the input.
If I attach multiple interrupt & use single InterruptWait, when ISR returns how would I know that which ISR got executed
 based on that I can take further actions ?

If I use InterruptAttachEvent function to attach the interrupts then can I consume lot of clocks before I call 
InterruptUnmask ? if no why & what happens if I do so ?



_______________________________________________

General
http://community.qnx.com/sf/go/post82492