123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- #ifndef __ALT_STACK_H__
- #define __ALT_STACK_H__
- #include "nios2.h"
- #include "alt_types.h"
- #ifdef __cplusplus
- extern "C"
- {
- #endif
- extern char * alt_stack_limit_value;
- #ifdef ALT_EXCEPTION_STACK
- extern char __alt_exception_stack_pointer[];
- #endif
- static ALT_INLINE char * ALT_ALWAYS_INLINE alt_stack_limit (void)
- {
- char * limit;
- NIOS2_READ_ET(limit);
- return limit;
- }
- static ALT_INLINE char * ALT_ALWAYS_INLINE alt_stack_pointer (void)
- {
- char * pointer;
- NIOS2_READ_SP(pointer);
- return pointer;
- }
- #ifdef ALT_EXCEPTION_STACK
- static ALT_INLINE char * ALT_ALWAYS_INLINE alt_exception_stack_pointer (void)
- {
- return (char *) *(alt_u32 *)(__alt_exception_stack_pointer - sizeof(alt_u32));
- }
- #endif
- static ALT_INLINE void ALT_ALWAYS_INLINE alt_set_stack_limit (char * limit)
- {
- alt_stack_limit_value = limit;
- NIOS2_WRITE_ET(limit);
- }
- static ALT_INLINE void ALT_ALWAYS_INLINE alt_report_stack_overflow (void)
- {
- NIOS2_REPORT_STACK_OVERFLOW();
- }
- #ifdef __cplusplus
- }
- #endif
- #endif
|