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_SaveContext</title> 9<LINK rel="stylesheet" href="../css/nitro.css" type="text/css"> 10</head> 11 12<body> 13 14<h1 align="left">CP_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 <nitro/cp.h></CODE><BR> 20 </dd> 21 <dd><CODE>void CP_SaveContext( CPContext* context );</CODE></dd> 22</dl> 23 24<h2>Arguments</h2> 25<p>Pointer to the region where the divider, square root calculator context will be stored.</p> 26 27<h2>Return Values</h2> 28<p>None.</p> 29 30<H2>Description</H2> 31<P>This function stores the status (context) for the current divider and square root calculator in a specified structure.</P> 32<P> 33The <CODE><A href="CP_RestoreContext.html">CP_RestoreContext</A></CODE> function can be used to restore the saved context.<BR>When you use a divider or square root calculator inside an interrupt, save the divider and square root calculator contexts prior to their use by these functions.</P> 34<P> 35During thread switch, the context are also automatically switched. Therefore, there is no need for this function to explicitly run a save process.</P> 36 37<BLOCKQUOTE style="background-color : #eeeeee;"> 38<B>Example</B> Using a divider/square root calculator inside an interrupt<BR> 39<P><CODE>void intr_func( void ) <BR> {<BR> CPContext context;<BR> <BR> CP_SaveContext( &context );<BR> CP_SetDiv32_32( 1000, 5 );<BR> CP_WaitDiv();<BR> result = CP_GetDivResult();<BR> CP_RestoreContext( &context );<BR> }</CODE></P> 40</BLOCKQUOTE> 41 42 43<h2>See Also</h2> 44<p><CODE><A href="CP_RestoreContext.html">CP_RestoreContext</A>, <A href="div/CP_SetDiv.html">CP_SetDiv*</A>, <A href="sqrt/CP_SetSqrt.html">CP_SetSqrt*</A></CODE></p> 45 46<H2>Revision History</H2> 47<P>2006/08/09 Added sample code segment.<br> 2004/05/06 Initial version.</P> 48<hr><p>CONFIDENTIAL</p></body> 49</html> 50