diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2008-01-30 07:30:04 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:30:04 -0500 |
commit | 5c9c9bec0589be696c70c5efb448b17d5ab720e2 (patch) | |
tree | b4fe757645a01c76ed297792f03a4ba10743bd55 /arch/x86/kernel/suspend_64.c | |
parent | 9484b1eb4d05957d3114dc63026448eb66106c06 (diff) |
x86: hibernation: document __save_processor_state() on x86
Document the fact that __save_processor_state() has to save all CPU
registers referred to by the kernel in case a different kernel is
used to load and restore a hibernation image containing it.
Sigend-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/suspend_64.c')
-rw-r--r-- | arch/x86/kernel/suspend_64.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/x86/kernel/suspend_64.c b/arch/x86/kernel/suspend_64.c index 2e5efaaf8800..569f1b540e36 100644 --- a/arch/x86/kernel/suspend_64.c +++ b/arch/x86/kernel/suspend_64.c | |||
@@ -19,6 +19,21 @@ extern const void __nosave_begin, __nosave_end; | |||
19 | 19 | ||
20 | struct saved_context saved_context; | 20 | struct saved_context saved_context; |
21 | 21 | ||
22 | /** | ||
23 | * __save_processor_state - save CPU registers before creating a | ||
24 | * hibernation image and before restoring the memory state from it | ||
25 | * @ctxt - structure to store the registers contents in | ||
26 | * | ||
27 | * NOTE: If there is a CPU register the modification of which by the | ||
28 | * boot kernel (ie. the kernel used for loading the hibernation image) | ||
29 | * might affect the operations of the restored target kernel (ie. the one | ||
30 | * saved in the hibernation image), then its contents must be saved by this | ||
31 | * function. In other words, if kernel A is hibernated and different | ||
32 | * kernel B is used for loading the hibernation image into memory, the | ||
33 | * kernel A's __save_processor_state() function must save all registers | ||
34 | * needed by kernel A, so that it can operate correctly after the resume | ||
35 | * regardless of what kernel B does in the meantime. | ||
36 | */ | ||
22 | void __save_processor_state(struct saved_context *ctxt) | 37 | void __save_processor_state(struct saved_context *ctxt) |
23 | { | 38 | { |
24 | kernel_fpu_begin(); | 39 | kernel_fpu_begin(); |
@@ -69,6 +84,11 @@ static void do_fpu_end(void) | |||
69 | kernel_fpu_end(); | 84 | kernel_fpu_end(); |
70 | } | 85 | } |
71 | 86 | ||
87 | /** | ||
88 | * __restore_processor_state - restore the contents of CPU registers saved | ||
89 | * by __save_processor_state() | ||
90 | * @ctxt - structure to load the registers contents from | ||
91 | */ | ||
72 | void __restore_processor_state(struct saved_context *ctxt) | 92 | void __restore_processor_state(struct saved_context *ctxt) |
73 | { | 93 | { |
74 | /* | 94 | /* |