OS_SetIrqCheckFlag


C Specification

#include <nitro/os.h>

void OS_SetIrqCheckFlag( OSIrqMask intr );

Description

Sets a check flag for IRQ interrupts

Normally, this flag is called by the handler for each interrupt. When individual interrupt processes finish, the check flag is set to indicate that this function has been called by the interrupt. For example, the function that is called by a V-Blank interrupt will be: OS_SetIrqCheckFlag( OS_IE_V_BLANK ); and a check flag is set. The table below describes these flags.

The flag set here is used to check whether or not an interrupt occurred with OS_WaitIntr(), OS_WaitInterrupt(), or SVC_WaitVBlankIntr(). Therefore, if there are interrupts that do not wait with those functions, the flags will not be used from anywhere even if they are set, so they do not necessarily have to be set. But if you carry out separate processes for each situation you may forget to write them when they are necessary. It is recommended that you always set the flags for interrupts if doing this creates no problems.

If OS_WaitIntr(), OS_WaitInterrupt(), and/or SVC_WaitVBlankIntr() are carried out for the same interrupt with multiple threads, be aware that a restore can only be performed with one of these threads for one interrupt.

OS_IE_V_BLANK V-Blank Interrupt
OS_IE_H_BLANK H-Blank Interrupt
OS_IE_V_COUNT V Counter Interrupt
OS_IE_TIMER0 Timer 0 Interrupt
OS_IE_TIMER1 Timer 1 Interrupt
OS_IE_TIMER2 Timer 2 Interrupt
OS_IE_TIMER3 Timer 3 Interrupt
OS_IE_DMA0 DMA0 Interrupt
OS_IE_DMA1 DMA1 Interrupt
OS_IE_DMA2 DMA2 Interrupt
OS_IE_DMA3 DMA3 Interrupt
OS_IE_KEY Key Interrupt
OS_IE_CARTRIDGE Cartridge IREQ/DREQ Interrupt
OS_IE_SUBP ARM7 Interrupt
OS_IE_SPFIFO_SEND Send FIFO empty interrupt between ARM9 and ARM7
OS_IE_SPFIFO_RECV Receive FIFO not empty interrupt between ARM9 and ARM7
OS_IE_CARD_DATA Card Data Transfer End Interrupt
OS_IE_CARD_IREQ Card IREQ Interrupt
OS_IE_GXFIFO Geometry Command FIFO Interrupt

Internal Operation

On the ARM9, the predetermined location (DTCM_END - 8) in DTCM is designated to be the check flag region. This function operates in that region.

In the ARM7, the predetermined location of the ARM7 WRAM (highest address - 8) is designated to be the check flag region. The function operates on this region.

Arguments

intr The IRQ interrupt cause to be enabled (expressed as a logical sum)

Return Values

None

See Also

OS_ClearIrqCheckFlag, OS_GetIrqCheckFlag

Revision History

11/24/2004 Deleted OS_IE_SIO
11/02/2004 Removed SVC_WaitIntr() from the "See Also" section.
09/01/2004 Changed "subprocessor" to "ARM7" and "between subprocessors" to "between ARM9 and ARM7".
04/22/2004 Added a caution about using this function with multiple threads.
01/09/2004 Initial version