aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-02-01 20:36:30 -0700
committerChristian Cunningham <cc@localhost>2022-02-01 20:36:30 -0700
commit7d3884b5cfc282dbdfe5d9a22d8b2b343280b8af (patch)
treea3e5e5376c35cce48d1e2d907720646448c5e2ba /include
parent98793badc1c1d3e4bfd735fdecd3d2d731701ab3 (diff)
Thread yield control to any other threads
Diffstat (limited to 'include')
-rw-r--r--include/cpu.h5
-rw-r--r--include/sys/schedule.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/include/cpu.h b/include/cpu.h
index c15c086..bac80e8 100644
--- a/include/cpu.h
+++ b/include/cpu.h
@@ -91,11 +91,12 @@ __attribute__((always_inline)) static inline unsigned long long get_sys_time(voi
}s;
unsigned long long llv;
}t;
- asm volatile("svc #1\nmov %0, r0\nmov %0, r1" : "=r"(t.s.lo), "=r"(t.s.hi));
+ asm volatile("svc #1\nmov %0, r1\nmov %1, r0" : "=r"(t.s.lo), "=r"(t.s.hi));
return t.llv;
}
-#define SYS_SCHED 2
+#define SYS_YIELD 0
#define SYS_TIME 1
+#define SYS_SCHED 2
#endif
diff --git a/include/sys/schedule.h b/include/sys/schedule.h
index 4d331a6..cb784c5 100644
--- a/include/sys/schedule.h
+++ b/include/sys/schedule.h
@@ -64,6 +64,6 @@ struct Thread* next_thread(void);
/// to user mode then calls the SVC call
extern void schedule(void);
extern void cleanup(void);
-// void yield(void);
+void yield(void);
#endif