aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv64/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/riscv64/kernel')
-rw-r--r--arch/riscv64/kernel/main.c1
-rw-r--r--arch/riscv64/kernel/pmem.c1
-rw-r--r--arch/riscv64/kernel/power.c6
-rw-r--r--arch/riscv64/kernel/proc.c10
4 files changed, 10 insertions, 8 deletions
diff --git a/arch/riscv64/kernel/main.c b/arch/riscv64/kernel/main.c
index 01b8957..c6b5e4a 100644
--- a/arch/riscv64/kernel/main.c
+++ b/arch/riscv64/kernel/main.c
@@ -6,6 +6,7 @@
* riscv64 main
*/
+#include <kmi/syscalls.h>
#include <kmi/utils.h>
#include <arch/arch.h>
#include "csr.h"
diff --git a/arch/riscv64/kernel/pmem.c b/arch/riscv64/kernel/pmem.c
index 56769c6..36f0284 100644
--- a/arch/riscv64/kernel/pmem.c
+++ b/arch/riscv64/kernel/pmem.c
@@ -6,6 +6,7 @@
* riscv64 implementation of arch-specific physical memory handling
*/
+#include <kmi/syscalls.h>
#include <arch/pmem.h>
stat_t stat_pmem_conf(void *fdt, size_t *max_order, size_t *base_bits,
diff --git a/arch/riscv64/kernel/power.c b/arch/riscv64/kernel/power.c
index 21e4957..2238eb1 100644
--- a/arch/riscv64/kernel/power.c
+++ b/arch/riscv64/kernel/power.c
@@ -34,15 +34,15 @@ stat_t poweroff(enum poweroff_type type)
/** \todo this only shuts down the cpu itself, but may leave the SOC
* active. Should read from fdt poweroff and syscon-poweroff etc */
switch (type) {
- case SHUTDOWN:
+ case SYS_SHUTDOWN:
sbi_system_reset(SBI_SHUTDOWN, SBI_NO_REASON);
return ERR_MISC;
- case COLD_REBOOT:
+ case SYS_COLD_REBOOT:
sbi_system_reset(SBI_COLD_REBOOT, SBI_NO_REASON);
return ERR_MISC;
- case WARM_REBOOT:
+ case SYS_WARM_REBOOT:
sbi_system_reset(SBI_WARM_REBOOT, SBI_NO_REASON);
return ERR_MISC;
};
diff --git a/arch/riscv64/kernel/proc.c b/arch/riscv64/kernel/proc.c
index 19bd52f..aa33ec7 100644
--- a/arch/riscv64/kernel/proc.c
+++ b/arch/riscv64/kernel/proc.c
@@ -62,11 +62,11 @@ void set_args(struct tcb *t, size_t n, struct sys_ret a)
{
struct riscv_regs *r = (struct riscv_regs *)(t->regs) - 1;
if (n >= 1) r->a0 = a.s;
- if (n >= 2) r->a1 = a.ar0;
- if (n >= 3) r->a2 = a.ar1;
- if (n >= 4) r->a3 = a.ar2;
- if (n >= 5) r->a4 = a.ar3;
- if (n >= 6) r->a5 = a.ar4;
+ if (n >= 2) r->a1 = a.a0;
+ if (n >= 3) r->a2 = a.a1;
+ if (n >= 4) r->a3 = a.a2;
+ if (n >= 5) r->a4 = a.a3;
+ if (n >= 6) r->a5 = a.a4;
}
struct sys_ret get_args(struct tcb *t)