Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 155757
b: refs/heads/master
c: c63b196
h: refs/heads/master
i:
  155755: 6ab48c7
v: v3
  • Loading branch information
Heiko Carstens authored and Martin Schwidefsky committed Jul 24, 2009
1 parent 06e0acb commit ea7a462
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 34 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5f954c3426190f7ae432a09abd62164d5d14c709
refs/heads/master: c63b196afcf22405527abe4c2c57926a5bbd6fc9
36 changes: 24 additions & 12 deletions trunk/arch/s390/power/swsusp.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,36 @@
*
*/

#include <asm/system.h>

/*
* save CPU registers before creating a hibernation image and before
* restoring the memory state from it
*/
void save_processor_state(void)
{
/* implentation contained in the
* swsusp_arch_suspend function
/* swsusp_arch_suspend() actually saves all cpu register contents.
* Machine checks must be disabled since swsusp_arch_suspend() stores
* register contents to their lowcore save areas. That's the same
* place where register contents on machine checks would be saved.
* To avoid register corruption disable machine checks.
* We must also disable machine checks in the new psw mask for
* program checks, since swsusp_arch_suspend() may generate program
* checks. Disabling machine checks for all other new psw masks is
* just paranoia.
*/
local_mcck_disable();
/* Disable lowcore protection */
__ctl_clear_bit(0,28);
S390_lowcore.external_new_psw.mask &= ~PSW_MASK_MCHECK;
S390_lowcore.svc_new_psw.mask &= ~PSW_MASK_MCHECK;
S390_lowcore.io_new_psw.mask &= ~PSW_MASK_MCHECK;
S390_lowcore.program_new_psw.mask &= ~PSW_MASK_MCHECK;
}

/*
* restore the contents of CPU registers
*/
void restore_processor_state(void)
{
/* implentation contained in the
* swsusp_arch_resume function
*/
S390_lowcore.external_new_psw.mask |= PSW_MASK_MCHECK;
S390_lowcore.svc_new_psw.mask |= PSW_MASK_MCHECK;
S390_lowcore.io_new_psw.mask |= PSW_MASK_MCHECK;
S390_lowcore.program_new_psw.mask |= PSW_MASK_MCHECK;
/* Enable lowcore protection */
__ctl_set_bit(0,28);
local_mcck_enable();
}
22 changes: 1 addition & 21 deletions trunk/arch/s390/power/swsusp_asm64.S
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ swsusp_arch_suspend:
/* Deactivate DAT */
stnsm __SF_EMPTY(%r15),0xfb

/* Switch off lowcore protection */
stctg %c0,%c0,__SF_EMPTY(%r15)
ni __SF_EMPTY+4(%r15),0xef
lctlg %c0,%c0,__SF_EMPTY(%r15)

/* Store prefix register on stack */
stpx __SF_EMPTY(%r15)

Expand Down Expand Up @@ -88,11 +83,6 @@ swsusp_arch_suspend:
/* Save image */
brasl %r14,swsusp_save

/* Switch on lowcore protection */
stctg %c0,%c0,__SF_EMPTY(%r15)
oi __SF_EMPTY+4(%r15),0x10
lctlg %c0,%c0,__SF_EMPTY(%r15)

/* Restore prefix register and return */
lghi %r1,0x1000
spx 0x318(%r1)
Expand Down Expand Up @@ -120,11 +110,6 @@ swsusp_arch_resume:
/* Deactivate DAT */
stnsm __SF_EMPTY(%r15),0xfb

/* Switch off lowcore protection */
stctg %c0,%c0,__SF_EMPTY(%r15)
ni __SF_EMPTY+4(%r15),0xef
lctlg %c0,%c0,__SF_EMPTY(%r15)

/* Set prefix page to zero */
xc __SF_EMPTY(4,%r15),__SF_EMPTY(%r15)
spx __SF_EMPTY(%r15)
Expand Down Expand Up @@ -178,7 +163,7 @@ swsusp_arch_resume:
/* Load old stack */
lg %r15,0x2f8(%r13)

/* Pointer to save arae */
/* Pointer to save area */
lghi %r13,0x1000

#ifdef CONFIG_SMP
Expand All @@ -190,11 +175,6 @@ swsusp_arch_resume:
/* Restore prefix register */
spx 0x318(%r13)

/* Switch on lowcore protection */
stctg %c0,%c0,__SF_EMPTY(%r15)
oi __SF_EMPTY+4(%r15),0x10
lctlg %c0,%c0,__SF_EMPTY(%r15)

/* Activate DAT */
stosm __SF_EMPTY(%r15),0x04

Expand Down

0 comments on commit ea7a462

Please sign in to comment.