aboutsummaryrefslogtreecommitdiff
path: root/src/sys
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-01-21 13:01:58 -0700
committerChristian Cunningham <cc@localhost>2022-01-21 13:01:58 -0700
commit367e20fa0c6f15e60d943cf222d41414fffd2318 (patch)
tree0ebd3266233eb49afeb42d84d97b9a7c93ea60eb /src/sys
parented7b9318bc9ac285250b117f87f47fe7f84af51b (diff)
Added scheduling logic
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/schedule.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/sys/schedule.c b/src/sys/schedule.c
index 0dc89e9..3aca0ff 100644
--- a/src/sys/schedule.c
+++ b/src/sys/schedule.c
@@ -1,5 +1,22 @@
+#include <globals.h>
+#include <sys/schedule.h>
+
void init_scheduler(void)
{
// Set rthread to usrloopthread - an infinitely running thread so that the pointer will never be null
+ usrloopthread.pc = (void*)loop;
+ usrloopthread.sp = 0x0FCC;
+ usrloopthread.sp_base = 0x1000;
+ usrloopthread.mptr = 0;
+ usrloopthread.pid = -1;
+ usrloopthread.priority = -1;
+ usrloopthread.status = THREAD_READY;
+ scheduler.rthread = &usrloopthread;
// Initialize Rotating Buffers
}
+
+void loop(void)
+{
+ while(1)
+ asm volatile ("wfe");
+}