]> xenbits.xensource.com Git - mini-os.git/commitdiff
mini-os: Add suspend stubs for ARM
authorCostin Lupu <costin.lupu@cs.pub.ro>
Wed, 19 Aug 2020 16:41:08 +0000 (19:41 +0300)
committerWei Liu <wl@xen.org>
Thu, 27 Aug 2020 13:39:36 +0000 (13:39 +0000)
This patch introduces the missing suspend-related stubs for ARM. It also
introduces the new arch_suspend() function in order to keep the logic in
kernel_suspend() arch independent.

Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
arch/arm/setup.c
arch/x86/setup.c
include/x86/os.h
shutdown.c

index b65023ca4c189c7bb4dee32942a2bb7277eecc32..3d112fae21409722ed870d73b53f26c450139988 100644 (file)
@@ -53,6 +53,21 @@ arch_fini(void)
 {
 }
 
+void arch_pre_suspend(void)
+{
+}
+
+int arch_suspend(void)
+{
+    printk("Suspend not supported on ARM. Aborting.");
+    do_exit();
+    return 1;
+}
+
+void arch_post_suspend(int canceled)
+{
+}
+
 void
 arch_do_exit(void)
 {
index 64b22c5e1ae07095759e0aac49405cc61e8bf5b0..1ec68d309225e70e2faf737d5a02d9aa0f74fbb2 100644 (file)
@@ -249,6 +249,15 @@ void arch_pre_suspend(void)
     arch_mm_pre_suspend();
 }
 
+int arch_suspend(void)
+{
+    /*
+     * This hypercall returns 1 if the suspend
+     * was cancelled and 0 if resuming in a new domain
+     */
+    return HYPERVISOR_suspend(virt_to_mfn(start_info_ptr));
+}
+
 void arch_post_suspend(int canceled)
 {
 #if CONFIG_PARAVIRT
index 46a824d6c4a735e83c6443e4fabda475ba04ed95..ee34d7849e7bfb29f58d900636f4fc9ac2c10ab8 100644 (file)
@@ -73,6 +73,7 @@ void xen_callback_vector(void);
 #endif
 
 void arch_pre_suspend(void);
+int  arch_suspend(void);
 void arch_post_suspend(int canceled);
 void arch_fini(void);
 
index 08546704b2c473c7e97cbd6665e0d795b31d19a0..bb2c6f116c2e19ae2e7fea0a42a49e07cee50025 100644 (file)
@@ -46,8 +46,6 @@
 #include <mini-os/xmalloc.h>
 
 
-extern start_info_t *start_info_ptr;
-
 #ifdef CONFIG_XENBUS
 static const char *path = "control/shutdown";
 static const char *token = "control/shutdown";
@@ -140,13 +138,7 @@ void kernel_suspend(void)
     pre_suspend();
     arch_pre_suspend();
 
-    /*
-     * This hypercall returns 1 if the suspend
-     * was cancelled and 0 if resuming in a new domain
-     *
-     * TODO Fix this for ARM
-     */
-    rc = HYPERVISOR_suspend(virt_to_mfn(start_info_ptr));
+    rc = arch_suspend();
 
     arch_post_suspend(rc);
     post_suspend(rc);