diff options
author | Wesley W. Terpstra <wesley@sifive.com> | 2017-08-14 17:55:31 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-14 17:55:31 -0700 |
commit | 3f20915effa623e11b139ba431841c7af2689cdd (patch) | |
tree | b70fd9c21448c077e6d521c8c2038445f0844640 /machine/mtrap.c | |
parent | 2dcae927fd6cc4493de0f77434a7f191157ba8b7 (diff) | |
download | riscv-pk-3f20915effa623e11b139ba431841c7af2689cdd.zip riscv-pk-3f20915effa623e11b139ba431841c7af2689cdd.tar.gz riscv-pk-3f20915effa623e11b139ba431841c7af2689cdd.tar.bz2 |
finisher: support terminating sifive devices simulation (#61)
Diffstat (limited to 'machine/mtrap.c')
-rw-r--r-- | machine/mtrap.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/machine/mtrap.c b/machine/mtrap.c index a72b373..e5faae3 100644 --- a/machine/mtrap.c +++ b/machine/mtrap.c @@ -5,6 +5,7 @@ #include "bits.h" #include "vm.h" #include "uart.h" +#include "finisher.h" #include "fdt.h" #include "unprivileged_memory.h" #include "platform_interface.h" @@ -27,8 +28,10 @@ static uintptr_t mcall_console_putchar(uint8_t ch) return 0; } -void poweroff() +void poweroff(uint16_t code) { + printm("Power off\n"); + finisher_exit(code); if (platform__use_htif()) { htif_poweroff(); } else { @@ -84,7 +87,7 @@ static uintptr_t mcall_clear_ipi() static uintptr_t mcall_shutdown() { - poweroff(); + poweroff(0); } static uintptr_t mcall_set_timer(uint64_t when) |