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>CP_RestoreContext</title>
9<LINK rel="stylesheet" href="../css/nitro.css" type="text/css">
10</head>
11
12<body>
13
14<h1 align="left">CP_RestoreContext <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/cp.h&gt;</CODE><BR>
20  <dd><CODE>void CP_RestoreContext( CPContext* context );</CODE></dd>
21</dd>
22</dl>
23
24<h2>Arguments</h2>
25<p>Pointer to the context structure for the divider or square root calculator that you want to restore.</p>
26
27<h2>Return Values</h2>
28<p>None.</p>
29
30<H2>Description</H2>
31<P>This function restores divider and square root calculator status (context) that was saved by the <CODE><A href="CP_SaveContext.html">CP_SaveContext</A></CODE> function.</P>
32<P>
33When you use a divider or square root calculator inside an interrupt, use these functions to save the context of the divider or square root calculator before use.<BR>The absolute minimum amount of weighted processing necessary is performed to restore original status inside this function.
34</P>
35
36<P>During thread switch, the context are also automatically switched. Therefore, there is no need for this function to explicitly run a save process.</P>
37
38<BLOCKQUOTE style="background-color : #eeeeee;">
39<B>Example</B> Using a divider/square root calculator inside an interrupt<BR>
40<P><CODE>void intr_func( void ) <BR> {<BR> CPContext context;<BR> <BR> CP_SaveContext( &amp;context );<BR> CP_SetDiv32_32( 1000, 5 );<BR> CP_WaitDiv();<BR> result = CP_GetDivResult();<BR> CP_RestoreContext( &amp;context );<BR> }</CODE></P>
41</BLOCKQUOTE>
42
43
44<h2>See Also</h2>
45<p><CODE><A href="CP_SaveContext.html">CP_SaveContext</A>, <A href="div/CP_SetDiv.html">CP_SetDiv*</A>, <A href="sqrt/CP_SetSqrt.html">CP_SetSqrt*</A></CODE></p>
46
47<H2>Revision History</H2>
48<P>2006/08/09 Added a sample code fragment and revised the description in line with the change that it is no longer necessary to wait for status to finish being restored.<BR> 2004/05/06 Initial version.</P>
49<hr><p>CONFIDENTIAL</p></body>
50</html>
51