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_SaveContext</title>
9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
10</head>
11
12<body>
13
14<h1 align="left">OS_SaveContext <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>BOOL OS_SaveContext( OSContext* context );</CODE></dd>
22</dl>
23<h2>Arguments</h2>
24<TABLE border="1" width="100%">
25  <TBODY>
26    <TR>
27      <TD width="13%"><EM><STRONG>context</STRONG></EM></TD>
28      <TD width="87%">Context</TD>
29    </TR>
30  </TBODY>
31</TABLE>
32
33<h2>Return Values</h2>
34<p>A value of &quot;0&quot; indicates that it will return after the context is stored. A value of &quot;1&quot; indicates that it will return to this function after the context is swapped.</p>
35
36<H2>Description</H2>
37<P>This function stores the current context in the specified context structure, and is used for swapping context in the thread system. &nbsp;</P>
38<P>When the current thread switches to the previously stored context, the execution location is directly after when the context was stored. However, it is unclear in this case whether it is returning from this function after restarting or is returning after only being saving.</P>
39<P>For this reason, measures are in place to handle the return value from the <CODE>OS_SaveContext</CODE> function. The function returns with &quot;0,&quot; but &quot;1&quot; is stored as <code>R0</code>. By doing so, when the context is swapped, the return value (R0) becomes &quot;1&quot; and this can be distinguished from a function call that only stores.</P>
40<P>Refer to <A href="OS_InitContext.html"><code>OS_InitContext()</code></A> for details.</P>
41<h2>See Also</h2>
42<p><CODE><A href="OS_InitContext.html">OS_InitContext</A>, <A href="OS_LoadContext.html">OS_LoadContext</A>, <A href="OS_DumpContext.html">OS_DumpContext</A><br></CODE></p>
43<H2>Revision History</H2>
44<P>2003/12/01 Initial version.</P>
45<hr><p>CONFIDENTIAL</p></body>
46</html>
47