diff options
Diffstat (limited to 'arch/riscv64/kernel')
| -rw-r--r-- | arch/riscv64/kernel/power.c | 22 | ||||
| -rw-r--r-- | arch/riscv64/kernel/sbi.c | 30 |
2 files changed, 26 insertions, 26 deletions
diff --git a/arch/riscv64/kernel/power.c b/arch/riscv64/kernel/power.c index 877c001..a4d6568 100644 --- a/arch/riscv64/kernel/power.c +++ b/arch/riscv64/kernel/power.c @@ -2,10 +2,10 @@ #include <sbi.h> /* shutdown reason */ -#define SBI_NO_REASON 0 +#define SBI_NO_REASON 0 /* shutdown type */ -#define SBI_SHUTDOWN 0 +#define SBI_SHUTDOWN 0 #define SBI_COLD_REBOOT 1 #define SBI_WARM_REBOOT 2 @@ -14,17 +14,17 @@ 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: - sbi_system_reset(SBI_SHUTDOWN, SBI_NO_REASON); - return ERR_MISC; + case SHUTDOWN: + sbi_system_reset(SBI_SHUTDOWN, SBI_NO_REASON); + return ERR_MISC; - case COLD_REBOOT: - sbi_system_reset(SBI_COLD_REBOOT, SBI_NO_REASON); - return ERR_MISC; + case COLD_REBOOT: + sbi_system_reset(SBI_COLD_REBOOT, SBI_NO_REASON); + return ERR_MISC; - case WARM_REBOOT: - sbi_system_reset(SBI_WARM_REBOOT, SBI_NO_REASON); - return ERR_MISC; + case WARM_REBOOT: + sbi_system_reset(SBI_WARM_REBOOT, SBI_NO_REASON); + return ERR_MISC; }; return ERR_INVAL; diff --git a/arch/riscv64/kernel/sbi.c b/arch/riscv64/kernel/sbi.c index cd3eb1b..93f5785 100644 --- a/arch/riscv64/kernel/sbi.c +++ b/arch/riscv64/kernel/sbi.c @@ -1,25 +1,25 @@ #include <sbi.h> struct sbiret sbi_ecall(int ext, int fid, unsigned long arg0, - unsigned long arg1, unsigned long arg2, - unsigned long arg3, unsigned long arg4, - unsigned long arg5) + unsigned long arg1, unsigned long arg2, + unsigned long arg3, unsigned long arg4, + unsigned long arg5) { struct sbiret ret; - register uintptr_t a0 __asm__ ("a0") = (uintptr_t)(arg0); - register uintptr_t a1 __asm__ ("a1") = (uintptr_t)(arg1); - register uintptr_t a2 __asm__ ("a2") = (uintptr_t)(arg2); - register uintptr_t a3 __asm__ ("a3") = (uintptr_t)(arg3); - register uintptr_t a4 __asm__ ("a4") = (uintptr_t)(arg4); - register uintptr_t a5 __asm__ ("a5") = (uintptr_t)(arg5); - register uintptr_t a6 __asm__ ("a6") = (uintptr_t)(fid); - register uintptr_t a7 __asm__ ("a7") = (uintptr_t)(ext); + register uintptr_t a0 __asm__("a0") = (uintptr_t)(arg0); + register uintptr_t a1 __asm__("a1") = (uintptr_t)(arg1); + register uintptr_t a2 __asm__("a2") = (uintptr_t)(arg2); + register uintptr_t a3 __asm__("a3") = (uintptr_t)(arg3); + register uintptr_t a4 __asm__("a4") = (uintptr_t)(arg4); + register uintptr_t a5 __asm__("a5") = (uintptr_t)(arg5); + register uintptr_t a6 __asm__("a6") = (uintptr_t)(fid); + register uintptr_t a7 __asm__("a7") = (uintptr_t)(ext); - __asm__ volatile ("ecall" - : "+r" (a0), "+r" (a1) - : "r" (a2), "r" (a3), "r" (a4), "r" (a5), "r" (a6), "r" (a7) - : "memory"); + __asm__ volatile("ecall" + : "+r"(a0), "+r"(a1) + : "r"(a2), "r"(a3), "r"(a4), "r"(a5), "r"(a6), "r"(a7) + : "memory"); ret.error = a0; ret.value = a1; |
