aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/swsusp_asm64.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/kernel/swsusp_asm64.S')
-rw-r--r--arch/s390/kernel/swsusp_asm64.S28
1 files changed, 21 insertions, 7 deletions
diff --git a/arch/s390/kernel/swsusp_asm64.S b/arch/s390/kernel/swsusp_asm64.S
index fe927d0bc20b..0c26cc1898ec 100644
--- a/arch/s390/kernel/swsusp_asm64.S
+++ b/arch/s390/kernel/swsusp_asm64.S
@@ -43,7 +43,7 @@ swsusp_arch_suspend:
43 lghi %r1,0x1000 43 lghi %r1,0x1000
44 44
45 /* Save CPU address */ 45 /* Save CPU address */
46 stap __LC_CPU_ADDRESS(%r1) 46 stap __LC_CPU_ADDRESS(%r0)
47 47
48 /* Store registers */ 48 /* Store registers */
49 mvc 0x318(4,%r1),__SF_EMPTY(%r15) /* move prefix to lowcore */ 49 mvc 0x318(4,%r1),__SF_EMPTY(%r15) /* move prefix to lowcore */
@@ -69,8 +69,21 @@ swsusp_arch_suspend:
69 stmg %r0,%r15,0x280(%r1) /* store general registers */ 69 stmg %r0,%r15,0x280(%r1) /* store general registers */
70 70
71 stpt 0x328(%r1) /* store timer */ 71 stpt 0x328(%r1) /* store timer */
72 stck __SF_EMPTY(%r15) /* store clock */
72 stckc 0x330(%r1) /* store clock comparator */ 73 stckc 0x330(%r1) /* store clock comparator */
73 74
75 /* Update cputime accounting before going to sleep */
76 lg %r0,__LC_LAST_UPDATE_TIMER
77 slg %r0,0x328(%r1)
78 alg %r0,__LC_SYSTEM_TIMER
79 stg %r0,__LC_SYSTEM_TIMER
80 mvc __LC_LAST_UPDATE_TIMER(8),0x328(%r1)
81 lg %r0,__LC_LAST_UPDATE_CLOCK
82 slg %r0,__SF_EMPTY(%r15)
83 alg %r0,__LC_STEAL_TIMER
84 stg %r0,__LC_STEAL_TIMER
85 mvc __LC_LAST_UPDATE_CLOCK(8),__SF_EMPTY(%r15)
86
74 /* Activate DAT */ 87 /* Activate DAT */
75 stosm __SF_EMPTY(%r15),0x04 88 stosm __SF_EMPTY(%r15),0x04
76 89
@@ -159,8 +172,7 @@ pgm_check_entry:
159 larl %r1,.Lresume_cpu /* Resume CPU address: r2 */ 172 larl %r1,.Lresume_cpu /* Resume CPU address: r2 */
160 stap 0(%r1) 173 stap 0(%r1)
161 llgh %r2,0(%r1) 174 llgh %r2,0(%r1)
162 lghi %r3,0x1000 175 llgh %r1,__LC_CPU_ADDRESS(%r0) /* Suspend CPU address: r1 */
163 llgh %r1,__LC_CPU_ADDRESS(%r3) /* Suspend CPU address: r1 */
164 cgr %r1,%r2 176 cgr %r1,%r2
165 je restore_registers /* r1 = r2 -> nothing to do */ 177 je restore_registers /* r1 = r2 -> nothing to do */
166 larl %r4,.Lrestart_suspend_psw /* Set new restart PSW */ 178 larl %r4,.Lrestart_suspend_psw /* Set new restart PSW */
@@ -187,6 +199,7 @@ pgm_check_entry:
187 brc 2,4b /* busy, try again */ 199 brc 2,4b /* busy, try again */
1885: 2005:
189 sigp %r9,%r2,__SIGP_STOP /* stop resume (current) CPU */ 201 sigp %r9,%r2,__SIGP_STOP /* stop resume (current) CPU */
202 brc 2,5b /* busy, try again */
1906: j 6b 2036: j 6b
191 204
192restart_suspend: 205restart_suspend:
@@ -194,14 +207,18 @@ restart_suspend:
194 llgh %r2,0(%r1) 207 llgh %r2,0(%r1)
1957: 2087:
196 sigp %r9,%r2,__SIGP_SENSE /* Wait for resume CPU */ 209 sigp %r9,%r2,__SIGP_SENSE /* Wait for resume CPU */
210 brc 8,7b /* accepted, status 0, still running */
197 brc 2,7b /* busy, try again */ 211 brc 2,7b /* busy, try again */
198 tmll %r9,0x40 /* Test if resume CPU is stopped */ 212 tmll %r9,0x40 /* Test if resume CPU is stopped */
199 jz 7b 213 jz 7b
200 214
201restore_registers: 215restore_registers:
202 /* Restore registers */ 216 /* Restore registers */
203 lghi %r13,0x1000 /* %r1 = pointer to save arae */ 217 lghi %r13,0x1000 /* %r1 = pointer to save area */
204 218
219 /* Ignore time spent in suspended state. */
220 llgf %r1,0x318(%r13)
221 stck __LC_LAST_UPDATE_CLOCK(%r1)
205 spt 0x328(%r13) /* reprogram timer */ 222 spt 0x328(%r13) /* reprogram timer */
206 //sckc 0x330(%r13) /* set clock comparator */ 223 //sckc 0x330(%r13) /* set clock comparator */
207 224
@@ -229,9 +246,6 @@ restore_registers:
229 /* Load old stack */ 246 /* Load old stack */
230 lg %r15,0x2f8(%r13) 247 lg %r15,0x2f8(%r13)
231 248
232 /* Pointer to save area */
233 lghi %r13,0x1000
234
235 /* Restore prefix register */ 249 /* Restore prefix register */
236 spx 0x318(%r13) 250 spx 0x318(%r13)
237 251