hv.py: Add reboot() command to reboot the system and exit

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2021-06-04 15:09:17 +09:00
parent a175b6d159
commit 7b22a72442

View file

@ -459,6 +459,11 @@ class HV:
def exit(self):
raise shell.ExitConsole(EXC_RET.EXIT_GUEST)
def reboot(self):
print("Hard rebooting the system")
self.p.reboot()
sys.exit(0)
def hvc(self, arg):
assert 0 <= arg <= 0xffff
return 0xd4000002 | (arg << 5)