Real-Time Embedded Multithreading: Using ThreadX and ARM

Enables and disables interrupts
UINT <b class="bold">tx_interrupt_control</b>(UINT <b class="bold">new_posture</b>)
This service enables or disables interrupts as specified by the parameter new_posture.
| Note | If this service is called from an application thread, the interrupt posture remains part of that thread s context. For example, if the thread calls this routine to disable interrupts and then suspends, when it is resumed, interrupts are disabled again. |
| Note | Do not use this service to enable interrupts during initialization! Doing so could cause unpredictable results. |
| new_posture1 | This parameter specifies whether interrupts are disabled or enabled. Legal values include TX_INT_DISABLE and TX_INT_ENABLE. The actual values for this parameter are port-specific. In addition, some processing architectures might support additional interrupt disable postures. |
| previous posture | This service returns the previous interrupt posture to the caller. This allows users of the service to restore the previous posture after interrupts are disabled. |
Threads, timers, and ISRs
No
UINT my_old_posture;/* Lockout interrupts */my_old_posture = <b class="bold">tx_interrupt_control</b>(TX_INT_DISABLE);/* Perform critical operations that need interrupts locked-out.. *//* Restore previous interrupt lockout posture. */<b class="bold">tx_interrupt_control</b>(my_old_posture);
[83]This value is processor-specific and is defined in the file tx_port.h. This value typically maps directly to the interrupt lockout/enable bits in the processor s status register. The user must take care in selecting an appropriate value for new_posture. For the ARM processor, TX_INT_DISABLE corresponds to 0xC0 if both IRQ and FIQ interrupts are supported. If only IRQ interrupts are sup ported, the value is 0x80.