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.

TMS320F28335: SYS/BIOS Hwi_disable

Part Number: TMS320F28335

Hi,

if I have block:

key = Hwi_disable();

...

block of code

...

Hwi_restore(key);

Can occure any situation where scheduler preempt this block? Mention that I do not use any Swi_post or Semaphore or somethink like this in this block. Can be triggered Clock or somethink like this? Is there any hardware trigger which is not disable (mention mask is not used while configuration)?

 

  • Hi Krystof,

    The Hwi_disable/Hwi_restore block disables all kernel managed interrupts (the timer for the Clock included). It does not disable "zero-latency" interrupts. Look here for more details on what a "zero-latency" interrupt is: http://processors.wiki.ti.com/index.php/SYS/BIOS_for_the_28x#Minimal_Latency_Interrupts

    We generally don't recommend doing too much in a disable/restore block because the interrupt latency that can occur. We also don't recommend doing things like Swi_post or Semaphore_post in a disable/restore block for two reasons

    1. The number of cycles to execute these APIs are relatively high and makes the disable/restore block longer...thus larger interrupt latency. For example, Semaphore_post with a pending task (but no context switch) is 203 cycles on a TMS320F280049M. I'm using the TMS320F280049M since we used it for the benchmarks we publish in the SYS/BIOS product (look in the SYS/BIOS release notes for the link).

    2. Even though interrupts are disabled, if a lower priority thread calls Swi_post or Semaphore_post and that readies a higher priority thread, the scheduler will move to that higher priority thread.

    Does this answer your question?

    Todd

  • Hi Todd,

    thanks a lot. That is exactly what I need to know.

    Krystof.