diff options
author | James Morris <jmorris@namei.org> | 2009-08-05 18:55:03 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-08-05 18:55:03 -0400 |
commit | 012a5299a29672039f42944a37984558393ef769 (patch) | |
tree | de0815c67cf4156c32c8b552cd7448387cc391b0 /arch/s390/power/swsusp.c | |
parent | da34d4248bd2013ee64ce51e63ec0ebd1f32b46c (diff) | |
parent | 90bc1a658a53f8832ee799685703977a450e5af9 (diff) |
Merge branch 'master' into next
Diffstat (limited to 'arch/s390/power/swsusp.c')
-rw-r--r-- | arch/s390/power/swsusp.c | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/arch/s390/power/swsusp.c b/arch/s390/power/swsusp.c index e6a4fe9f5f24..bd1f5c6b0b8c 100644 --- a/arch/s390/power/swsusp.c +++ b/arch/s390/power/swsusp.c | |||
@@ -7,24 +7,36 @@ | |||
7 | * | 7 | * |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <asm/system.h> | ||
10 | 11 | ||
11 | /* | ||
12 | * save CPU registers before creating a hibernation image and before | ||
13 | * restoring the memory state from it | ||
14 | */ | ||
15 | void save_processor_state(void) | 12 | void save_processor_state(void) |
16 | { | 13 | { |
17 | /* implentation contained in the | 14 | /* swsusp_arch_suspend() actually saves all cpu register contents. |
18 | * swsusp_arch_suspend function | 15 | * Machine checks must be disabled since swsusp_arch_suspend() stores |
16 | * register contents to their lowcore save areas. That's the same | ||
17 | * place where register contents on machine checks would be saved. | ||
18 | * To avoid register corruption disable machine checks. | ||
19 | * We must also disable machine checks in the new psw mask for | ||
20 | * program checks, since swsusp_arch_suspend() may generate program | ||
21 | * checks. Disabling machine checks for all other new psw masks is | ||
22 | * just paranoia. | ||
19 | */ | 23 | */ |
24 | local_mcck_disable(); | ||
25 | /* Disable lowcore protection */ | ||
26 | __ctl_clear_bit(0,28); | ||
27 | S390_lowcore.external_new_psw.mask &= ~PSW_MASK_MCHECK; | ||
28 | S390_lowcore.svc_new_psw.mask &= ~PSW_MASK_MCHECK; | ||
29 | S390_lowcore.io_new_psw.mask &= ~PSW_MASK_MCHECK; | ||
30 | S390_lowcore.program_new_psw.mask &= ~PSW_MASK_MCHECK; | ||
20 | } | 31 | } |
21 | 32 | ||
22 | /* | ||
23 | * restore the contents of CPU registers | ||
24 | */ | ||
25 | void restore_processor_state(void) | 33 | void restore_processor_state(void) |
26 | { | 34 | { |
27 | /* implentation contained in the | 35 | S390_lowcore.external_new_psw.mask |= PSW_MASK_MCHECK; |
28 | * swsusp_arch_resume function | 36 | S390_lowcore.svc_new_psw.mask |= PSW_MASK_MCHECK; |
29 | */ | 37 | S390_lowcore.io_new_psw.mask |= PSW_MASK_MCHECK; |
38 | S390_lowcore.program_new_psw.mask |= PSW_MASK_MCHECK; | ||
39 | /* Enable lowcore protection */ | ||
40 | __ctl_set_bit(0,28); | ||
41 | local_mcck_enable(); | ||
30 | } | 42 | } |