aboutsummaryrefslogtreecommitdiff
path: root/include/cpu.h
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/cpu.h
parent98793badc1c1d3e4bfd735fdecd3d2d731701ab3 (diff)
Thread yield control to any other threads
Diffstat (limited to 'include/cpu.h')
-rw-r--r--include/cpu.h5
1 files changed, 3 insertions, 2 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