summaryrefslogtreecommitdiff
path: root/supervisor/shared/stack.h
diff options
context:
space:
mode:
authorBenjamin Shockley <benjaminshockley@hotmail.com>2020-08-20 13:48:15 -0500
committerGitHub <noreply@github.com>2020-08-20 13:48:15 -0500
commit0084f0af24e4e219bc040c52ee723959423de6e2 (patch)
tree1aebdb362f08bf6417caa87836e3e4e739afc964 /supervisor/shared/stack.h
parent9aebe2f1efc99871fcf283c304e3a8700050d736 (diff)
parent4d7b9cde33934a44c4c905a49d2f831339fc8bd2 (diff)
Merge pull request #2 from adafruit/master
Master
Diffstat (limited to 'supervisor/shared/stack.h')
-rwxr-xr-xsupervisor/shared/stack.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/supervisor/shared/stack.h b/supervisor/shared/stack.h
index 3a5c18e7d..7096f0b3e 100755
--- a/supervisor/shared/stack.h
+++ b/supervisor/shared/stack.h
@@ -37,5 +37,14 @@ void stack_init(void);
void stack_resize(void);
void set_next_stack_size(uint32_t size);
uint32_t get_current_stack_size(void);
+bool stack_ok(void);
+
+// Use this after any calls into a library which may use a lot of stack. This will raise a Python
+// exception when the stack has likely overwritten a portion of the heap.
+void assert_heap_ok(void);
+
+#ifndef STACK_CANARY_VALUE
+#define STACK_CANARY_VALUE 0x017829ef
+#endif
#endif // MICROPY_INCLUDED_SUPERVISOR_STACK_H