1
0
mirror of https://github.com/raphnet/gc_n64_usb-v3 synced 2024-12-21 14:58:51 -05:00
gc_n64_usb-v3/stkchk.h
Raphael Assenat b22985712f Add stack overgrow detection
If the stack ever grows too large (and starts overwriting variables
in .bss) the firmware jumps into the bootloader. This is better than
just continuing to run with strange side effects.
2017-01-08 15:14:55 -05:00

17 lines
285 B
C

#ifndef _stkchk_h__
#define _stkchk_h__
#undef STKCHK_WITH_STATUS_CHECK
#ifdef STKCHK_WITH_STATUS_CHECK
#define stkcheck() stkchk(__FUNCTION__);
void stkchk(const char *label);
#else
#define stkcheck()
#endif
void stkchk_init(void);
char stkchk_verify(void);
#endif // _stkchk_h__