1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows">
7<META http-equiv="Content-Style-Type" content="text/css">
8<title>OS_GetProcMode</title>
9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
10</head>
11
12<body>
13
14<h1 align="left">OS_GetProcMode <img src="../../image/NTR.gif" align="middle"><img src="../../image/TWL.gif" align="middle"></h1>
15<h2>Syntax</h2>
16
17<dl>
18  <dd>
19<CODE>#include &lt;nitro/os.h&gt;</CODE><BR>
20  <BR>
21  <CODE>OSProcMode OS_GetProcMode( void );</CODE></dd>
22</dl>
23
24<h2>Arguments</h2>
25<P>None.</P>
26
27<h2>Return Values</h2>
28<p>Returns an <CODE>OSProcMode</CODE> enumerated type that indicates the current operating mode of the ARM processor.</p>
29<H2>Description</H2>
30<P>This function returns the current ARM Processor operation mode.</P>
31<P>The return value is an <CODE>OSProcMode</CODE> enumerated type, and will be one of the following:<BR>
32</P>
33<TABLE>
34  <TBODY>
35    <TR>
36      <TH>Value</TH>
37      <TH>Operating Modes</TH>
38    </TR>
39    <TR>
40      <TD bgcolor="#eeeeee">OS_PROCMODE_USER</TD>
41      <TD bgcolor="#eeeeee">User mode</TD>
42    </TR>
43    <TR>
44      <TD bgcolor="#eeeeee">OS_PROCMODE_FIQ</TD>
45      <TD bgcolor="#eeeeee">FIQ mode</TD>
46    </TR>
47    <TR>
48      <TD bgcolor="#eeeeee">OS_PROCMODE_IRQ</TD>
49      <TD bgcolor="#eeeeee">IRQ mode</TD>
50    </TR>
51    <TR>
52      <TD bgcolor="#eeeeee">OS_PROCMODE_SVC</TD>
53      <TD bgcolor="#eeeeee">Supervisor mode</TD>
54    </TR>
55    <TR>
56      <TD bgcolor="#eeeeee">OS_PROCMODE_ABORT</TD>
57      <TD bgcolor="#eeeeee">Abort mode</TD>
58    </TR>
59    <TR>
60      <TD bgcolor="#eeeeee">OS_PROCMODE_UNDEF</TD>
61      <TD bgcolor="#eeeeee">Undefined mode</TD>
62    </TR>
63    <TR>
64      <TD bgcolor="#eeeeee">OS_PROCMODE_SYS</TD>
65      <TD bgcolor="#eeeeee">System mode</TD>
66    </TR>
67  </TBODY>
68</TABLE>
69<P><BR> <BR> <B>Example</B></P>
70<BLOCKQUOTE style="background-color:#ffffd0;"><CODE>OSProcMode mode = OS_GetProcMode();<BR> if ( mode == OS_PROCMODE_USER )<BR> {<BR> OS_Printf( &quot;current processor mode is USERMODE.\n&quot;);<BR> }</CODE></BLOCKQUOTE>
71
72<h2>Internal Operation</h2>
73<p>Gets the current processor mode from the CPSR (current program status register).</p>
74
75<h2>See Also</h2>
76<p><CODE>None.<br></CODE></p>
77
78<H2>Revision History</H2>
79<P>2003/12/01 Initial version.</P>
80<hr><p>CONFIDENTIAL</p></body>
81</html>
82