aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2021-12-27 20:40:44 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2021-12-27 20:40:44 +0200
commita12e50e5a7dae52ed8bd5a24cc6576371e20985b (patch)
tree70ddf625029dbe1ca4d38ec4f1819fe5fe7e4291 /arch
parentd98ec57128628b81fcd32269a92742a037b7f713 (diff)
downloadkmi-a12e50e5a7dae52ed8bd5a24cc6576371e20985b.tar.gz
kmi-a12e50e5a7dae52ed8bd5a24cc6576371e20985b.zip
Started work on syscalls
Diffstat (limited to 'arch')
-rw-r--r--arch/riscv/include/tcb.h9
-rw-r--r--arch/riscv/kernel/cpu.c6
-rw-r--r--arch/riscv/kernel/main.c8
3 files changed, 16 insertions, 7 deletions
diff --git a/arch/riscv/include/tcb.h b/arch/riscv/include/tcb.h
new file mode 100644
index 0000000..d1e0717
--- /dev/null
+++ b/arch/riscv/include/tcb.h
@@ -0,0 +1,9 @@
+#ifndef ARCH_RISCV_TCB_H
+#define ARCH_RISCV_TCB_H
+
+struct arch_tcbd {
+ /* empty for now, but should probably be filled with stuff like register
+ * saving of something */
+};
+
+#endif /* ARCH_RISCV_TCB_H */
diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c
new file mode 100644
index 0000000..34b7a32
--- /dev/null
+++ b/arch/riscv/kernel/cpu.c
@@ -0,0 +1,6 @@
+#include <apos/cpu.h>
+
+unsigned cpu_id()
+{
+ return 0; /* VERY MUCH TEMP */
+}
diff --git a/arch/riscv/kernel/main.c b/arch/riscv/kernel/main.c
index 1964514..e519697 100644
--- a/arch/riscv/kernel/main.c
+++ b/arch/riscv/kernel/main.c
@@ -144,7 +144,7 @@ static struct pm_layout_t setup_pmem(void *fdt)
/* mark init stack, at the moment always mapped to 2M */
mark_used(PM_STACK_BASE, MM_MPAGE);
- /* mark kernel, at the moment it is always mapped to a 2M partition */
+ /* mark kernel, at the moment with a 2M partition */
mark_used(PM_KERN, MM_MPAGE);
/* mark fdt and initrd */
@@ -269,12 +269,6 @@ static void init_proc(void *fdt, struct vm_branch_t *b)
__asm__("mv " QUOTE(reg) ", %0" :: "rK" (reg) : );\
}
-static void update_stack()
-{
- __va_reg(sp);
- __va_reg(gp);
-}
-
void __main main(void *fdt)
{
__va_reg(sp);