aboutsummaryrefslogtreecommitdiff
path: root/src/sys/schedule.c
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-02-19 13:40:17 -0700
committerChristian Cunningham <cc@localhost>2022-02-19 13:40:17 -0700
commit9de5e07bc3920d4b03903eb5b78847973075059b (patch)
treecd0c23664beccb4c53f532650d94b722dec5f453 /src/sys/schedule.c
parent5419a7174ef491427797196903c35ce921129f27 (diff)
Added comments and cleanup
Diffstat (limited to 'src/sys/schedule.c')
-rw-r--r--src/sys/schedule.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/sys/schedule.c b/src/sys/schedule.c
index dd59891..347b91a 100644
--- a/src/sys/schedule.c
+++ b/src/sys/schedule.c
@@ -42,8 +42,10 @@ void init_scheduler(void)
struct RStack get_stack(void)
{
struct RStack r = {.sp = 0, .idx = -1};
+ // Find an available stack
for (int i = 0; i < MAX_THREADS; i++) {
if (stacks_table[i] == 0) {
+ // Mark unavailable
stacks_table[i] = 1;
r.idx = i;
r.sp = (void*)0x20000000 - STACK_SIZE*i;