OS_RestoreInterrupts

Syntax

#include <nitro/os.h>

OSIntrMode OS_RestoreInterrupts( OSIntrMode state );

Arguments

state Interrupt state to set.
OSIntrMode is a u32 typedef.

Return Values

Returns a value that indicates the state before this function was called.

The type of the return value is OSIntrMode (a u32 typedef), but the values that can be returned will be one of the OSIntrMode_Irq enumerated type values below.

Value Previous state
OS_INTRMODE_IRQ_DISABLE IRQ Disable (prohibited)
OS_INTRMODE_IRQ_ENABLE IRQ Enable (permitted)

Description

This function sets the interrupt state.

It takes the interrupt state given by state. The state given is expressed as an OSIntrMode_Irq enumerated type. If OS_INTRMODE_IRQ_ENABLE is specified, the interrupts will be enabled, and if OS_INTRMODE_IRQ_DISABLE is specified, the interrupts will be disabled.

However, it is expected that the state parameter will often be used primarily to restore the previous state by specifying to it the return value of the OS_EnableInterrupts or OS_DisableInterrupts function.

The return value indicates the state prior to calling the function.


Example

OSIntrMode e = OS_DisableInterrupts();

// Interrupts are disabled here

(void)OS_RestoreInterrupts( e );

Internal Operation

Sets/resets the CPSR (current program status register) IRQ interrupt control bit.

See Also

OS_EnableInterrupts, OS_DisableInterrupts

Revision History

2005/03/08 Standardized the Japanese term for "interrupt."
2004/03/04 Changed so FIQ is not included in processing.
2004/01/14 Changed so FIQ is included in processing.
2003/12/01 Initial version.


CONFIDENTIAL