Real-Time Embedded Multithreading: Using ThreadX and ARM

Appendix D: Interrupt Control Service

tx_interrupt_control

Enables and disables interrupts

Prototype

UINT <b class="bold">tx_interrupt_control</b>(UINT <b class="bold">new_posture</b>)

Description

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.

Input Parameter [83]

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.

Return Values

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.

Allowed From

Threads, timers, and ISRs

Preemption Possible

No

Example

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.

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: VME, VPX, and VXI Controllers and Processors
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.