|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT PATCHv6 29/37] plat/x86: Implement system_off for x86
Implement system_off for x86 can make shutdown.c become
architecture independent.
Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
---
plat/common/include/x86/cpu.h | 1 +
plat/common/x86/cpu_native.c | 11 +++++++++++
2 files changed, 12 insertions(+)
diff --git a/plat/common/include/x86/cpu.h b/plat/common/include/x86/cpu.h
index 104f53e..04d8731 100644
--- a/plat/common/include/x86/cpu.h
+++ b/plat/common/include/x86/cpu.h
@@ -31,6 +31,7 @@
void halt(void);
+void system_off(void);
static inline void cpuid(__u32 leaf, __u32 *eax, __u32 *ebx,
__u32 *ecx, __u32 *edx)
diff --git a/plat/common/x86/cpu_native.c b/plat/common/x86/cpu_native.c
index 0330a20..57ea3a2 100644
--- a/plat/common/x86/cpu_native.c
+++ b/plat/common/x86/cpu_native.c
@@ -47,3 +47,14 @@ unsigned long read_cr2(void)
return cr2;
}
+
+void system_off(void)
+{
+ /*
+ * Poke the QEMU "isa-debug-exit" device to "shutdown". Should be
+ * harmless if it is not present. This is used to enable automated
+ * tests on virtio. Note that the actual QEMU exit() status will
+ * be 83 ('S', 41 << 1 | 1).
+ */
+ outw(0x501, 41);
+}
--
2.17.1
_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |