aboutsummaryrefslogtreecommitdiff
path: root/src/sys
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/schedule.S4
-rw-r--r--src/sys/schedule.c1
2 files changed, 5 insertions, 0 deletions
diff --git a/src/sys/schedule.S b/src/sys/schedule.S
index aa55ac2..dba8bd4 100644
--- a/src/sys/schedule.S
+++ b/src/sys/schedule.S
@@ -63,6 +63,10 @@ cleanup:
bl get_rthread_roffset
ldr r1, [r0, #0]
add r1, #1
+ cmp r1, #0x100 /* TQUEUE_MAX */
+ blo 1f
+ mov r1, #0
+1:
str r1, [r0, #0]
// cleanup stack
svc #3
diff --git a/src/sys/schedule.c b/src/sys/schedule.c
index 0e9df78..6f2a72d 100644
--- a/src/sys/schedule.c
+++ b/src/sys/schedule.c
@@ -1,3 +1,4 @@
+#include <cpu.h>
#include <globals.h>
#include <graphics/lfb.h>
#include <drivers/uart.h>