OS_GetProcMode

Syntax

#include <nitro/os.h>

OSProcMode OS_GetProcMode( void );

Arguments

None.

Return Values

Returns an OSProcMode enumerated type that indicates the current operating mode of the ARM processor.

Description

This function returns the current ARM Processor operation mode.

The return value is an OSProcMode enumerated type, and will be one of the following:

Value Operating Modes
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).

See Also

None.

Revision History

2003/12/01 Initial version.


CONFIDENTIAL