[bsp/qemu-virt64-riscv]: dont use sbi in m-mode

This commit is contained in:
rewine 2022-05-27 23:31:35 +08:00 committed by guo
parent 2006785394
commit 53ed031498
1 changed files with 7 additions and 3 deletions

View File

@ -18,12 +18,14 @@
#include "drv_uart.h" #include "drv_uart.h"
#include "encoding.h" #include "encoding.h"
#include "stack.h" #include "stack.h"
#include "sbi.h"
#include "riscv.h" #include "riscv.h"
#include "stack.h" #include "stack.h"
#include "riscv_io.h" #include "riscv_io.h"
#include "plic.h" #include "plic.h"
#include "interrupt.h" #include "interrupt.h"
#ifdef CONFIG_RISCV_S_MODE
#include "sbi.h"
#endif
void primary_cpu_entry(void) void primary_cpu_entry(void)
{ {
@ -62,9 +64,11 @@ void rt_hw_board_init(void)
#endif #endif
} }
void rt_hw_cpu_reset(void) #ifdef CONFIG_RISCV_S_MODE
static void cmd_shutdown(void)
{ {
sbi_shutdown(); sbi_shutdown();
while(1); while(1);
} }
MSH_CMD_EXPORT_ALIAS(rt_hw_cpu_reset, reboot, reset machine); MSH_CMD_EXPORT_ALIAS(cmd_shutdown, shutdown, shutdown qemu-virt64);
#endif