aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv64/kernel/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/riscv64/kernel/cpu.c')
-rw-r--r--arch/riscv64/kernel/cpu.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/riscv64/kernel/cpu.c b/arch/riscv64/kernel/cpu.c
index 91b39b6..966dfec 100644
--- a/arch/riscv64/kernel/cpu.c
+++ b/arch/riscv64/kernel/cpu.c
@@ -6,6 +6,11 @@
#include <apos/tcb.h>
#include <arch/cpu.h>
+void cpu_assign(struct tcb *t)
+{
+ __asm__ volatile ("mv tp, %0\n" : : "r" (t) :);
+}
+
id_t cpu_id()
{
/* yes, slightly weird situation where cur_tcb() call cpu_id() which