#include <nitro/os.h>
OSStackStatus OS_GetIrqStackStatus( void );
None.
OS_STACK_OVERFLOW
— The magic number at the bottom of the stack is rewritten.OS_STACK_UNDERFLOW
— The magic number at the top of the stack is rewritten.OS_STACK_ABOUT_TO_OVERFLOW
— The warning level magic number set by the user is rewritten.
When none of the previous cases apply, returns OS_STACK_NO_ERROR
(defined as 0
).
Checks the stack used for IRQ mode for stack leaks and checks stack status.
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).
If the magic number at the bottom of the stack is overwritten, it returns OS_STACK_OVERFLOW
.
If the magic number at the top of the stack is overwritten, it returns OS_STACK_UNDERFLOW
.
If the magic number at the warning level set by the user in the stack is overwritten, it returns OS_STACK_ABOUT_TO_OVERFLOW
.
The stack is checked in this order so that OS_STACK_OVERFLOW
is returned when both the top and bottom of the stack are overwritten.
If none of these condition are met (none of the magic numbers have been overwritten), OS_STACK_NO_ERROR
is returned. OS_STACK_NO_ERROR
is defined as 0, so whether an error has occurred can be determined by whether the value is 0 or non-zero.
OS_SetIrqStackWarningOffset, OS_CheckIrqStack
2005/07/15 Initial version.
CONFIDENTIAL