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_GetIrqStackStatus</TITLE> 8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css"> 9</HEAD> 10<BODY> 11<H1 align="left">OS_GetIrqStackStatus <IMG src="../../image/NTR.gif" align="middle"><IMG src="../../image/TWL.gif" align="middle"></H1> 12<H2>Syntax</H2> 13<DL> 14 <DD> 15 <PRE><CODE>#include <nitro/os.h></CODE></PRE> 16 <PRE><CODE>OSStackStatus OS_GetIrqStackStatus( void ); 17 </CODE></PRE> 18</DL> 19<H2>Arguments</H2> 20<P>None.</P> 21<H2>Return Values</H2> 22<P><code>OS_STACK_OVERFLOW</code> — The magic number at the bottom of the stack is rewritten.<br /><code>OS_STACK_UNDERFLOW</code> — The magic number at the top of the stack is rewritten.<br /><code>OS_STACK_ABOUT_TO_OVERFLOW</code> — The warning level magic number set by the user is rewritten.</P> 23<P>When none of the previous cases apply, returns <code>OS_STACK_NO_ERROR</code> (defined as <code>0</code>).</P> 24<H2>Description</H2> 25<P>Checks the stack used for IRQ mode for stack leaks and checks stack status.</P> 26<P>This function checks a magic number that is preset in the top and bottom (in addition, a warning level if set by the user) of the stack, to see whether it is overwritten (if that portion is ever used).</P> 27<P>If the magic number at the bottom of the stack is overwritten, it returns <code>OS_STACK_OVERFLOW</code>.<br />If the magic number at the top of the stack is overwritten, it returns <code>OS_STACK_UNDERFLOW</code>.<br />If the magic number at the warning level set by the user in the stack is overwritten, it returns <code>OS_STACK_ABOUT_TO_OVERFLOW</code>.</P> 28<P>The stack is checked in this order so that <code>OS_STACK_OVERFLOW</code> is returned when both the top and bottom of the stack are overwritten. </P> 29<P>If none of these condition are met (none of the magic numbers have been overwritten), <CODE>OS_STACK_NO_ERROR</CODE> is returned. <CODE>OS_STACK_NO_ERROR</CODE> is defined as 0, so whether an error has occurred can be determined by whether the value is 0 or non-zero.</P> 30 31<H2>See Also</H2> 32<P><CODE><A href="OS_SetIrqStackWarningOffset.html">OS_SetIrqStackWarningOffset</A>, <A href="OS_CheckIrqStack.html">OS_CheckIrqStack</A><BR></CODE></P> 33<H2>Revision History</H2> 34<P>2005/07/15 Initial version.</P> 35<hr><p>CONFIDENTIAL</p></body> 36</HTML>