# OS_GetProcMode

## C Specification

  `#include <nitro/os.h>`
  `OSProcMode OS_GetProcMode( void );`

## Description

This function returns the current ARM Processor operation mode. The following is the `OSProcMode` list type.

`OS_PROCMODE_USER` | User mode
`OS_PROCMODE_FIQ` | FIQ mode
`OS_PROCMODE_IRQ` | IRQ mode
`OS_PROCMODE_SVC` | Supervisor mode
`OS_PROCMODE_ABORT` | Abort mode
`OS_PROCMODE_UNDEF` | Undefined mode
`OS_PROCMODE_SYS` | System mode

> (Example)

>     OSProcMode mode = OS_GetProcMode();
>     if ( mode == OS_PROCMODE_USER )
>     {
>        OS_Printf( "current processor mode is USERMODE.\n");
>     }

## Internal Operation

Gets the current processor mode from the CPSR (current program status register).

## Arguments

None

## Return Values

Returns current ARM processor operation mode.

## See Also

## Revision History

12/01/2003 Initial Version