# OS_RestoreInterrupts_IrqAndFiq

## Syntax

  `#include <nitro/os.h>`
  `OSIntrMode OS_RestoreInterrupts_IrqAndFiq( 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 return value type is `OSIntrMode` (a `u32` typedef), but the return value will be the logical sum of the `OSIntrMode_Irq` and `OSIntrMode_Fiq` enumerated types.
The `OSIntrMode_Irq` enumerated type:

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

The `OSIntrMode_Fiq` enumerated type:

Value | Previous State
--- | ---
`OS_INTRMODE_FIQ_DISABLE` | FIQ Disable (prohibited)
`OS_INTRMODE_FIQ_ENABLE` | FIQ Enable (permitted)

## Description

Sets the interrupt state.

It takes the interrupt state given by `state`. The state given is the logical sum of the IRQ status expressed in the `OSIntrMode_Irq` enumerated type and the FIQ status expressed in the `OSIntrMode_Fiq` enumerated type.

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_IrqAndFiq` or `OS_DisableInterrupts_IrqAndFiq` function.

These return values represent the states prior to calling these functions.

Example:

> `OSIntrMode e = OS_DisableInterrupts_IrqAndFiq();
> // Interrupts are disabled here
> (void)OS_RestoreInterrupts_IrqAndFiq( e );`

## Internal Operation

The CPSR register (current program status register) IRQ and FIQ interrupt control bits are set/reset.

## See Also

`OS_EnableInterrupts_IrqAndFiq`
`OS_DisableInterrupts_IrqAndFiq`
`OS_RestoreInterrupts`

## Revision History

2005/03/08 Standardized the Japanese word for "interrupt".
2004/03/04 Moved from the `OS_RestoreInterrupts` function.

CONFIDENTIAL