1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows">
6<META http-equiv="Content-Style-Type" content="text/css">
7<TITLE>OS_GetResetParameter</TITLE>
8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
9</HEAD>
10<BODY>
11<H1 align="left">OS_GetResetParameter <img src="../../image/TWL.gif" align="middle"><img src="../../image/NTR.gif" align="middle"></H1>
12<H2>Syntax</H2>
13<DL>
14<DD><CODE>#include &lt;nitro/os.h&gt;</CODE><BR> <BR> <CODE>u32 OS_GetResetParameter( void );</CODE>
15</DL>
16<H2>Arguments</H2>
17<P>None.</P>
18<H2>Return Values</H2>
19<P>The value of the reset parameter. This function returns 0 from the time that power is turned on until the <CODE>OS_ResetSystem</CODE> function is called.</P>
20<H2>Description</H2>
21<P>Obtains the reset parameter value.</P>
22<P>The reset parameter is the value that is provided by the parameter argument of the most recent <CODE><A href="OS_ResetSystem.html"><code>OS_ResetSystem</code></A></CODE> function. This function returns 0 from the time that power is turned on until the <CODE>OS_ResetSystem</CODE> function is called.</P>
23<P><BR> <B>Example:</B></P>
24<BLOCKQUOTE style="background-color:#ffffd0;">
25<BLOCKQUOTE><CODE>u32 n;<BR> NitroMain()<BR> {<BR> :<BR>n = <FONT color="#ff0000">OS_GetResetParameter();</FONT><BR> OS_Printf( &quot;%d\n&quot;, n );<BR> :<BR><FONT color="#ff0000">OS_ResetSystem( n + 1 );</FONT><BR> }</CODE></BLOCKQUOTE>
26</BLOCKQUOTE>
27<P>In the above example, 0 will be displayed first. Each reset after that will display 1, 2, 3 .... and so on.</P>
28<H2>Internal Operation</H2>
29<P>The reset parameter is held in the 4-byte region that comes after <CODE>HW_RESET_PARAMETER_BUF</CODE>. The 4-byte region is placed in the system shared region and is not cleared by a reset. This function reads and returns the value in this region.<br />The <CODE><A href="OS_ResetSystem.html">OS_ResetSystem</A></CODE> function can only be called when the system is in NITRO mode, so this function always returns 0 if called in TWL mode.
30</P>
31<H2>See Also</H2>
32<P><A href="OS_InitReset.html"><code>OS_InitReset</code></A><BR> <A href="OS_ResetSystem.html"><code>OS_ResetSystem</code></A></P>
33<H2>Revision History</H2>
34<P>
352009/06/08 Explained that <CODE>OS_ResetSystem</CODE> is only functional in NITRO mode.<BR>2004/09/01 Initial version.</P>
36<hr><p>CONFIDENTIAL</p></body>
37</HTML>