This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Dynamic assignment of ISR functions to interrupt vectors



I’ve got a question about dynamic ISR assignment in the 5502 DSP that we are using on our project.  We are mostly updating legacy code on this project, and in that code base there are ISR’s that are dynamically assigned using different methods in different locations.  In one location they are assigned using:

 

IRQ_plug() – This is declared in csl_irq.h

 

In another location they assigned are using:

HWI_dispatchPlug() – This is declared in the BIOS hwi.h

 

 

What is the difference between these, beyond the obvious that one uses the csl and the other uses the BIOS.  Code has been working for many years using a mix of both of these.  Is there danger in doing this?  If we standardize the code base to one over the other, which would be the better choice?

 

  • For a BIOS-based application it's definitely better to call HWI_dispatchPlug().  CSL is independent of BIOS, and while I don't exactly remember how it handles interrupts, I believe the IRQ_plug() API will utilize the CSL IRQ dispatcher (i.e., plug the IRQ vector with a call/argument to the CSL IRQ dispatcher, which in turn calls your function).

    HWI_dispatchPlug() uses the BIOS dispatcher, which allows nested interrupts and provides scheduling for "stuff" posted in the HWI-based ISR.  The CSL dispatcher, having no knowledge of BIOS, won't call the BIOS scheduler when it needs to be called, and probably doesn't allow nested interrupts.

    A function serviced by IRQ_plug() cannot make any BIOS scheduling calls, such as SEM_post() or SWI_post(), so it's not useful for triggering BIOS threads.

    I believe IRQ_plug() is really old - newer CSL releases (with "newer" not being very new, maybe 2 or 3 years old already) don't have that API.

    Regards,

    - Rob