mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-30 17:22:09 +00:00
Add CF9 reboot
This is for the debug purpose. Otherwise it will crash when trying to execute the reboot in hypervisor Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
This commit is contained in:
parent
ff9d667b49
commit
8c357a849f
@ -18,6 +18,7 @@
|
|||||||
#include <vm.h>
|
#include <vm.h>
|
||||||
#include <sprintf.h>
|
#include <sprintf.h>
|
||||||
#include <logmsg.h>
|
#include <logmsg.h>
|
||||||
|
#include <io.h>
|
||||||
|
|
||||||
#define TEMP_STR_SIZE 60U
|
#define TEMP_STR_SIZE 60U
|
||||||
#define MAX_STR_SIZE 256U
|
#define MAX_STR_SIZE 256U
|
||||||
@ -1266,10 +1267,25 @@ static int32_t shell_trigger_crash(int32_t argc, char **argv)
|
|||||||
{
|
{
|
||||||
char str[MAX_STR_SIZE] = {0};
|
char str[MAX_STR_SIZE] = {0};
|
||||||
|
|
||||||
|
uint8_t reboot_code = 0x0E;
|
||||||
|
uint8_t cf9;
|
||||||
|
|
||||||
|
snprintf(str, MAX_STR_SIZE, "trigger CF9 reboot...\r\n");
|
||||||
|
shell_puts(str);
|
||||||
|
|
||||||
|
cf9 = pio_read8(0xcf9) & ~reboot_code;
|
||||||
|
pio_write8(cf9|2, 0xcf9); /* Request hard reset */
|
||||||
|
udelay(50);
|
||||||
|
/* Actually do the reset */
|
||||||
|
pio_write8(cf9|reboot_code, 0xcf9);
|
||||||
|
udelay(50);
|
||||||
|
|
||||||
|
|
||||||
(void)argc;
|
(void)argc;
|
||||||
(void)argv;
|
(void)argv;
|
||||||
snprintf(str, MAX_STR_SIZE, "trigger crash, divide by 0 ...\r\n");
|
snprintf(str, MAX_STR_SIZE, "trigger crash, divide by 0 ...\r\n");
|
||||||
shell_puts(str);
|
shell_puts(str);
|
||||||
|
|
||||||
|
|
||||||
asm("movl $0x1, %eax");
|
asm("movl $0x1, %eax");
|
||||||
asm("movl $0x0, %ecx");
|
asm("movl $0x0, %ecx");
|
||||||
|
Loading…
Reference in New Issue
Block a user