diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2015-05-14 02:14:14 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2015-05-14 02:14:14 -0700 |
commit | c5f18f61c07228f6606d2217230751d8ec6e091a (patch) | |
tree | 217e34eb6a476e199a14a69ee38d05fc635a2b21 /pk/mtrap.c | |
parent | 3f9b5d7ab80d11eb11739d9a02b4d0b66ace058b (diff) | |
download | pk-c5f18f61c07228f6606d2217230751d8ec6e091a.zip pk-c5f18f61c07228f6606d2217230751d8ec6e091a.tar.gz pk-c5f18f61c07228f6606d2217230751d8ec6e091a.tar.bz2 |
Add sbi_shutdown call
Diffstat (limited to 'pk/mtrap.c')
-rw-r--r-- | pk/mtrap.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -172,9 +172,16 @@ static uintptr_t mcall_send_ipi(uintptr_t recipient) return 0; } +static uintptr_t mcall_shutdown() +{ + while (1) + write_csr(mtohost, 1); + return 0; +} + uintptr_t mcall_trap(uintptr_t mcause, uintptr_t* regs) { - uintptr_t n = regs[10], arg0 = regs[11], retval; + uintptr_t n = regs[17], arg0 = regs[10], retval; switch (n) { case MCALL_HART_ID: @@ -192,6 +199,9 @@ uintptr_t mcall_trap(uintptr_t mcause, uintptr_t* regs) case MCALL_SEND_IPI: retval = mcall_send_ipi(arg0); break; + case MCALL_SHUTDOWN: + retval = mcall_shutdown(); + break; default: retval = -ENOSYS; break; |