]> xenbits.xensource.com Git - mini-os.git/commitdiff
Save/Restore Support: Declare kernel and arch pre/post suspend functions
authorBruno Alvisio <bruno.alvisio@gmail.com>
Mon, 11 Dec 2017 15:07:08 +0000 (07:07 -0800)
committerWei Liu <wei.liu2@citrix.com>
Wed, 21 Mar 2018 09:16:49 +0000 (09:16 +0000)
For mini-OS to support suspend and restore, the kernel will have to suspend
different modules such as xenbus, console, irq, etc. During save/restore the
kernel and arch pre_suspend and post_suspend functions will be invoked to
suspend/resume each of the modules.

Signed-off-by: Bruno Alvisio <bruno.alvisio@gmail.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
arch/x86/setup.c
include/kernel.h
include/x86/os.h
kernel.c

index 52782275ba57c362edfe5829805e9acdf1e12fb4..3dd86f9627b7ae7db3a0e051595291a7f53c168f 100644 (file)
@@ -204,6 +204,16 @@ arch_init(void *par)
        start_kernel();
 }
 
+void arch_pre_suspend(void)
+{
+
+}
+
+void arch_post_suspend(int canceled)
+{
+
+}
+
 void
 arch_fini(void)
 {
index d37ddda26a87ddb13359a6afe8805d3c18679be3..161d757103e92fb8ec4a90d1713af6cacb2e8f79 100644 (file)
@@ -5,6 +5,8 @@
 extern char cmdline[MAX_CMDLINE_SIZE];
 
 void start_kernel(void);
+void pre_suspend(void);
+void post_suspend(int canceled);
 void do_exit(void) __attribute__((noreturn));
 void arch_do_exit(void);
 void stop_kernel(void);
index d1559148f857b57f784ade746526c876bc398990..a73b63e5e4e0f4b7fa7ca944739f2c3b8a956833 100644 (file)
@@ -71,10 +71,10 @@ void trap_fini(void);
 void xen_callback_vector(void);
 #endif
 
+void arch_pre_suspend(void);
+void arch_post_suspend(int canceled);
 void arch_fini(void);
 
-
-
 #ifdef CONFIG_PARAVIRT
 
 /* 
index 0d84a9bc9d8c832a1220d3d93d49b8aa18d3f39a..90c865a2f460bfa9cdb2d743e0f75c0e09ab9dbd 100644 (file)
--- a/kernel.c
+++ b/kernel.c
@@ -155,6 +155,16 @@ void start_kernel(void)
     run_idle_thread();
 }
 
+void pre_suspend(void)
+{
+
+}
+
+void post_suspend(int canceled)
+{
+
+}
+
 void stop_kernel(void)
 {
     /* TODO: fs import */