aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/s390/kernel/compat_wrapper.S442
-rw-r--r--arch/s390/kernel/entry.S469
-rw-r--r--arch/s390/kernel/entry64.S443
-rw-r--r--arch/s390/kernel/head.S624
-rw-r--r--arch/s390/kernel/head64.S432
-rw-r--r--arch/s390/kernel/reipl.S75
-rw-r--r--arch/s390/kernel/reipl64.S93
-rw-r--r--arch/s390/kernel/relocate_kernel.S74
-rw-r--r--arch/s390/kernel/relocate_kernel64.S82
9 files changed, 1364 insertions, 1370 deletions
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index 4d53b2739357..4aabeeaa7cf7 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -4,97 +4,97 @@
4* 4*
5* Copyright (C) IBM Corp. 2000,2006 5* Copyright (C) IBM Corp. 2000,2006
6* Author(s): Gerhard Tonn (ton@de.ibm.com), 6* Author(s): Gerhard Tonn (ton@de.ibm.com),
7* Thomas Spatzier (tspat@de.ibm.com) 7* Thomas Spatzier (tspat@de.ibm.com)
8*/ 8*/
9 9
10 .globl sys32_exit_wrapper 10 .globl sys32_exit_wrapper
11sys32_exit_wrapper: 11sys32_exit_wrapper:
12 lgfr %r2,%r2 # int 12 lgfr %r2,%r2 # int
13 jg sys_exit # branch to sys_exit 13 jg sys_exit # branch to sys_exit
14 14
15 .globl sys32_read_wrapper 15 .globl sys32_read_wrapper
16sys32_read_wrapper: 16sys32_read_wrapper:
17 llgfr %r2,%r2 # unsigned int 17 llgfr %r2,%r2 # unsigned int
18 llgtr %r3,%r3 # char * 18 llgtr %r3,%r3 # char *
19 llgfr %r4,%r4 # size_t 19 llgfr %r4,%r4 # size_t
20 jg sys32_read # branch to sys_read 20 jg sys32_read # branch to sys_read
21 21
22 .globl sys32_write_wrapper 22 .globl sys32_write_wrapper
23sys32_write_wrapper: 23sys32_write_wrapper:
24 llgfr %r2,%r2 # unsigned int 24 llgfr %r2,%r2 # unsigned int
25 llgtr %r3,%r3 # const char * 25 llgtr %r3,%r3 # const char *
26 llgfr %r4,%r4 # size_t 26 llgfr %r4,%r4 # size_t
27 jg sys32_write # branch to system call 27 jg sys32_write # branch to system call
28 28
29 .globl sys32_open_wrapper 29 .globl sys32_open_wrapper
30sys32_open_wrapper: 30sys32_open_wrapper:
31 llgtr %r2,%r2 # const char * 31 llgtr %r2,%r2 # const char *
32 lgfr %r3,%r3 # int 32 lgfr %r3,%r3 # int
33 lgfr %r4,%r4 # int 33 lgfr %r4,%r4 # int
34 jg sys_open # branch to system call 34 jg sys_open # branch to system call
35 35
36 .globl sys32_close_wrapper 36 .globl sys32_close_wrapper
37sys32_close_wrapper: 37sys32_close_wrapper:
38 llgfr %r2,%r2 # unsigned int 38 llgfr %r2,%r2 # unsigned int
39 jg sys_close # branch to system call 39 jg sys_close # branch to system call
40 40
41 .globl sys32_creat_wrapper 41 .globl sys32_creat_wrapper
42sys32_creat_wrapper: 42sys32_creat_wrapper:
43 llgtr %r2,%r2 # const char * 43 llgtr %r2,%r2 # const char *
44 lgfr %r3,%r3 # int 44 lgfr %r3,%r3 # int
45 jg sys_creat # branch to system call 45 jg sys_creat # branch to system call
46 46
47 .globl sys32_link_wrapper 47 .globl sys32_link_wrapper
48sys32_link_wrapper: 48sys32_link_wrapper:
49 llgtr %r2,%r2 # const char * 49 llgtr %r2,%r2 # const char *
50 llgtr %r3,%r3 # const char * 50 llgtr %r3,%r3 # const char *
51 jg sys_link # branch to system call 51 jg sys_link # branch to system call
52 52
53 .globl sys32_unlink_wrapper 53 .globl sys32_unlink_wrapper
54sys32_unlink_wrapper: 54sys32_unlink_wrapper:
55 llgtr %r2,%r2 # const char * 55 llgtr %r2,%r2 # const char *
56 jg sys_unlink # branch to system call 56 jg sys_unlink # branch to system call
57 57
58 .globl sys32_chdir_wrapper 58 .globl sys32_chdir_wrapper
59sys32_chdir_wrapper: 59sys32_chdir_wrapper:
60 llgtr %r2,%r2 # const char * 60 llgtr %r2,%r2 # const char *
61 jg sys_chdir # branch to system call 61 jg sys_chdir # branch to system call
62 62
63 .globl sys32_time_wrapper 63 .globl sys32_time_wrapper
64sys32_time_wrapper: 64sys32_time_wrapper:
65 llgtr %r2,%r2 # int * 65 llgtr %r2,%r2 # int *
66 jg compat_sys_time # branch to system call 66 jg compat_sys_time # branch to system call
67 67
68 .globl sys32_mknod_wrapper 68 .globl sys32_mknod_wrapper
69sys32_mknod_wrapper: 69sys32_mknod_wrapper:
70 llgtr %r2,%r2 # const char * 70 llgtr %r2,%r2 # const char *
71 lgfr %r3,%r3 # int 71 lgfr %r3,%r3 # int
72 llgfr %r4,%r4 # dev 72 llgfr %r4,%r4 # dev
73 jg sys_mknod # branch to system call 73 jg sys_mknod # branch to system call
74 74
75 .globl sys32_chmod_wrapper 75 .globl sys32_chmod_wrapper
76sys32_chmod_wrapper: 76sys32_chmod_wrapper:
77 llgtr %r2,%r2 # const char * 77 llgtr %r2,%r2 # const char *
78 llgfr %r3,%r3 # mode_t 78 llgfr %r3,%r3 # mode_t
79 jg sys_chmod # branch to system call 79 jg sys_chmod # branch to system call
80 80
81 .globl sys32_lchown16_wrapper 81 .globl sys32_lchown16_wrapper
82sys32_lchown16_wrapper: 82sys32_lchown16_wrapper:
83 llgtr %r2,%r2 # const char * 83 llgtr %r2,%r2 # const char *
84 llgfr %r3,%r3 # __kernel_old_uid_emu31_t 84 llgfr %r3,%r3 # __kernel_old_uid_emu31_t
85 llgfr %r4,%r4 # __kernel_old_uid_emu31_t 85 llgfr %r4,%r4 # __kernel_old_uid_emu31_t
86 jg sys32_lchown16 # branch to system call 86 jg sys32_lchown16 # branch to system call
87 87
88 .globl sys32_lseek_wrapper 88 .globl sys32_lseek_wrapper
89sys32_lseek_wrapper: 89sys32_lseek_wrapper:
90 llgfr %r2,%r2 # unsigned int 90 llgfr %r2,%r2 # unsigned int
91 lgfr %r3,%r3 # off_t 91 lgfr %r3,%r3 # off_t
92 llgfr %r4,%r4 # unsigned int 92 llgfr %r4,%r4 # unsigned int
93 jg sys_lseek # branch to system call 93 jg sys_lseek # branch to system call
94 94
95#sys32_getpid_wrapper # void 95#sys32_getpid_wrapper # void
96 96
97 .globl sys32_mount_wrapper 97 .globl sys32_mount_wrapper
98sys32_mount_wrapper: 98sys32_mount_wrapper:
99 llgtr %r2,%r2 # char * 99 llgtr %r2,%r2 # char *
100 llgtr %r3,%r3 # char * 100 llgtr %r3,%r3 # char *
@@ -103,19 +103,19 @@ sys32_mount_wrapper:
103 llgtr %r6,%r6 # void * 103 llgtr %r6,%r6 # void *
104 jg compat_sys_mount # branch to system call 104 jg compat_sys_mount # branch to system call
105 105
106 .globl sys32_oldumount_wrapper 106 .globl sys32_oldumount_wrapper
107sys32_oldumount_wrapper: 107sys32_oldumount_wrapper:
108 llgtr %r2,%r2 # char * 108 llgtr %r2,%r2 # char *
109 jg sys_oldumount # branch to system call 109 jg sys_oldumount # branch to system call
110 110
111 .globl sys32_setuid16_wrapper 111 .globl sys32_setuid16_wrapper
112sys32_setuid16_wrapper: 112sys32_setuid16_wrapper:
113 llgfr %r2,%r2 # __kernel_old_uid_emu31_t 113 llgfr %r2,%r2 # __kernel_old_uid_emu31_t
114 jg sys32_setuid16 # branch to system call 114 jg sys32_setuid16 # branch to system call
115 115
116#sys32_getuid16_wrapper # void 116#sys32_getuid16_wrapper # void
117 117
118 .globl sys32_ptrace_wrapper 118 .globl sys32_ptrace_wrapper
119sys32_ptrace_wrapper: 119sys32_ptrace_wrapper:
120 lgfr %r2,%r2 # long 120 lgfr %r2,%r2 # long
121 lgfr %r3,%r3 # long 121 lgfr %r3,%r3 # long
@@ -123,168 +123,168 @@ sys32_ptrace_wrapper:
123 llgfr %r5,%r5 # long 123 llgfr %r5,%r5 # long
124 jg sys_ptrace # branch to system call 124 jg sys_ptrace # branch to system call
125 125
126 .globl sys32_alarm_wrapper 126 .globl sys32_alarm_wrapper
127sys32_alarm_wrapper: 127sys32_alarm_wrapper:
128 llgfr %r2,%r2 # unsigned int 128 llgfr %r2,%r2 # unsigned int
129 jg sys_alarm # branch to system call 129 jg sys_alarm # branch to system call
130 130
131#sys32_pause_wrapper # void 131#sys32_pause_wrapper # void
132 132
133 .globl compat_sys_utime_wrapper 133 .globl compat_sys_utime_wrapper
134compat_sys_utime_wrapper: 134compat_sys_utime_wrapper:
135 llgtr %r2,%r2 # char * 135 llgtr %r2,%r2 # char *
136 llgtr %r3,%r3 # struct compat_utimbuf * 136 llgtr %r3,%r3 # struct compat_utimbuf *
137 jg compat_sys_utime # branch to system call 137 jg compat_sys_utime # branch to system call
138 138
139 .globl sys32_access_wrapper 139 .globl sys32_access_wrapper
140sys32_access_wrapper: 140sys32_access_wrapper:
141 llgtr %r2,%r2 # const char * 141 llgtr %r2,%r2 # const char *
142 lgfr %r3,%r3 # int 142 lgfr %r3,%r3 # int
143 jg sys_access # branch to system call 143 jg sys_access # branch to system call
144 144
145 .globl sys32_nice_wrapper 145 .globl sys32_nice_wrapper
146sys32_nice_wrapper: 146sys32_nice_wrapper:
147 lgfr %r2,%r2 # int 147 lgfr %r2,%r2 # int
148 jg sys_nice # branch to system call 148 jg sys_nice # branch to system call
149 149
150#sys32_sync_wrapper # void 150#sys32_sync_wrapper # void
151 151
152 .globl sys32_kill_wrapper 152 .globl sys32_kill_wrapper
153sys32_kill_wrapper: 153sys32_kill_wrapper:
154 lgfr %r2,%r2 # int 154 lgfr %r2,%r2 # int
155 lgfr %r3,%r3 # int 155 lgfr %r3,%r3 # int
156 jg sys_kill # branch to system call 156 jg sys_kill # branch to system call
157 157
158 .globl sys32_rename_wrapper 158 .globl sys32_rename_wrapper
159sys32_rename_wrapper: 159sys32_rename_wrapper:
160 llgtr %r2,%r2 # const char * 160 llgtr %r2,%r2 # const char *
161 llgtr %r3,%r3 # const char * 161 llgtr %r3,%r3 # const char *
162 jg sys_rename # branch to system call 162 jg sys_rename # branch to system call
163 163
164 .globl sys32_mkdir_wrapper 164 .globl sys32_mkdir_wrapper
165sys32_mkdir_wrapper: 165sys32_mkdir_wrapper:
166 llgtr %r2,%r2 # const char * 166 llgtr %r2,%r2 # const char *
167 lgfr %r3,%r3 # int 167 lgfr %r3,%r3 # int
168 jg sys_mkdir # branch to system call 168 jg sys_mkdir # branch to system call
169 169
170 .globl sys32_rmdir_wrapper 170 .globl sys32_rmdir_wrapper
171sys32_rmdir_wrapper: 171sys32_rmdir_wrapper:
172 llgtr %r2,%r2 # const char * 172 llgtr %r2,%r2 # const char *
173 jg sys_rmdir # branch to system call 173 jg sys_rmdir # branch to system call
174 174
175 .globl sys32_dup_wrapper 175 .globl sys32_dup_wrapper
176sys32_dup_wrapper: 176sys32_dup_wrapper:
177 llgfr %r2,%r2 # unsigned int 177 llgfr %r2,%r2 # unsigned int
178 jg sys_dup # branch to system call 178 jg sys_dup # branch to system call
179 179
180 .globl sys32_pipe_wrapper 180 .globl sys32_pipe_wrapper
181sys32_pipe_wrapper: 181sys32_pipe_wrapper:
182 llgtr %r2,%r2 # u32 * 182 llgtr %r2,%r2 # u32 *
183 jg sys_pipe # branch to system call 183 jg sys_pipe # branch to system call
184 184
185 .globl compat_sys_times_wrapper 185 .globl compat_sys_times_wrapper
186compat_sys_times_wrapper: 186compat_sys_times_wrapper:
187 llgtr %r2,%r2 # struct compat_tms * 187 llgtr %r2,%r2 # struct compat_tms *
188 jg compat_sys_times # branch to system call 188 jg compat_sys_times # branch to system call
189 189
190 .globl sys32_brk_wrapper 190 .globl sys32_brk_wrapper
191sys32_brk_wrapper: 191sys32_brk_wrapper:
192 llgtr %r2,%r2 # unsigned long 192 llgtr %r2,%r2 # unsigned long
193 jg sys_brk # branch to system call 193 jg sys_brk # branch to system call
194 194
195 .globl sys32_setgid16_wrapper 195 .globl sys32_setgid16_wrapper
196sys32_setgid16_wrapper: 196sys32_setgid16_wrapper:
197 llgfr %r2,%r2 # __kernel_old_gid_emu31_t 197 llgfr %r2,%r2 # __kernel_old_gid_emu31_t
198 jg sys32_setgid16 # branch to system call 198 jg sys32_setgid16 # branch to system call
199 199
200#sys32_getgid16_wrapper # void 200#sys32_getgid16_wrapper # void
201 201
202 .globl sys32_signal_wrapper 202 .globl sys32_signal_wrapper
203sys32_signal_wrapper: 203sys32_signal_wrapper:
204 lgfr %r2,%r2 # int 204 lgfr %r2,%r2 # int
205 llgtr %r3,%r3 # __sighandler_t 205 llgtr %r3,%r3 # __sighandler_t
206 jg sys_signal 206 jg sys_signal
207 207
208#sys32_geteuid16_wrapper # void 208#sys32_geteuid16_wrapper # void
209 209
210#sys32_getegid16_wrapper # void 210#sys32_getegid16_wrapper # void
211 211
212 .globl sys32_acct_wrapper 212 .globl sys32_acct_wrapper
213sys32_acct_wrapper: 213sys32_acct_wrapper:
214 llgtr %r2,%r2 # char * 214 llgtr %r2,%r2 # char *
215 jg sys_acct # branch to system call 215 jg sys_acct # branch to system call
216 216
217 .globl sys32_umount_wrapper 217 .globl sys32_umount_wrapper
218sys32_umount_wrapper: 218sys32_umount_wrapper:
219 llgtr %r2,%r2 # char * 219 llgtr %r2,%r2 # char *
220 lgfr %r3,%r3 # int 220 lgfr %r3,%r3 # int
221 jg sys_umount # branch to system call 221 jg sys_umount # branch to system call
222 222
223 .globl compat_sys_ioctl_wrapper 223 .globl compat_sys_ioctl_wrapper
224compat_sys_ioctl_wrapper: 224compat_sys_ioctl_wrapper:
225 llgfr %r2,%r2 # unsigned int 225 llgfr %r2,%r2 # unsigned int
226 llgfr %r3,%r3 # unsigned int 226 llgfr %r3,%r3 # unsigned int
227 llgfr %r4,%r4 # unsigned int 227 llgfr %r4,%r4 # unsigned int
228 jg compat_sys_ioctl # branch to system call 228 jg compat_sys_ioctl # branch to system call
229 229
230 .globl compat_sys_fcntl_wrapper 230 .globl compat_sys_fcntl_wrapper
231compat_sys_fcntl_wrapper: 231compat_sys_fcntl_wrapper:
232 llgfr %r2,%r2 # unsigned int 232 llgfr %r2,%r2 # unsigned int
233 llgfr %r3,%r3 # unsigned int 233 llgfr %r3,%r3 # unsigned int
234 llgfr %r4,%r4 # unsigned long 234 llgfr %r4,%r4 # unsigned long
235 jg compat_sys_fcntl # branch to system call 235 jg compat_sys_fcntl # branch to system call
236 236
237 .globl sys32_setpgid_wrapper 237 .globl sys32_setpgid_wrapper
238sys32_setpgid_wrapper: 238sys32_setpgid_wrapper:
239 lgfr %r2,%r2 # pid_t 239 lgfr %r2,%r2 # pid_t
240 lgfr %r3,%r3 # pid_t 240 lgfr %r3,%r3 # pid_t
241 jg sys_setpgid # branch to system call 241 jg sys_setpgid # branch to system call
242 242
243 .globl sys32_umask_wrapper 243 .globl sys32_umask_wrapper
244sys32_umask_wrapper: 244sys32_umask_wrapper:
245 lgfr %r2,%r2 # int 245 lgfr %r2,%r2 # int
246 jg sys_umask # branch to system call 246 jg sys_umask # branch to system call
247 247
248 .globl sys32_chroot_wrapper 248 .globl sys32_chroot_wrapper
249sys32_chroot_wrapper: 249sys32_chroot_wrapper:
250 llgtr %r2,%r2 # char * 250 llgtr %r2,%r2 # char *
251 jg sys_chroot # branch to system call 251 jg sys_chroot # branch to system call
252 252
253 .globl sys32_ustat_wrapper 253 .globl sys32_ustat_wrapper
254sys32_ustat_wrapper: 254sys32_ustat_wrapper:
255 llgfr %r2,%r2 # dev_t 255 llgfr %r2,%r2 # dev_t
256 llgtr %r3,%r3 # struct ustat * 256 llgtr %r3,%r3 # struct ustat *
257 jg sys_ustat 257 jg sys_ustat
258 258
259 .globl sys32_dup2_wrapper 259 .globl sys32_dup2_wrapper
260sys32_dup2_wrapper: 260sys32_dup2_wrapper:
261 llgfr %r2,%r2 # unsigned int 261 llgfr %r2,%r2 # unsigned int
262 llgfr %r3,%r3 # unsigned int 262 llgfr %r3,%r3 # unsigned int
263 jg sys_dup2 # branch to system call 263 jg sys_dup2 # branch to system call
264 264
265#sys32_getppid_wrapper # void 265#sys32_getppid_wrapper # void
266 266
267#sys32_getpgrp_wrapper # void 267#sys32_getpgrp_wrapper # void
268 268
269#sys32_setsid_wrapper # void 269#sys32_setsid_wrapper # void
270 270
271 .globl sys32_sigaction_wrapper 271 .globl sys32_sigaction_wrapper
272sys32_sigaction_wrapper: 272sys32_sigaction_wrapper:
273 lgfr %r2,%r2 # int 273 lgfr %r2,%r2 # int
274 llgtr %r3,%r3 # const struct old_sigaction * 274 llgtr %r3,%r3 # const struct old_sigaction *
275 llgtr %r4,%r4 # struct old_sigaction32 * 275 llgtr %r4,%r4 # struct old_sigaction32 *
276 jg sys32_sigaction # branch to system call 276 jg sys32_sigaction # branch to system call
277 277
278 .globl sys32_setreuid16_wrapper 278 .globl sys32_setreuid16_wrapper
279sys32_setreuid16_wrapper: 279sys32_setreuid16_wrapper:
280 llgfr %r2,%r2 # __kernel_old_uid_emu31_t 280 llgfr %r2,%r2 # __kernel_old_uid_emu31_t
281 llgfr %r3,%r3 # __kernel_old_uid_emu31_t 281 llgfr %r3,%r3 # __kernel_old_uid_emu31_t
282 jg sys32_setreuid16 # branch to system call 282 jg sys32_setreuid16 # branch to system call
283 283
284 .globl sys32_setregid16_wrapper 284 .globl sys32_setregid16_wrapper
285sys32_setregid16_wrapper: 285sys32_setregid16_wrapper:
286 llgfr %r2,%r2 # __kernel_old_gid_emu31_t 286 llgfr %r2,%r2 # __kernel_old_gid_emu31_t
287 llgfr %r3,%r3 # __kernel_old_gid_emu31_t 287 llgfr %r3,%r3 # __kernel_old_gid_emu31_t
288 jg sys32_setregid16 # branch to system call 288 jg sys32_setregid16 # branch to system call
289 289
290 .globl sys_sigsuspend_wrapper 290 .globl sys_sigsuspend_wrapper
@@ -294,95 +294,95 @@ sys_sigsuspend_wrapper:
294 llgfr %r4,%r4 # old_sigset_t 294 llgfr %r4,%r4 # old_sigset_t
295 jg sys_sigsuspend 295 jg sys_sigsuspend
296 296
297 .globl compat_sys_sigpending_wrapper 297 .globl compat_sys_sigpending_wrapper
298compat_sys_sigpending_wrapper: 298compat_sys_sigpending_wrapper:
299 llgtr %r2,%r2 # compat_old_sigset_t * 299 llgtr %r2,%r2 # compat_old_sigset_t *
300 jg compat_sys_sigpending # branch to system call 300 jg compat_sys_sigpending # branch to system call
301 301
302 .globl sys32_sethostname_wrapper 302 .globl sys32_sethostname_wrapper
303sys32_sethostname_wrapper: 303sys32_sethostname_wrapper:
304 llgtr %r2,%r2 # char * 304 llgtr %r2,%r2 # char *
305 lgfr %r3,%r3 # int 305 lgfr %r3,%r3 # int
306 jg sys_sethostname # branch to system call 306 jg sys_sethostname # branch to system call
307 307
308 .globl compat_sys_setrlimit_wrapper 308 .globl compat_sys_setrlimit_wrapper
309compat_sys_setrlimit_wrapper: 309compat_sys_setrlimit_wrapper:
310 llgfr %r2,%r2 # unsigned int 310 llgfr %r2,%r2 # unsigned int
311 llgtr %r3,%r3 # struct rlimit_emu31 * 311 llgtr %r3,%r3 # struct rlimit_emu31 *
312 jg compat_sys_setrlimit # branch to system call 312 jg compat_sys_setrlimit # branch to system call
313 313
314 .globl compat_sys_old_getrlimit_wrapper 314 .globl compat_sys_old_getrlimit_wrapper
315compat_sys_old_getrlimit_wrapper: 315compat_sys_old_getrlimit_wrapper:
316 llgfr %r2,%r2 # unsigned int 316 llgfr %r2,%r2 # unsigned int
317 llgtr %r3,%r3 # struct rlimit_emu31 * 317 llgtr %r3,%r3 # struct rlimit_emu31 *
318 jg compat_sys_old_getrlimit # branch to system call 318 jg compat_sys_old_getrlimit # branch to system call
319 319
320 .globl compat_sys_getrlimit_wrapper 320 .globl compat_sys_getrlimit_wrapper
321compat_sys_getrlimit_wrapper: 321compat_sys_getrlimit_wrapper:
322 llgfr %r2,%r2 # unsigned int 322 llgfr %r2,%r2 # unsigned int
323 llgtr %r3,%r3 # struct rlimit_emu31 * 323 llgtr %r3,%r3 # struct rlimit_emu31 *
324 jg compat_sys_getrlimit # branch to system call 324 jg compat_sys_getrlimit # branch to system call
325 325
326 .globl sys32_mmap2_wrapper 326 .globl sys32_mmap2_wrapper
327sys32_mmap2_wrapper: 327sys32_mmap2_wrapper:
328 llgtr %r2,%r2 # struct mmap_arg_struct_emu31 * 328 llgtr %r2,%r2 # struct mmap_arg_struct_emu31 *
329 jg sys32_mmap2 # branch to system call 329 jg sys32_mmap2 # branch to system call
330 330
331 .globl compat_sys_getrusage_wrapper 331 .globl compat_sys_getrusage_wrapper
332compat_sys_getrusage_wrapper: 332compat_sys_getrusage_wrapper:
333 lgfr %r2,%r2 # int 333 lgfr %r2,%r2 # int
334 llgtr %r3,%r3 # struct rusage_emu31 * 334 llgtr %r3,%r3 # struct rusage_emu31 *
335 jg compat_sys_getrusage # branch to system call 335 jg compat_sys_getrusage # branch to system call
336 336
337 .globl sys32_gettimeofday_wrapper 337 .globl sys32_gettimeofday_wrapper
338sys32_gettimeofday_wrapper: 338sys32_gettimeofday_wrapper:
339 llgtr %r2,%r2 # struct timeval_emu31 * 339 llgtr %r2,%r2 # struct timeval_emu31 *
340 llgtr %r3,%r3 # struct timezone * 340 llgtr %r3,%r3 # struct timezone *
341 jg sys32_gettimeofday # branch to system call 341 jg sys32_gettimeofday # branch to system call
342 342
343 .globl sys32_settimeofday_wrapper 343 .globl sys32_settimeofday_wrapper
344sys32_settimeofday_wrapper: 344sys32_settimeofday_wrapper:
345 llgtr %r2,%r2 # struct timeval_emu31 * 345 llgtr %r2,%r2 # struct timeval_emu31 *
346 llgtr %r3,%r3 # struct timezone * 346 llgtr %r3,%r3 # struct timezone *
347 jg sys32_settimeofday # branch to system call 347 jg sys32_settimeofday # branch to system call
348 348
349 .globl sys32_getgroups16_wrapper 349 .globl sys32_getgroups16_wrapper
350sys32_getgroups16_wrapper: 350sys32_getgroups16_wrapper:
351 lgfr %r2,%r2 # int 351 lgfr %r2,%r2 # int
352 llgtr %r3,%r3 # __kernel_old_gid_emu31_t * 352 llgtr %r3,%r3 # __kernel_old_gid_emu31_t *
353 jg sys32_getgroups16 # branch to system call 353 jg sys32_getgroups16 # branch to system call
354 354
355 .globl sys32_setgroups16_wrapper 355 .globl sys32_setgroups16_wrapper
356sys32_setgroups16_wrapper: 356sys32_setgroups16_wrapper:
357 lgfr %r2,%r2 # int 357 lgfr %r2,%r2 # int
358 llgtr %r3,%r3 # __kernel_old_gid_emu31_t * 358 llgtr %r3,%r3 # __kernel_old_gid_emu31_t *
359 jg sys32_setgroups16 # branch to system call 359 jg sys32_setgroups16 # branch to system call
360 360
361 .globl sys32_symlink_wrapper 361 .globl sys32_symlink_wrapper
362sys32_symlink_wrapper: 362sys32_symlink_wrapper:
363 llgtr %r2,%r2 # const char * 363 llgtr %r2,%r2 # const char *
364 llgtr %r3,%r3 # const char * 364 llgtr %r3,%r3 # const char *
365 jg sys_symlink # branch to system call 365 jg sys_symlink # branch to system call
366 366
367 .globl sys32_readlink_wrapper 367 .globl sys32_readlink_wrapper
368sys32_readlink_wrapper: 368sys32_readlink_wrapper:
369 llgtr %r2,%r2 # const char * 369 llgtr %r2,%r2 # const char *
370 llgtr %r3,%r3 # char * 370 llgtr %r3,%r3 # char *
371 lgfr %r4,%r4 # int 371 lgfr %r4,%r4 # int
372 jg sys_readlink # branch to system call 372 jg sys_readlink # branch to system call
373 373
374 .globl sys32_uselib_wrapper 374 .globl sys32_uselib_wrapper
375sys32_uselib_wrapper: 375sys32_uselib_wrapper:
376 llgtr %r2,%r2 # const char * 376 llgtr %r2,%r2 # const char *
377 jg sys_uselib # branch to system call 377 jg sys_uselib # branch to system call
378 378
379 .globl sys32_swapon_wrapper 379 .globl sys32_swapon_wrapper
380sys32_swapon_wrapper: 380sys32_swapon_wrapper:
381 llgtr %r2,%r2 # const char * 381 llgtr %r2,%r2 # const char *
382 lgfr %r3,%r3 # int 382 lgfr %r3,%r3 # int
383 jg sys_swapon # branch to system call 383 jg sys_swapon # branch to system call
384 384
385 .globl sys32_reboot_wrapper 385 .globl sys32_reboot_wrapper
386sys32_reboot_wrapper: 386sys32_reboot_wrapper:
387 lgfr %r2,%r2 # int 387 lgfr %r2,%r2 # int
388 lgfr %r3,%r3 # int 388 lgfr %r3,%r3 # int
@@ -390,121 +390,121 @@ sys32_reboot_wrapper:
390 llgtr %r5,%r5 # void * 390 llgtr %r5,%r5 # void *
391 jg sys_reboot # branch to system call 391 jg sys_reboot # branch to system call
392 392
393 .globl old32_readdir_wrapper 393 .globl old32_readdir_wrapper
394old32_readdir_wrapper: 394old32_readdir_wrapper:
395 llgfr %r2,%r2 # unsigned int 395 llgfr %r2,%r2 # unsigned int
396 llgtr %r3,%r3 # void * 396 llgtr %r3,%r3 # void *
397 llgfr %r4,%r4 # unsigned int 397 llgfr %r4,%r4 # unsigned int
398 jg compat_sys_old_readdir # branch to system call 398 jg compat_sys_old_readdir # branch to system call
399 399
400 .globl old32_mmap_wrapper 400 .globl old32_mmap_wrapper
401old32_mmap_wrapper: 401old32_mmap_wrapper:
402 llgtr %r2,%r2 # struct mmap_arg_struct_emu31 * 402 llgtr %r2,%r2 # struct mmap_arg_struct_emu31 *
403 jg old32_mmap # branch to system call 403 jg old32_mmap # branch to system call
404 404
405 .globl sys32_munmap_wrapper 405 .globl sys32_munmap_wrapper
406sys32_munmap_wrapper: 406sys32_munmap_wrapper:
407 llgfr %r2,%r2 # unsigned long 407 llgfr %r2,%r2 # unsigned long
408 llgfr %r3,%r3 # size_t 408 llgfr %r3,%r3 # size_t
409 jg sys_munmap # branch to system call 409 jg sys_munmap # branch to system call
410 410
411 .globl sys32_truncate_wrapper 411 .globl sys32_truncate_wrapper
412sys32_truncate_wrapper: 412sys32_truncate_wrapper:
413 llgtr %r2,%r2 # const char * 413 llgtr %r2,%r2 # const char *
414 llgfr %r3,%r3 # unsigned long 414 llgfr %r3,%r3 # unsigned long
415 jg sys_truncate # branch to system call 415 jg sys_truncate # branch to system call
416 416
417 .globl sys32_ftruncate_wrapper 417 .globl sys32_ftruncate_wrapper
418sys32_ftruncate_wrapper: 418sys32_ftruncate_wrapper:
419 llgfr %r2,%r2 # unsigned int 419 llgfr %r2,%r2 # unsigned int
420 llgfr %r3,%r3 # unsigned long 420 llgfr %r3,%r3 # unsigned long
421 jg sys_ftruncate # branch to system call 421 jg sys_ftruncate # branch to system call
422 422
423 .globl sys32_fchmod_wrapper 423 .globl sys32_fchmod_wrapper
424sys32_fchmod_wrapper: 424sys32_fchmod_wrapper:
425 llgfr %r2,%r2 # unsigned int 425 llgfr %r2,%r2 # unsigned int
426 llgfr %r3,%r3 # mode_t 426 llgfr %r3,%r3 # mode_t
427 jg sys_fchmod # branch to system call 427 jg sys_fchmod # branch to system call
428 428
429 .globl sys32_fchown16_wrapper 429 .globl sys32_fchown16_wrapper
430sys32_fchown16_wrapper: 430sys32_fchown16_wrapper:
431 llgfr %r2,%r2 # unsigned int 431 llgfr %r2,%r2 # unsigned int
432 llgfr %r3,%r3 # compat_uid_t 432 llgfr %r3,%r3 # compat_uid_t
433 llgfr %r4,%r4 # compat_uid_t 433 llgfr %r4,%r4 # compat_uid_t
434 jg sys32_fchown16 # branch to system call 434 jg sys32_fchown16 # branch to system call
435 435
436 .globl sys32_getpriority_wrapper 436 .globl sys32_getpriority_wrapper
437sys32_getpriority_wrapper: 437sys32_getpriority_wrapper:
438 lgfr %r2,%r2 # int 438 lgfr %r2,%r2 # int
439 lgfr %r3,%r3 # int 439 lgfr %r3,%r3 # int
440 jg sys_getpriority # branch to system call 440 jg sys_getpriority # branch to system call
441 441
442 .globl sys32_setpriority_wrapper 442 .globl sys32_setpriority_wrapper
443sys32_setpriority_wrapper: 443sys32_setpriority_wrapper:
444 lgfr %r2,%r2 # int 444 lgfr %r2,%r2 # int
445 lgfr %r3,%r3 # int 445 lgfr %r3,%r3 # int
446 lgfr %r4,%r4 # int 446 lgfr %r4,%r4 # int
447 jg sys_setpriority # branch to system call 447 jg sys_setpriority # branch to system call
448 448
449 .globl compat_sys_statfs_wrapper 449 .globl compat_sys_statfs_wrapper
450compat_sys_statfs_wrapper: 450compat_sys_statfs_wrapper:
451 llgtr %r2,%r2 # char * 451 llgtr %r2,%r2 # char *
452 llgtr %r3,%r3 # struct compat_statfs * 452 llgtr %r3,%r3 # struct compat_statfs *
453 jg compat_sys_statfs # branch to system call 453 jg compat_sys_statfs # branch to system call
454 454
455 .globl compat_sys_fstatfs_wrapper 455 .globl compat_sys_fstatfs_wrapper
456compat_sys_fstatfs_wrapper: 456compat_sys_fstatfs_wrapper:
457 llgfr %r2,%r2 # unsigned int 457 llgfr %r2,%r2 # unsigned int
458 llgtr %r3,%r3 # struct compat_statfs * 458 llgtr %r3,%r3 # struct compat_statfs *
459 jg compat_sys_fstatfs # branch to system call 459 jg compat_sys_fstatfs # branch to system call
460 460
461 .globl compat_sys_socketcall_wrapper 461 .globl compat_sys_socketcall_wrapper
462compat_sys_socketcall_wrapper: 462compat_sys_socketcall_wrapper:
463 lgfr %r2,%r2 # int 463 lgfr %r2,%r2 # int
464 llgtr %r3,%r3 # u32 * 464 llgtr %r3,%r3 # u32 *
465 jg compat_sys_socketcall # branch to system call 465 jg compat_sys_socketcall # branch to system call
466 466
467 .globl sys32_syslog_wrapper 467 .globl sys32_syslog_wrapper
468sys32_syslog_wrapper: 468sys32_syslog_wrapper:
469 lgfr %r2,%r2 # int 469 lgfr %r2,%r2 # int
470 llgtr %r3,%r3 # char * 470 llgtr %r3,%r3 # char *
471 lgfr %r4,%r4 # int 471 lgfr %r4,%r4 # int
472 jg sys_syslog # branch to system call 472 jg sys_syslog # branch to system call
473 473
474 .globl compat_sys_setitimer_wrapper 474 .globl compat_sys_setitimer_wrapper
475compat_sys_setitimer_wrapper: 475compat_sys_setitimer_wrapper:
476 lgfr %r2,%r2 # int 476 lgfr %r2,%r2 # int
477 llgtr %r3,%r3 # struct itimerval_emu31 * 477 llgtr %r3,%r3 # struct itimerval_emu31 *
478 llgtr %r4,%r4 # struct itimerval_emu31 * 478 llgtr %r4,%r4 # struct itimerval_emu31 *
479 jg compat_sys_setitimer # branch to system call 479 jg compat_sys_setitimer # branch to system call
480 480
481 .globl compat_sys_getitimer_wrapper 481 .globl compat_sys_getitimer_wrapper
482compat_sys_getitimer_wrapper: 482compat_sys_getitimer_wrapper:
483 lgfr %r2,%r2 # int 483 lgfr %r2,%r2 # int
484 llgtr %r3,%r3 # struct itimerval_emu31 * 484 llgtr %r3,%r3 # struct itimerval_emu31 *
485 jg compat_sys_getitimer # branch to system call 485 jg compat_sys_getitimer # branch to system call
486 486
487 .globl compat_sys_newstat_wrapper 487 .globl compat_sys_newstat_wrapper
488compat_sys_newstat_wrapper: 488compat_sys_newstat_wrapper:
489 llgtr %r2,%r2 # char * 489 llgtr %r2,%r2 # char *
490 llgtr %r3,%r3 # struct stat_emu31 * 490 llgtr %r3,%r3 # struct stat_emu31 *
491 jg compat_sys_newstat # branch to system call 491 jg compat_sys_newstat # branch to system call
492 492
493 .globl compat_sys_newlstat_wrapper 493 .globl compat_sys_newlstat_wrapper
494compat_sys_newlstat_wrapper: 494compat_sys_newlstat_wrapper:
495 llgtr %r2,%r2 # char * 495 llgtr %r2,%r2 # char *
496 llgtr %r3,%r3 # struct stat_emu31 * 496 llgtr %r3,%r3 # struct stat_emu31 *
497 jg compat_sys_newlstat # branch to system call 497 jg compat_sys_newlstat # branch to system call
498 498
499 .globl compat_sys_newfstat_wrapper 499 .globl compat_sys_newfstat_wrapper
500compat_sys_newfstat_wrapper: 500compat_sys_newfstat_wrapper:
501 llgfr %r2,%r2 # unsigned int 501 llgfr %r2,%r2 # unsigned int
502 llgtr %r3,%r3 # struct stat_emu31 * 502 llgtr %r3,%r3 # struct stat_emu31 *
503 jg compat_sys_newfstat # branch to system call 503 jg compat_sys_newfstat # branch to system call
504 504
505#sys32_vhangup_wrapper # void 505#sys32_vhangup_wrapper # void
506 506
507 .globl compat_sys_wait4_wrapper 507 .globl compat_sys_wait4_wrapper
508compat_sys_wait4_wrapper: 508compat_sys_wait4_wrapper:
509 lgfr %r2,%r2 # pid_t 509 lgfr %r2,%r2 # pid_t
510 llgtr %r3,%r3 # unsigned int * 510 llgtr %r3,%r3 # unsigned int *
@@ -512,17 +512,17 @@ compat_sys_wait4_wrapper:
512 llgtr %r5,%r5 # struct rusage * 512 llgtr %r5,%r5 # struct rusage *
513 jg compat_sys_wait4 # branch to system call 513 jg compat_sys_wait4 # branch to system call
514 514
515 .globl sys32_swapoff_wrapper 515 .globl sys32_swapoff_wrapper
516sys32_swapoff_wrapper: 516sys32_swapoff_wrapper:
517 llgtr %r2,%r2 # const char * 517 llgtr %r2,%r2 # const char *
518 jg sys_swapoff # branch to system call 518 jg sys_swapoff # branch to system call
519 519
520 .globl sys32_sysinfo_wrapper 520 .globl sys32_sysinfo_wrapper
521sys32_sysinfo_wrapper: 521sys32_sysinfo_wrapper:
522 llgtr %r2,%r2 # struct sysinfo_emu31 * 522 llgtr %r2,%r2 # struct sysinfo_emu31 *
523 jg sys32_sysinfo # branch to system call 523 jg sys32_sysinfo # branch to system call
524 524
525 .globl sys32_ipc_wrapper 525 .globl sys32_ipc_wrapper
526sys32_ipc_wrapper: 526sys32_ipc_wrapper:
527 llgfr %r2,%r2 # uint 527 llgfr %r2,%r2 # uint
528 lgfr %r3,%r3 # int 528 lgfr %r3,%r3 # int
@@ -531,59 +531,59 @@ sys32_ipc_wrapper:
531 llgfr %r6,%r6 # u32 531 llgfr %r6,%r6 # u32
532 jg sys32_ipc # branch to system call 532 jg sys32_ipc # branch to system call
533 533
534 .globl sys32_fsync_wrapper 534 .globl sys32_fsync_wrapper
535sys32_fsync_wrapper: 535sys32_fsync_wrapper:
536 llgfr %r2,%r2 # unsigned int 536 llgfr %r2,%r2 # unsigned int
537 jg sys_fsync # branch to system call 537 jg sys_fsync # branch to system call
538 538
539#sys32_sigreturn_wrapper # done in sigreturn_glue 539#sys32_sigreturn_wrapper # done in sigreturn_glue
540 540
541#sys32_clone_wrapper # done in clone_glue 541#sys32_clone_wrapper # done in clone_glue
542 542
543 .globl sys32_setdomainname_wrapper 543 .globl sys32_setdomainname_wrapper
544sys32_setdomainname_wrapper: 544sys32_setdomainname_wrapper:
545 llgtr %r2,%r2 # char * 545 llgtr %r2,%r2 # char *
546 lgfr %r3,%r3 # int 546 lgfr %r3,%r3 # int
547 jg sys_setdomainname # branch to system call 547 jg sys_setdomainname # branch to system call
548 548
549 .globl sys32_newuname_wrapper 549 .globl sys32_newuname_wrapper
550sys32_newuname_wrapper: 550sys32_newuname_wrapper:
551 llgtr %r2,%r2 # struct new_utsname * 551 llgtr %r2,%r2 # struct new_utsname *
552 jg s390x_newuname # branch to system call 552 jg s390x_newuname # branch to system call
553 553
554 .globl compat_sys_adjtimex_wrapper 554 .globl compat_sys_adjtimex_wrapper
555compat_sys_adjtimex_wrapper: 555compat_sys_adjtimex_wrapper:
556 llgtr %r2,%r2 # struct compat_timex * 556 llgtr %r2,%r2 # struct compat_timex *
557 jg compat_sys_adjtimex # branch to system call 557 jg compat_sys_adjtimex # branch to system call
558 558
559 .globl sys32_mprotect_wrapper 559 .globl sys32_mprotect_wrapper
560sys32_mprotect_wrapper: 560sys32_mprotect_wrapper:
561 llgtr %r2,%r2 # unsigned long (actually pointer 561 llgtr %r2,%r2 # unsigned long (actually pointer
562 llgfr %r3,%r3 # size_t 562 llgfr %r3,%r3 # size_t
563 llgfr %r4,%r4 # unsigned long 563 llgfr %r4,%r4 # unsigned long
564 jg sys_mprotect # branch to system call 564 jg sys_mprotect # branch to system call
565 565
566 .globl compat_sys_sigprocmask_wrapper 566 .globl compat_sys_sigprocmask_wrapper
567compat_sys_sigprocmask_wrapper: 567compat_sys_sigprocmask_wrapper:
568 lgfr %r2,%r2 # int 568 lgfr %r2,%r2 # int
569 llgtr %r3,%r3 # compat_old_sigset_t * 569 llgtr %r3,%r3 # compat_old_sigset_t *
570 llgtr %r4,%r4 # compat_old_sigset_t * 570 llgtr %r4,%r4 # compat_old_sigset_t *
571 jg compat_sys_sigprocmask # branch to system call 571 jg compat_sys_sigprocmask # branch to system call
572 572
573 .globl sys32_init_module_wrapper 573 .globl sys32_init_module_wrapper
574sys32_init_module_wrapper: 574sys32_init_module_wrapper:
575 llgtr %r2,%r2 # void * 575 llgtr %r2,%r2 # void *
576 llgfr %r3,%r3 # unsigned long 576 llgfr %r3,%r3 # unsigned long
577 llgtr %r4,%r4 # char * 577 llgtr %r4,%r4 # char *
578 jg sys32_init_module # branch to system call 578 jg sys32_init_module # branch to system call
579 579
580 .globl sys32_delete_module_wrapper 580 .globl sys32_delete_module_wrapper
581sys32_delete_module_wrapper: 581sys32_delete_module_wrapper:
582 llgtr %r2,%r2 # const char * 582 llgtr %r2,%r2 # const char *
583 llgfr %r3,%r3 # unsigned int 583 llgfr %r3,%r3 # unsigned int
584 jg sys32_delete_module # branch to system call 584 jg sys32_delete_module # branch to system call
585 585
586 .globl sys32_quotactl_wrapper 586 .globl sys32_quotactl_wrapper
587sys32_quotactl_wrapper: 587sys32_quotactl_wrapper:
588 llgfr %r2,%r2 # unsigned int 588 llgfr %r2,%r2 # unsigned int
589 llgtr %r3,%r3 # const char * 589 llgtr %r3,%r3 # const char *
@@ -591,45 +591,45 @@ sys32_quotactl_wrapper:
591 llgtr %r5,%r5 # caddr_t 591 llgtr %r5,%r5 # caddr_t
592 jg sys_quotactl # branch to system call 592 jg sys_quotactl # branch to system call
593 593
594 .globl sys32_getpgid_wrapper 594 .globl sys32_getpgid_wrapper
595sys32_getpgid_wrapper: 595sys32_getpgid_wrapper:
596 lgfr %r2,%r2 # pid_t 596 lgfr %r2,%r2 # pid_t
597 jg sys_getpgid # branch to system call 597 jg sys_getpgid # branch to system call
598 598
599 .globl sys32_fchdir_wrapper 599 .globl sys32_fchdir_wrapper
600sys32_fchdir_wrapper: 600sys32_fchdir_wrapper:
601 llgfr %r2,%r2 # unsigned int 601 llgfr %r2,%r2 # unsigned int
602 jg sys_fchdir # branch to system call 602 jg sys_fchdir # branch to system call
603 603
604 .globl sys32_bdflush_wrapper 604 .globl sys32_bdflush_wrapper
605sys32_bdflush_wrapper: 605sys32_bdflush_wrapper:
606 lgfr %r2,%r2 # int 606 lgfr %r2,%r2 # int
607 lgfr %r3,%r3 # long 607 lgfr %r3,%r3 # long
608 jg sys_bdflush # branch to system call 608 jg sys_bdflush # branch to system call
609 609
610 .globl sys32_sysfs_wrapper 610 .globl sys32_sysfs_wrapper
611sys32_sysfs_wrapper: 611sys32_sysfs_wrapper:
612 lgfr %r2,%r2 # int 612 lgfr %r2,%r2 # int
613 llgfr %r3,%r3 # unsigned long 613 llgfr %r3,%r3 # unsigned long
614 llgfr %r4,%r4 # unsigned long 614 llgfr %r4,%r4 # unsigned long
615 jg sys_sysfs # branch to system call 615 jg sys_sysfs # branch to system call
616 616
617 .globl sys32_personality_wrapper 617 .globl sys32_personality_wrapper
618sys32_personality_wrapper: 618sys32_personality_wrapper:
619 llgfr %r2,%r2 # unsigned long 619 llgfr %r2,%r2 # unsigned long
620 jg s390x_personality # branch to system call 620 jg s390x_personality # branch to system call
621 621
622 .globl sys32_setfsuid16_wrapper 622 .globl sys32_setfsuid16_wrapper
623sys32_setfsuid16_wrapper: 623sys32_setfsuid16_wrapper:
624 llgfr %r2,%r2 # __kernel_old_uid_emu31_t 624 llgfr %r2,%r2 # __kernel_old_uid_emu31_t
625 jg sys32_setfsuid16 # branch to system call 625 jg sys32_setfsuid16 # branch to system call
626 626
627 .globl sys32_setfsgid16_wrapper 627 .globl sys32_setfsgid16_wrapper
628sys32_setfsgid16_wrapper: 628sys32_setfsgid16_wrapper:
629 llgfr %r2,%r2 # __kernel_old_gid_emu31_t 629 llgfr %r2,%r2 # __kernel_old_gid_emu31_t
630 jg sys32_setfsgid16 # branch to system call 630 jg sys32_setfsgid16 # branch to system call
631 631
632 .globl sys32_llseek_wrapper 632 .globl sys32_llseek_wrapper
633sys32_llseek_wrapper: 633sys32_llseek_wrapper:
634 llgfr %r2,%r2 # unsigned int 634 llgfr %r2,%r2 # unsigned int
635 llgfr %r3,%r3 # unsigned long 635 llgfr %r3,%r3 # unsigned long
@@ -638,14 +638,14 @@ sys32_llseek_wrapper:
638 llgfr %r6,%r6 # unsigned int 638 llgfr %r6,%r6 # unsigned int
639 jg sys_llseek # branch to system call 639 jg sys_llseek # branch to system call
640 640
641 .globl sys32_getdents_wrapper 641 .globl sys32_getdents_wrapper
642sys32_getdents_wrapper: 642sys32_getdents_wrapper:
643 llgfr %r2,%r2 # unsigned int 643 llgfr %r2,%r2 # unsigned int
644 llgtr %r3,%r3 # void * 644 llgtr %r3,%r3 # void *
645 llgfr %r4,%r4 # unsigned int 645 llgfr %r4,%r4 # unsigned int
646 jg compat_sys_getdents # branch to system call 646 jg compat_sys_getdents # branch to system call
647 647
648 .globl compat_sys_select_wrapper 648 .globl compat_sys_select_wrapper
649compat_sys_select_wrapper: 649compat_sys_select_wrapper:
650 lgfr %r2,%r2 # int 650 lgfr %r2,%r2 # int
651 llgtr %r3,%r3 # compat_fd_set * 651 llgtr %r3,%r3 # compat_fd_set *
@@ -654,113 +654,113 @@ compat_sys_select_wrapper:
654 llgtr %r6,%r6 # struct compat_timeval * 654 llgtr %r6,%r6 # struct compat_timeval *
655 jg compat_sys_select # branch to system call 655 jg compat_sys_select # branch to system call
656 656
657 .globl sys32_flock_wrapper 657 .globl sys32_flock_wrapper
658sys32_flock_wrapper: 658sys32_flock_wrapper:
659 llgfr %r2,%r2 # unsigned int 659 llgfr %r2,%r2 # unsigned int
660 llgfr %r3,%r3 # unsigned int 660 llgfr %r3,%r3 # unsigned int
661 jg sys_flock # branch to system call 661 jg sys_flock # branch to system call
662 662
663 .globl sys32_msync_wrapper 663 .globl sys32_msync_wrapper
664sys32_msync_wrapper: 664sys32_msync_wrapper:
665 llgfr %r2,%r2 # unsigned long 665 llgfr %r2,%r2 # unsigned long
666 llgfr %r3,%r3 # size_t 666 llgfr %r3,%r3 # size_t
667 lgfr %r4,%r4 # int 667 lgfr %r4,%r4 # int
668 jg sys_msync # branch to system call 668 jg sys_msync # branch to system call
669 669
670 .globl compat_sys_readv_wrapper 670 .globl compat_sys_readv_wrapper
671compat_sys_readv_wrapper: 671compat_sys_readv_wrapper:
672 lgfr %r2,%r2 # int 672 lgfr %r2,%r2 # int
673 llgtr %r3,%r3 # const struct compat_iovec * 673 llgtr %r3,%r3 # const struct compat_iovec *
674 llgfr %r4,%r4 # unsigned long 674 llgfr %r4,%r4 # unsigned long
675 jg compat_sys_readv # branch to system call 675 jg compat_sys_readv # branch to system call
676 676
677 .globl compat_sys_writev_wrapper 677 .globl compat_sys_writev_wrapper
678compat_sys_writev_wrapper: 678compat_sys_writev_wrapper:
679 lgfr %r2,%r2 # int 679 lgfr %r2,%r2 # int
680 llgtr %r3,%r3 # const struct compat_iovec * 680 llgtr %r3,%r3 # const struct compat_iovec *
681 llgfr %r4,%r4 # unsigned long 681 llgfr %r4,%r4 # unsigned long
682 jg compat_sys_writev # branch to system call 682 jg compat_sys_writev # branch to system call
683 683
684 .globl sys32_getsid_wrapper 684 .globl sys32_getsid_wrapper
685sys32_getsid_wrapper: 685sys32_getsid_wrapper:
686 lgfr %r2,%r2 # pid_t 686 lgfr %r2,%r2 # pid_t
687 jg sys_getsid # branch to system call 687 jg sys_getsid # branch to system call
688 688
689 .globl sys32_fdatasync_wrapper 689 .globl sys32_fdatasync_wrapper
690sys32_fdatasync_wrapper: 690sys32_fdatasync_wrapper:
691 llgfr %r2,%r2 # unsigned int 691 llgfr %r2,%r2 # unsigned int
692 jg sys_fdatasync # branch to system call 692 jg sys_fdatasync # branch to system call
693 693
694#sys32_sysctl_wrapper # tbd 694#sys32_sysctl_wrapper # tbd
695 695
696 .globl sys32_mlock_wrapper 696 .globl sys32_mlock_wrapper
697sys32_mlock_wrapper: 697sys32_mlock_wrapper:
698 llgfr %r2,%r2 # unsigned long 698 llgfr %r2,%r2 # unsigned long
699 llgfr %r3,%r3 # size_t 699 llgfr %r3,%r3 # size_t
700 jg sys_mlock # branch to system call 700 jg sys_mlock # branch to system call
701 701
702 .globl sys32_munlock_wrapper 702 .globl sys32_munlock_wrapper
703sys32_munlock_wrapper: 703sys32_munlock_wrapper:
704 llgfr %r2,%r2 # unsigned long 704 llgfr %r2,%r2 # unsigned long
705 llgfr %r3,%r3 # size_t 705 llgfr %r3,%r3 # size_t
706 jg sys_munlock # branch to system call 706 jg sys_munlock # branch to system call
707 707
708 .globl sys32_mlockall_wrapper 708 .globl sys32_mlockall_wrapper
709sys32_mlockall_wrapper: 709sys32_mlockall_wrapper:
710 lgfr %r2,%r2 # int 710 lgfr %r2,%r2 # int
711 jg sys_mlockall # branch to system call 711 jg sys_mlockall # branch to system call
712 712
713#sys32_munlockall_wrapper # void 713#sys32_munlockall_wrapper # void
714 714
715 .globl sys32_sched_setparam_wrapper 715 .globl sys32_sched_setparam_wrapper
716sys32_sched_setparam_wrapper: 716sys32_sched_setparam_wrapper:
717 lgfr %r2,%r2 # pid_t 717 lgfr %r2,%r2 # pid_t
718 llgtr %r3,%r3 # struct sched_param * 718 llgtr %r3,%r3 # struct sched_param *
719 jg sys_sched_setparam # branch to system call 719 jg sys_sched_setparam # branch to system call
720 720
721 .globl sys32_sched_getparam_wrapper 721 .globl sys32_sched_getparam_wrapper
722sys32_sched_getparam_wrapper: 722sys32_sched_getparam_wrapper:
723 lgfr %r2,%r2 # pid_t 723 lgfr %r2,%r2 # pid_t
724 llgtr %r3,%r3 # struct sched_param * 724 llgtr %r3,%r3 # struct sched_param *
725 jg sys_sched_getparam # branch to system call 725 jg sys_sched_getparam # branch to system call
726 726
727 .globl sys32_sched_setscheduler_wrapper 727 .globl sys32_sched_setscheduler_wrapper
728sys32_sched_setscheduler_wrapper: 728sys32_sched_setscheduler_wrapper:
729 lgfr %r2,%r2 # pid_t 729 lgfr %r2,%r2 # pid_t
730 lgfr %r3,%r3 # int 730 lgfr %r3,%r3 # int
731 llgtr %r4,%r4 # struct sched_param * 731 llgtr %r4,%r4 # struct sched_param *
732 jg sys_sched_setscheduler # branch to system call 732 jg sys_sched_setscheduler # branch to system call
733 733
734 .globl sys32_sched_getscheduler_wrapper 734 .globl sys32_sched_getscheduler_wrapper
735sys32_sched_getscheduler_wrapper: 735sys32_sched_getscheduler_wrapper:
736 lgfr %r2,%r2 # pid_t 736 lgfr %r2,%r2 # pid_t
737 jg sys_sched_getscheduler # branch to system call 737 jg sys_sched_getscheduler # branch to system call
738 738
739#sys32_sched_yield_wrapper # void 739#sys32_sched_yield_wrapper # void
740 740
741 .globl sys32_sched_get_priority_max_wrapper 741 .globl sys32_sched_get_priority_max_wrapper
742sys32_sched_get_priority_max_wrapper: 742sys32_sched_get_priority_max_wrapper:
743 lgfr %r2,%r2 # int 743 lgfr %r2,%r2 # int
744 jg sys_sched_get_priority_max # branch to system call 744 jg sys_sched_get_priority_max # branch to system call
745 745
746 .globl sys32_sched_get_priority_min_wrapper 746 .globl sys32_sched_get_priority_min_wrapper
747sys32_sched_get_priority_min_wrapper: 747sys32_sched_get_priority_min_wrapper:
748 lgfr %r2,%r2 # int 748 lgfr %r2,%r2 # int
749 jg sys_sched_get_priority_min # branch to system call 749 jg sys_sched_get_priority_min # branch to system call
750 750
751 .globl sys32_sched_rr_get_interval_wrapper 751 .globl sys32_sched_rr_get_interval_wrapper
752sys32_sched_rr_get_interval_wrapper: 752sys32_sched_rr_get_interval_wrapper:
753 lgfr %r2,%r2 # pid_t 753 lgfr %r2,%r2 # pid_t
754 llgtr %r3,%r3 # struct compat_timespec * 754 llgtr %r3,%r3 # struct compat_timespec *
755 jg sys32_sched_rr_get_interval # branch to system call 755 jg sys32_sched_rr_get_interval # branch to system call
756 756
757 .globl compat_sys_nanosleep_wrapper 757 .globl compat_sys_nanosleep_wrapper
758compat_sys_nanosleep_wrapper: 758compat_sys_nanosleep_wrapper:
759 llgtr %r2,%r2 # struct compat_timespec * 759 llgtr %r2,%r2 # struct compat_timespec *
760 llgtr %r3,%r3 # struct compat_timespec * 760 llgtr %r3,%r3 # struct compat_timespec *
761 jg compat_sys_nanosleep # branch to system call 761 jg compat_sys_nanosleep # branch to system call
762 762
763 .globl sys32_mremap_wrapper 763 .globl sys32_mremap_wrapper
764sys32_mremap_wrapper: 764sys32_mremap_wrapper:
765 llgfr %r2,%r2 # unsigned long 765 llgfr %r2,%r2 # unsigned long
766 llgfr %r3,%r3 # unsigned long 766 llgfr %r3,%r3 # unsigned long
@@ -769,49 +769,49 @@ sys32_mremap_wrapper:
769 llgfr %r6,%r6 # unsigned long 769 llgfr %r6,%r6 # unsigned long
770 jg sys_mremap # branch to system call 770 jg sys_mremap # branch to system call
771 771
772 .globl sys32_setresuid16_wrapper 772 .globl sys32_setresuid16_wrapper
773sys32_setresuid16_wrapper: 773sys32_setresuid16_wrapper:
774 llgfr %r2,%r2 # __kernel_old_uid_emu31_t 774 llgfr %r2,%r2 # __kernel_old_uid_emu31_t
775 llgfr %r3,%r3 # __kernel_old_uid_emu31_t 775 llgfr %r3,%r3 # __kernel_old_uid_emu31_t
776 llgfr %r4,%r4 # __kernel_old_uid_emu31_t 776 llgfr %r4,%r4 # __kernel_old_uid_emu31_t
777 jg sys32_setresuid16 # branch to system call 777 jg sys32_setresuid16 # branch to system call
778 778
779 .globl sys32_getresuid16_wrapper 779 .globl sys32_getresuid16_wrapper
780sys32_getresuid16_wrapper: 780sys32_getresuid16_wrapper:
781 llgtr %r2,%r2 # __kernel_old_uid_emu31_t * 781 llgtr %r2,%r2 # __kernel_old_uid_emu31_t *
782 llgtr %r3,%r3 # __kernel_old_uid_emu31_t * 782 llgtr %r3,%r3 # __kernel_old_uid_emu31_t *
783 llgtr %r4,%r4 # __kernel_old_uid_emu31_t * 783 llgtr %r4,%r4 # __kernel_old_uid_emu31_t *
784 jg sys32_getresuid16 # branch to system call 784 jg sys32_getresuid16 # branch to system call
785 785
786 .globl sys32_poll_wrapper 786 .globl sys32_poll_wrapper
787sys32_poll_wrapper: 787sys32_poll_wrapper:
788 llgtr %r2,%r2 # struct pollfd * 788 llgtr %r2,%r2 # struct pollfd *
789 llgfr %r3,%r3 # unsigned int 789 llgfr %r3,%r3 # unsigned int
790 lgfr %r4,%r4 # long 790 lgfr %r4,%r4 # long
791 jg sys_poll # branch to system call 791 jg sys_poll # branch to system call
792 792
793 .globl compat_sys_nfsservctl_wrapper 793 .globl compat_sys_nfsservctl_wrapper
794compat_sys_nfsservctl_wrapper: 794compat_sys_nfsservctl_wrapper:
795 lgfr %r2,%r2 # int 795 lgfr %r2,%r2 # int
796 llgtr %r3,%r3 # struct compat_nfsctl_arg* 796 llgtr %r3,%r3 # struct compat_nfsctl_arg*
797 llgtr %r4,%r4 # union compat_nfsctl_res* 797 llgtr %r4,%r4 # union compat_nfsctl_res*
798 jg compat_sys_nfsservctl # branch to system call 798 jg compat_sys_nfsservctl # branch to system call
799 799
800 .globl sys32_setresgid16_wrapper 800 .globl sys32_setresgid16_wrapper
801sys32_setresgid16_wrapper: 801sys32_setresgid16_wrapper:
802 llgfr %r2,%r2 # __kernel_old_gid_emu31_t 802 llgfr %r2,%r2 # __kernel_old_gid_emu31_t
803 llgfr %r3,%r3 # __kernel_old_gid_emu31_t 803 llgfr %r3,%r3 # __kernel_old_gid_emu31_t
804 llgfr %r4,%r4 # __kernel_old_gid_emu31_t 804 llgfr %r4,%r4 # __kernel_old_gid_emu31_t
805 jg sys32_setresgid16 # branch to system call 805 jg sys32_setresgid16 # branch to system call
806 806
807 .globl sys32_getresgid16_wrapper 807 .globl sys32_getresgid16_wrapper
808sys32_getresgid16_wrapper: 808sys32_getresgid16_wrapper:
809 llgtr %r2,%r2 # __kernel_old_gid_emu31_t * 809 llgtr %r2,%r2 # __kernel_old_gid_emu31_t *
810 llgtr %r3,%r3 # __kernel_old_gid_emu31_t * 810 llgtr %r3,%r3 # __kernel_old_gid_emu31_t *
811 llgtr %r4,%r4 # __kernel_old_gid_emu31_t * 811 llgtr %r4,%r4 # __kernel_old_gid_emu31_t *
812 jg sys32_getresgid16 # branch to system call 812 jg sys32_getresgid16 # branch to system call
813 813
814 .globl sys32_prctl_wrapper 814 .globl sys32_prctl_wrapper
815sys32_prctl_wrapper: 815sys32_prctl_wrapper:
816 lgfr %r2,%r2 # int 816 lgfr %r2,%r2 # int
817 llgfr %r3,%r3 # unsigned long 817 llgfr %r3,%r3 # unsigned long
@@ -820,9 +820,9 @@ sys32_prctl_wrapper:
820 llgfr %r6,%r6 # unsigned long 820 llgfr %r6,%r6 # unsigned long
821 jg sys_prctl # branch to system call 821 jg sys_prctl # branch to system call
822 822
823#sys32_rt_sigreturn_wrapper # done in rt_sigreturn_glue 823#sys32_rt_sigreturn_wrapper # done in rt_sigreturn_glue
824 824
825 .globl sys32_rt_sigaction_wrapper 825 .globl sys32_rt_sigaction_wrapper
826sys32_rt_sigaction_wrapper: 826sys32_rt_sigaction_wrapper:
827 lgfr %r2,%r2 # int 827 lgfr %r2,%r2 # int
828 llgtr %r3,%r3 # const struct sigaction_emu31 * 828 llgtr %r3,%r3 # const struct sigaction_emu31 *
@@ -830,7 +830,7 @@ sys32_rt_sigaction_wrapper:
830 llgfr %r5,%r5 # size_t 830 llgfr %r5,%r5 # size_t
831 jg sys32_rt_sigaction # branch to system call 831 jg sys32_rt_sigaction # branch to system call
832 832
833 .globl sys32_rt_sigprocmask_wrapper 833 .globl sys32_rt_sigprocmask_wrapper
834sys32_rt_sigprocmask_wrapper: 834sys32_rt_sigprocmask_wrapper:
835 lgfr %r2,%r2 # int 835 lgfr %r2,%r2 # int
836 llgtr %r3,%r3 # old_sigset_emu31 * 836 llgtr %r3,%r3 # old_sigset_emu31 *
@@ -838,13 +838,13 @@ sys32_rt_sigprocmask_wrapper:
838 llgfr %r5,%r5 # size_t 838 llgfr %r5,%r5 # size_t
839 jg sys32_rt_sigprocmask # branch to system call 839 jg sys32_rt_sigprocmask # branch to system call
840 840
841 .globl sys32_rt_sigpending_wrapper 841 .globl sys32_rt_sigpending_wrapper
842sys32_rt_sigpending_wrapper: 842sys32_rt_sigpending_wrapper:
843 llgtr %r2,%r2 # sigset_emu31 * 843 llgtr %r2,%r2 # sigset_emu31 *
844 llgfr %r3,%r3 # size_t 844 llgfr %r3,%r3 # size_t
845 jg sys32_rt_sigpending # branch to system call 845 jg sys32_rt_sigpending # branch to system call
846 846
847 .globl compat_sys_rt_sigtimedwait_wrapper 847 .globl compat_sys_rt_sigtimedwait_wrapper
848compat_sys_rt_sigtimedwait_wrapper: 848compat_sys_rt_sigtimedwait_wrapper:
849 llgtr %r2,%r2 # const sigset_emu31_t * 849 llgtr %r2,%r2 # const sigset_emu31_t *
850 llgtr %r3,%r3 # siginfo_emu31_t * 850 llgtr %r3,%r3 # siginfo_emu31_t *
@@ -852,7 +852,7 @@ compat_sys_rt_sigtimedwait_wrapper:
852 llgfr %r5,%r5 # size_t 852 llgfr %r5,%r5 # size_t
853 jg compat_sys_rt_sigtimedwait # branch to system call 853 jg compat_sys_rt_sigtimedwait # branch to system call
854 854
855 .globl sys32_rt_sigqueueinfo_wrapper 855 .globl sys32_rt_sigqueueinfo_wrapper
856sys32_rt_sigqueueinfo_wrapper: 856sys32_rt_sigqueueinfo_wrapper:
857 lgfr %r2,%r2 # int 857 lgfr %r2,%r2 # int
858 lgfr %r3,%r3 # int 858 lgfr %r3,%r3 # int
@@ -865,7 +865,7 @@ compat_sys_rt_sigsuspend_wrapper:
865 llgfr %r3,%r3 # compat_size_t 865 llgfr %r3,%r3 # compat_size_t
866 jg compat_sys_rt_sigsuspend 866 jg compat_sys_rt_sigsuspend
867 867
868 .globl sys32_pread64_wrapper 868 .globl sys32_pread64_wrapper
869sys32_pread64_wrapper: 869sys32_pread64_wrapper:
870 llgfr %r2,%r2 # unsigned int 870 llgfr %r2,%r2 # unsigned int
871 llgtr %r3,%r3 # char * 871 llgtr %r3,%r3 # char *
@@ -874,7 +874,7 @@ sys32_pread64_wrapper:
874 llgfr %r6,%r6 # u32 874 llgfr %r6,%r6 # u32
875 jg sys32_pread64 # branch to system call 875 jg sys32_pread64 # branch to system call
876 876
877 .globl sys32_pwrite64_wrapper 877 .globl sys32_pwrite64_wrapper
878sys32_pwrite64_wrapper: 878sys32_pwrite64_wrapper:
879 llgfr %r2,%r2 # unsigned int 879 llgfr %r2,%r2 # unsigned int
880 llgtr %r3,%r3 # const char * 880 llgtr %r3,%r3 # const char *
@@ -883,26 +883,26 @@ sys32_pwrite64_wrapper:
883 llgfr %r6,%r6 # u32 883 llgfr %r6,%r6 # u32
884 jg sys32_pwrite64 # branch to system call 884 jg sys32_pwrite64 # branch to system call
885 885
886 .globl sys32_chown16_wrapper 886 .globl sys32_chown16_wrapper
887sys32_chown16_wrapper: 887sys32_chown16_wrapper:
888 llgtr %r2,%r2 # const char * 888 llgtr %r2,%r2 # const char *
889 llgfr %r3,%r3 # __kernel_old_uid_emu31_t 889 llgfr %r3,%r3 # __kernel_old_uid_emu31_t
890 llgfr %r4,%r4 # __kernel_old_gid_emu31_t 890 llgfr %r4,%r4 # __kernel_old_gid_emu31_t
891 jg sys32_chown16 # branch to system call 891 jg sys32_chown16 # branch to system call
892 892
893 .globl sys32_getcwd_wrapper 893 .globl sys32_getcwd_wrapper
894sys32_getcwd_wrapper: 894sys32_getcwd_wrapper:
895 llgtr %r2,%r2 # char * 895 llgtr %r2,%r2 # char *
896 llgfr %r3,%r3 # unsigned long 896 llgfr %r3,%r3 # unsigned long
897 jg sys_getcwd # branch to system call 897 jg sys_getcwd # branch to system call
898 898
899 .globl sys32_capget_wrapper 899 .globl sys32_capget_wrapper
900sys32_capget_wrapper: 900sys32_capget_wrapper:
901 llgtr %r2,%r2 # cap_user_header_t 901 llgtr %r2,%r2 # cap_user_header_t
902 llgtr %r3,%r3 # cap_user_data_t 902 llgtr %r3,%r3 # cap_user_data_t
903 jg sys_capget # branch to system call 903 jg sys_capget # branch to system call
904 904
905 .globl sys32_capset_wrapper 905 .globl sys32_capset_wrapper
906sys32_capset_wrapper: 906sys32_capset_wrapper:
907 llgtr %r2,%r2 # cap_user_header_t 907 llgtr %r2,%r2 # cap_user_header_t
908 llgtr %r3,%r3 # const cap_user_data_t 908 llgtr %r3,%r3 # const cap_user_data_t
@@ -910,11 +910,11 @@ sys32_capset_wrapper:
910 910
911 .globl sys32_sigaltstack_wrapper 911 .globl sys32_sigaltstack_wrapper
912sys32_sigaltstack_wrapper: 912sys32_sigaltstack_wrapper:
913 llgtr %r2,%r2 # const stack_emu31_t * 913 llgtr %r2,%r2 # const stack_emu31_t *
914 llgtr %r3,%r3 # stack_emu31_t * 914 llgtr %r3,%r3 # stack_emu31_t *
915 jg sys32_sigaltstack 915 jg sys32_sigaltstack
916 916
917 .globl sys32_sendfile_wrapper 917 .globl sys32_sendfile_wrapper
918sys32_sendfile_wrapper: 918sys32_sendfile_wrapper:
919 lgfr %r2,%r2 # int 919 lgfr %r2,%r2 # int
920 lgfr %r3,%r3 # int 920 lgfr %r3,%r3 # int
@@ -922,33 +922,33 @@ sys32_sendfile_wrapper:
922 llgfr %r5,%r5 # size_t 922 llgfr %r5,%r5 # size_t
923 jg sys32_sendfile # branch to system call 923 jg sys32_sendfile # branch to system call
924 924
925#sys32_vfork_wrapper # done in vfork_glue 925#sys32_vfork_wrapper # done in vfork_glue
926 926
927 .globl sys32_truncate64_wrapper 927 .globl sys32_truncate64_wrapper
928sys32_truncate64_wrapper: 928sys32_truncate64_wrapper:
929 llgtr %r2,%r2 # const char * 929 llgtr %r2,%r2 # const char *
930 llgfr %r3,%r3 # unsigned long 930 llgfr %r3,%r3 # unsigned long
931 llgfr %r4,%r4 # unsigned long 931 llgfr %r4,%r4 # unsigned long
932 jg sys32_truncate64 # branch to system call 932 jg sys32_truncate64 # branch to system call
933 933
934 .globl sys32_ftruncate64_wrapper 934 .globl sys32_ftruncate64_wrapper
935sys32_ftruncate64_wrapper: 935sys32_ftruncate64_wrapper:
936 llgfr %r2,%r2 # unsigned int 936 llgfr %r2,%r2 # unsigned int
937 llgfr %r3,%r3 # unsigned long 937 llgfr %r3,%r3 # unsigned long
938 llgfr %r4,%r4 # unsigned long 938 llgfr %r4,%r4 # unsigned long
939 jg sys32_ftruncate64 # branch to system call 939 jg sys32_ftruncate64 # branch to system call
940 940
941 .globl sys32_lchown_wrapper 941 .globl sys32_lchown_wrapper
942sys32_lchown_wrapper: 942sys32_lchown_wrapper:
943 llgtr %r2,%r2 # const char * 943 llgtr %r2,%r2 # const char *
944 llgfr %r3,%r3 # uid_t 944 llgfr %r3,%r3 # uid_t
945 llgfr %r4,%r4 # gid_t 945 llgfr %r4,%r4 # gid_t
946 jg sys_lchown # branch to system call 946 jg sys_lchown # branch to system call
947 947
948#sys32_getuid_wrapper # void 948#sys32_getuid_wrapper # void
949#sys32_getgid_wrapper # void 949#sys32_getgid_wrapper # void
950#sys32_geteuid_wrapper # void 950#sys32_geteuid_wrapper # void
951#sys32_getegid_wrapper # void 951#sys32_getegid_wrapper # void
952 952
953 .globl sys32_setreuid_wrapper 953 .globl sys32_setreuid_wrapper
954sys32_setreuid_wrapper: 954sys32_setreuid_wrapper:
@@ -962,111 +962,111 @@ sys32_setregid_wrapper:
962 llgfr %r3,%r3 # gid_t 962 llgfr %r3,%r3 # gid_t
963 jg sys_setregid # branch to system call 963 jg sys_setregid # branch to system call
964 964
965 .globl sys32_getgroups_wrapper 965 .globl sys32_getgroups_wrapper
966sys32_getgroups_wrapper: 966sys32_getgroups_wrapper:
967 lgfr %r2,%r2 # int 967 lgfr %r2,%r2 # int
968 llgtr %r3,%r3 # gid_t * 968 llgtr %r3,%r3 # gid_t *
969 jg sys_getgroups # branch to system call 969 jg sys_getgroups # branch to system call
970 970
971 .globl sys32_setgroups_wrapper 971 .globl sys32_setgroups_wrapper
972sys32_setgroups_wrapper: 972sys32_setgroups_wrapper:
973 lgfr %r2,%r2 # int 973 lgfr %r2,%r2 # int
974 llgtr %r3,%r3 # gid_t * 974 llgtr %r3,%r3 # gid_t *
975 jg sys_setgroups # branch to system call 975 jg sys_setgroups # branch to system call
976 976
977 .globl sys32_fchown_wrapper 977 .globl sys32_fchown_wrapper
978sys32_fchown_wrapper: 978sys32_fchown_wrapper:
979 llgfr %r2,%r2 # unsigned int 979 llgfr %r2,%r2 # unsigned int
980 llgfr %r3,%r3 # uid_t 980 llgfr %r3,%r3 # uid_t
981 llgfr %r4,%r4 # gid_t 981 llgfr %r4,%r4 # gid_t
982 jg sys_fchown # branch to system call 982 jg sys_fchown # branch to system call
983 983
984 .globl sys32_setresuid_wrapper 984 .globl sys32_setresuid_wrapper
985sys32_setresuid_wrapper: 985sys32_setresuid_wrapper:
986 llgfr %r2,%r2 # uid_t 986 llgfr %r2,%r2 # uid_t
987 llgfr %r3,%r3 # uid_t 987 llgfr %r3,%r3 # uid_t
988 llgfr %r4,%r4 # uid_t 988 llgfr %r4,%r4 # uid_t
989 jg sys_setresuid # branch to system call 989 jg sys_setresuid # branch to system call
990 990
991 .globl sys32_getresuid_wrapper 991 .globl sys32_getresuid_wrapper
992sys32_getresuid_wrapper: 992sys32_getresuid_wrapper:
993 llgtr %r2,%r2 # uid_t * 993 llgtr %r2,%r2 # uid_t *
994 llgtr %r3,%r3 # uid_t * 994 llgtr %r3,%r3 # uid_t *
995 llgtr %r4,%r4 # uid_t * 995 llgtr %r4,%r4 # uid_t *
996 jg sys_getresuid # branch to system call 996 jg sys_getresuid # branch to system call
997 997
998 .globl sys32_setresgid_wrapper 998 .globl sys32_setresgid_wrapper
999sys32_setresgid_wrapper: 999sys32_setresgid_wrapper:
1000 llgfr %r2,%r2 # gid_t 1000 llgfr %r2,%r2 # gid_t
1001 llgfr %r3,%r3 # gid_t 1001 llgfr %r3,%r3 # gid_t
1002 llgfr %r4,%r4 # gid_t 1002 llgfr %r4,%r4 # gid_t
1003 jg sys_setresgid # branch to system call 1003 jg sys_setresgid # branch to system call
1004 1004
1005 .globl sys32_getresgid_wrapper 1005 .globl sys32_getresgid_wrapper
1006sys32_getresgid_wrapper: 1006sys32_getresgid_wrapper:
1007 llgtr %r2,%r2 # gid_t * 1007 llgtr %r2,%r2 # gid_t *
1008 llgtr %r3,%r3 # gid_t * 1008 llgtr %r3,%r3 # gid_t *
1009 llgtr %r4,%r4 # gid_t * 1009 llgtr %r4,%r4 # gid_t *
1010 jg sys_getresgid # branch to system call 1010 jg sys_getresgid # branch to system call
1011 1011
1012 .globl sys32_chown_wrapper 1012 .globl sys32_chown_wrapper
1013sys32_chown_wrapper: 1013sys32_chown_wrapper:
1014 llgtr %r2,%r2 # const char * 1014 llgtr %r2,%r2 # const char *
1015 llgfr %r3,%r3 # uid_t 1015 llgfr %r3,%r3 # uid_t
1016 llgfr %r4,%r4 # gid_t 1016 llgfr %r4,%r4 # gid_t
1017 jg sys_chown # branch to system call 1017 jg sys_chown # branch to system call
1018 1018
1019 .globl sys32_setuid_wrapper 1019 .globl sys32_setuid_wrapper
1020sys32_setuid_wrapper: 1020sys32_setuid_wrapper:
1021 llgfr %r2,%r2 # uid_t 1021 llgfr %r2,%r2 # uid_t
1022 jg sys_setuid # branch to system call 1022 jg sys_setuid # branch to system call
1023 1023
1024 .globl sys32_setgid_wrapper 1024 .globl sys32_setgid_wrapper
1025sys32_setgid_wrapper: 1025sys32_setgid_wrapper:
1026 llgfr %r2,%r2 # gid_t 1026 llgfr %r2,%r2 # gid_t
1027 jg sys_setgid # branch to system call 1027 jg sys_setgid # branch to system call
1028 1028
1029 .globl sys32_setfsuid_wrapper 1029 .globl sys32_setfsuid_wrapper
1030sys32_setfsuid_wrapper: 1030sys32_setfsuid_wrapper:
1031 llgfr %r2,%r2 # uid_t 1031 llgfr %r2,%r2 # uid_t
1032 jg sys_setfsuid # branch to system call 1032 jg sys_setfsuid # branch to system call
1033 1033
1034 .globl sys32_setfsgid_wrapper 1034 .globl sys32_setfsgid_wrapper
1035sys32_setfsgid_wrapper: 1035sys32_setfsgid_wrapper:
1036 llgfr %r2,%r2 # gid_t 1036 llgfr %r2,%r2 # gid_t
1037 jg sys_setfsgid # branch to system call 1037 jg sys_setfsgid # branch to system call
1038 1038
1039 .globl sys32_pivot_root_wrapper 1039 .globl sys32_pivot_root_wrapper
1040sys32_pivot_root_wrapper: 1040sys32_pivot_root_wrapper:
1041 llgtr %r2,%r2 # const char * 1041 llgtr %r2,%r2 # const char *
1042 llgtr %r3,%r3 # const char * 1042 llgtr %r3,%r3 # const char *
1043 jg sys_pivot_root # branch to system call 1043 jg sys_pivot_root # branch to system call
1044 1044
1045 .globl sys32_mincore_wrapper 1045 .globl sys32_mincore_wrapper
1046sys32_mincore_wrapper: 1046sys32_mincore_wrapper:
1047 llgfr %r2,%r2 # unsigned long 1047 llgfr %r2,%r2 # unsigned long
1048 llgfr %r3,%r3 # size_t 1048 llgfr %r3,%r3 # size_t
1049 llgtr %r4,%r4 # unsigned char * 1049 llgtr %r4,%r4 # unsigned char *
1050 jg sys_mincore # branch to system call 1050 jg sys_mincore # branch to system call
1051 1051
1052 .globl sys32_madvise_wrapper 1052 .globl sys32_madvise_wrapper
1053sys32_madvise_wrapper: 1053sys32_madvise_wrapper:
1054 llgfr %r2,%r2 # unsigned long 1054 llgfr %r2,%r2 # unsigned long
1055 llgfr %r3,%r3 # size_t 1055 llgfr %r3,%r3 # size_t
1056 lgfr %r4,%r4 # int 1056 lgfr %r4,%r4 # int
1057 jg sys_madvise # branch to system call 1057 jg sys_madvise # branch to system call
1058 1058
1059 .globl sys32_getdents64_wrapper 1059 .globl sys32_getdents64_wrapper
1060sys32_getdents64_wrapper: 1060sys32_getdents64_wrapper:
1061 llgfr %r2,%r2 # unsigned int 1061 llgfr %r2,%r2 # unsigned int
1062 llgtr %r3,%r3 # void * 1062 llgtr %r3,%r3 # void *
1063 llgfr %r4,%r4 # unsigned int 1063 llgfr %r4,%r4 # unsigned int
1064 jg sys_getdents64 # branch to system call 1064 jg sys_getdents64 # branch to system call
1065 1065
1066 .globl compat_sys_fcntl64_wrapper 1066 .globl compat_sys_fcntl64_wrapper
1067compat_sys_fcntl64_wrapper: 1067compat_sys_fcntl64_wrapper:
1068 llgfr %r2,%r2 # unsigned int 1068 llgfr %r2,%r2 # unsigned int
1069 llgfr %r3,%r3 # unsigned int 1069 llgfr %r3,%r3 # unsigned int
1070 llgfr %r4,%r4 # unsigned long 1070 llgfr %r4,%r4 # unsigned long
1071 jg compat_sys_fcntl64 # branch to system call 1071 jg compat_sys_fcntl64 # branch to system call
1072 1072
@@ -1087,10 +1087,10 @@ sys32_stime_wrapper:
1087 llgtr %r2,%r2 # long * 1087 llgtr %r2,%r2 # long *
1088 jg compat_sys_stime # branch to system call 1088 jg compat_sys_stime # branch to system call
1089 1089
1090 .globl sys32_sysctl_wrapper 1090 .globl sys32_sysctl_wrapper
1091sys32_sysctl_wrapper: 1091sys32_sysctl_wrapper:
1092 llgtr %r2,%r2 # struct __sysctl_args32 * 1092 llgtr %r2,%r2 # struct __sysctl_args32 *
1093 jg sys32_sysctl 1093 jg sys32_sysctl
1094 1094
1095 .globl sys32_fstat64_wrapper 1095 .globl sys32_fstat64_wrapper
1096sys32_fstat64_wrapper: 1096sys32_fstat64_wrapper:
@@ -1098,7 +1098,7 @@ sys32_fstat64_wrapper:
1098 llgtr %r3,%r3 # struct stat64 * 1098 llgtr %r3,%r3 # struct stat64 *
1099 jg sys32_fstat64 # branch to system call 1099 jg sys32_fstat64 # branch to system call
1100 1100
1101 .globl compat_sys_futex_wrapper 1101 .globl compat_sys_futex_wrapper
1102compat_sys_futex_wrapper: 1102compat_sys_futex_wrapper:
1103 llgtr %r2,%r2 # u32 * 1103 llgtr %r2,%r2 # u32 *
1104 lgfr %r3,%r3 # int 1104 lgfr %r3,%r3 # int
@@ -1213,22 +1213,22 @@ sys32_sched_getaffinity_wrapper:
1213 llgtr %r4,%r4 # unsigned long * 1213 llgtr %r4,%r4 # unsigned long *
1214 jg compat_sys_sched_getaffinity 1214 jg compat_sys_sched_getaffinity
1215 1215
1216 .globl sys32_exit_group_wrapper 1216 .globl sys32_exit_group_wrapper
1217sys32_exit_group_wrapper: 1217sys32_exit_group_wrapper:
1218 lgfr %r2,%r2 # int 1218 lgfr %r2,%r2 # int
1219 jg sys_exit_group # branch to system call 1219 jg sys_exit_group # branch to system call
1220 1220
1221 .globl sys32_set_tid_address_wrapper 1221 .globl sys32_set_tid_address_wrapper
1222sys32_set_tid_address_wrapper: 1222sys32_set_tid_address_wrapper:
1223 llgtr %r2,%r2 # int * 1223 llgtr %r2,%r2 # int *
1224 jg sys_set_tid_address # branch to system call 1224 jg sys_set_tid_address # branch to system call
1225 1225
1226 .globl sys_epoll_create_wrapper 1226 .globl sys_epoll_create_wrapper
1227sys_epoll_create_wrapper: 1227sys_epoll_create_wrapper:
1228 lgfr %r2,%r2 # int 1228 lgfr %r2,%r2 # int
1229 jg sys_epoll_create # branch to system call 1229 jg sys_epoll_create # branch to system call
1230 1230
1231 .globl sys_epoll_ctl_wrapper 1231 .globl sys_epoll_ctl_wrapper
1232sys_epoll_ctl_wrapper: 1232sys_epoll_ctl_wrapper:
1233 lgfr %r2,%r2 # int 1233 lgfr %r2,%r2 # int
1234 lgfr %r3,%r3 # int 1234 lgfr %r3,%r3 # int
@@ -1236,7 +1236,7 @@ sys_epoll_ctl_wrapper:
1236 llgtr %r5,%r5 # struct epoll_event * 1236 llgtr %r5,%r5 # struct epoll_event *
1237 jg sys_epoll_ctl # branch to system call 1237 jg sys_epoll_ctl # branch to system call
1238 1238
1239 .globl sys_epoll_wait_wrapper 1239 .globl sys_epoll_wait_wrapper
1240sys_epoll_wait_wrapper: 1240sys_epoll_wait_wrapper:
1241 lgfr %r2,%r2 # int 1241 lgfr %r2,%r2 # int
1242 llgtr %r3,%r3 # struct epoll_event * 1242 llgtr %r3,%r3 # struct epoll_event *
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
index 0c712b78a7e8..dddc3de30401 100644
--- a/arch/s390/kernel/entry.S
+++ b/arch/s390/kernel/entry.S
@@ -4,8 +4,8 @@
4 * 4 *
5 * Copyright (C) IBM Corp. 1999,2006 5 * Copyright (C) IBM Corp. 1999,2006
6 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com), 6 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
7 * Hartmut Penner (hp@de.ibm.com), 7 * Hartmut Penner (hp@de.ibm.com),
8 * Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com), 8 * Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com),
9 * Heiko Carstens <heiko.carstens@de.ibm.com> 9 * Heiko Carstens <heiko.carstens@de.ibm.com>
10 */ 10 */
11 11
@@ -24,29 +24,29 @@
24 * Stack layout for the system_call stack entry. 24 * Stack layout for the system_call stack entry.
25 * The first few entries are identical to the user_regs_struct. 25 * The first few entries are identical to the user_regs_struct.
26 */ 26 */
27SP_PTREGS = STACK_FRAME_OVERHEAD 27SP_PTREGS = STACK_FRAME_OVERHEAD
28SP_ARGS = STACK_FRAME_OVERHEAD + __PT_ARGS 28SP_ARGS = STACK_FRAME_OVERHEAD + __PT_ARGS
29SP_PSW = STACK_FRAME_OVERHEAD + __PT_PSW 29SP_PSW = STACK_FRAME_OVERHEAD + __PT_PSW
30SP_R0 = STACK_FRAME_OVERHEAD + __PT_GPRS 30SP_R0 = STACK_FRAME_OVERHEAD + __PT_GPRS
31SP_R1 = STACK_FRAME_OVERHEAD + __PT_GPRS + 4 31SP_R1 = STACK_FRAME_OVERHEAD + __PT_GPRS + 4
32SP_R2 = STACK_FRAME_OVERHEAD + __PT_GPRS + 8 32SP_R2 = STACK_FRAME_OVERHEAD + __PT_GPRS + 8
33SP_R3 = STACK_FRAME_OVERHEAD + __PT_GPRS + 12 33SP_R3 = STACK_FRAME_OVERHEAD + __PT_GPRS + 12
34SP_R4 = STACK_FRAME_OVERHEAD + __PT_GPRS + 16 34SP_R4 = STACK_FRAME_OVERHEAD + __PT_GPRS + 16
35SP_R5 = STACK_FRAME_OVERHEAD + __PT_GPRS + 20 35SP_R5 = STACK_FRAME_OVERHEAD + __PT_GPRS + 20
36SP_R6 = STACK_FRAME_OVERHEAD + __PT_GPRS + 24 36SP_R6 = STACK_FRAME_OVERHEAD + __PT_GPRS + 24
37SP_R7 = STACK_FRAME_OVERHEAD + __PT_GPRS + 28 37SP_R7 = STACK_FRAME_OVERHEAD + __PT_GPRS + 28
38SP_R8 = STACK_FRAME_OVERHEAD + __PT_GPRS + 32 38SP_R8 = STACK_FRAME_OVERHEAD + __PT_GPRS + 32
39SP_R9 = STACK_FRAME_OVERHEAD + __PT_GPRS + 36 39SP_R9 = STACK_FRAME_OVERHEAD + __PT_GPRS + 36
40SP_R10 = STACK_FRAME_OVERHEAD + __PT_GPRS + 40 40SP_R10 = STACK_FRAME_OVERHEAD + __PT_GPRS + 40
41SP_R11 = STACK_FRAME_OVERHEAD + __PT_GPRS + 44 41SP_R11 = STACK_FRAME_OVERHEAD + __PT_GPRS + 44
42SP_R12 = STACK_FRAME_OVERHEAD + __PT_GPRS + 48 42SP_R12 = STACK_FRAME_OVERHEAD + __PT_GPRS + 48
43SP_R13 = STACK_FRAME_OVERHEAD + __PT_GPRS + 52 43SP_R13 = STACK_FRAME_OVERHEAD + __PT_GPRS + 52
44SP_R14 = STACK_FRAME_OVERHEAD + __PT_GPRS + 56 44SP_R14 = STACK_FRAME_OVERHEAD + __PT_GPRS + 56
45SP_R15 = STACK_FRAME_OVERHEAD + __PT_GPRS + 60 45SP_R15 = STACK_FRAME_OVERHEAD + __PT_GPRS + 60
46SP_ORIG_R2 = STACK_FRAME_OVERHEAD + __PT_ORIG_GPR2 46SP_ORIG_R2 = STACK_FRAME_OVERHEAD + __PT_ORIG_GPR2
47SP_ILC = STACK_FRAME_OVERHEAD + __PT_ILC 47SP_ILC = STACK_FRAME_OVERHEAD + __PT_ILC
48SP_TRAP = STACK_FRAME_OVERHEAD + __PT_TRAP 48SP_TRAP = STACK_FRAME_OVERHEAD + __PT_TRAP
49SP_SIZE = STACK_FRAME_OVERHEAD + __PT_SIZE 49SP_SIZE = STACK_FRAME_OVERHEAD + __PT_SIZE
50 50
51_TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | _TIF_NEED_RESCHED | \ 51_TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | _TIF_NEED_RESCHED | \
52 _TIF_MCCK_PENDING | _TIF_RESTART_SVC | _TIF_SINGLE_STEP ) 52 _TIF_MCCK_PENDING | _TIF_RESTART_SVC | _TIF_SINGLE_STEP )
@@ -81,14 +81,14 @@ STACK_SIZE = 1 << STACK_SHIFT
81 * R15 - kernel stack pointer 81 * R15 - kernel stack pointer
82 */ 82 */
83 83
84 .macro STORE_TIMER lc_offset 84 .macro STORE_TIMER lc_offset
85#ifdef CONFIG_VIRT_CPU_ACCOUNTING 85#ifdef CONFIG_VIRT_CPU_ACCOUNTING
86 stpt \lc_offset 86 stpt \lc_offset
87#endif 87#endif
88 .endm 88 .endm
89 89
90#ifdef CONFIG_VIRT_CPU_ACCOUNTING 90#ifdef CONFIG_VIRT_CPU_ACCOUNTING
91 .macro UPDATE_VTIME lc_from,lc_to,lc_sum 91 .macro UPDATE_VTIME lc_from,lc_to,lc_sum
92 lm %r10,%r11,\lc_from 92 lm %r10,%r11,\lc_from
93 sl %r10,\lc_to 93 sl %r10,\lc_to
94 sl %r11,\lc_to+4 94 sl %r11,\lc_to+4
@@ -147,7 +147,7 @@ STACK_SIZE = 1 << STACK_SHIFT
1472: 1472:
148 .endm 148 .endm
149 149
150 .macro CREATE_STACK_FRAME psworg,savearea 150 .macro CREATE_STACK_FRAME psworg,savearea
151 s %r15,BASED(.Lc_spsize) # make room for registers & psw 151 s %r15,BASED(.Lc_spsize) # make room for registers & psw
152 mvc SP_PSW(8,%r15),0(%r12) # move user PSW to stack 152 mvc SP_PSW(8,%r15),0(%r12) # move user PSW to stack
153 la %r12,\psworg 153 la %r12,\psworg
@@ -160,7 +160,7 @@ STACK_SIZE = 1 << STACK_SHIFT
160 st %r12,__SF_BACKCHAIN(%r15) # clear back chain 160 st %r12,__SF_BACKCHAIN(%r15) # clear back chain
161 .endm 161 .endm
162 162
163 .macro RESTORE_ALL psworg,sync 163 .macro RESTORE_ALL psworg,sync
164 mvc \psworg(8),SP_PSW(%r15) # move user PSW to lowcore 164 mvc \psworg(8),SP_PSW(%r15) # move user PSW to lowcore
165 .if !\sync 165 .if !\sync
166 ni \psworg+1,0xfd # clear wait state bit 166 ni \psworg+1,0xfd # clear wait state bit
@@ -177,16 +177,16 @@ STACK_SIZE = 1 << STACK_SHIFT
177 * Returns: 177 * Returns:
178 * gpr2 = prev 178 * gpr2 = prev
179 */ 179 */
180 .globl __switch_to 180 .globl __switch_to
181__switch_to: 181__switch_to:
182 basr %r1,0 182 basr %r1,0
183__switch_to_base: 183__switch_to_base:
184 tm __THREAD_per(%r3),0xe8 # new process is using per ? 184 tm __THREAD_per(%r3),0xe8 # new process is using per ?
185 bz __switch_to_noper-__switch_to_base(%r1) # if not we're fine 185 bz __switch_to_noper-__switch_to_base(%r1) # if not we're fine
186 stctl %c9,%c11,__SF_EMPTY(%r15) # We are using per stuff 186 stctl %c9,%c11,__SF_EMPTY(%r15) # We are using per stuff
187 clc __THREAD_per(12,%r3),__SF_EMPTY(%r15) 187 clc __THREAD_per(12,%r3),__SF_EMPTY(%r15)
188 be __switch_to_noper-__switch_to_base(%r1) # we got away w/o bashing TLB's 188 be __switch_to_noper-__switch_to_base(%r1) # we got away w/o bashing TLB's
189 lctl %c9,%c11,__THREAD_per(%r3) # Nope we didn't 189 lctl %c9,%c11,__THREAD_per(%r3) # Nope we didn't
190__switch_to_noper: 190__switch_to_noper:
191 l %r4,__THREAD_info(%r2) # get thread_info of prev 191 l %r4,__THREAD_info(%r2) # get thread_info of prev
192 tm __TI_flags+3(%r4),_TIF_MCCK_PENDING # machine check pending? 192 tm __TI_flags+3(%r4),_TIF_MCCK_PENDING # machine check pending?
@@ -195,13 +195,13 @@ __switch_to_noper:
195 l %r4,__THREAD_info(%r3) # get thread_info of next 195 l %r4,__THREAD_info(%r3) # get thread_info of next
196 oi __TI_flags+3(%r4),_TIF_MCCK_PENDING # set it in next 196 oi __TI_flags+3(%r4),_TIF_MCCK_PENDING # set it in next
197__switch_to_no_mcck: 197__switch_to_no_mcck:
198 stm %r6,%r15,__SF_GPRS(%r15)# store __switch_to registers of prev task 198 stm %r6,%r15,__SF_GPRS(%r15)# store __switch_to registers of prev task
199 st %r15,__THREAD_ksp(%r2) # store kernel stack to prev->tss.ksp 199 st %r15,__THREAD_ksp(%r2) # store kernel stack to prev->tss.ksp
200 l %r15,__THREAD_ksp(%r3) # load kernel stack from next->tss.ksp 200 l %r15,__THREAD_ksp(%r3) # load kernel stack from next->tss.ksp
201 lm %r6,%r15,__SF_GPRS(%r15)# load __switch_to registers of next task 201 lm %r6,%r15,__SF_GPRS(%r15)# load __switch_to registers of next task
202 st %r3,__LC_CURRENT # __LC_CURRENT = current task struct 202 st %r3,__LC_CURRENT # __LC_CURRENT = current task struct
203 lctl %c4,%c4,__TASK_pid(%r3) # load pid to control reg. 4 203 lctl %c4,%c4,__TASK_pid(%r3) # load pid to control reg. 4
204 l %r3,__THREAD_info(%r3) # load thread_info from task struct 204 l %r3,__THREAD_info(%r3) # load thread_info from task struct
205 st %r3,__LC_THREAD_INFO 205 st %r3,__LC_THREAD_INFO
206 ahi %r3,STACK_SIZE 206 ahi %r3,STACK_SIZE
207 st %r3,__LC_KERNEL_STACK # __LC_KERNEL_STACK = new kernel stack 207 st %r3,__LC_KERNEL_STACK # __LC_KERNEL_STACK = new kernel stack
@@ -213,7 +213,7 @@ __critical_start:
213 * are executed with interrupts enabled. 213 * are executed with interrupts enabled.
214 */ 214 */
215 215
216 .globl system_call 216 .globl system_call
217system_call: 217system_call:
218 STORE_TIMER __LC_SYNC_ENTER_TIMER 218 STORE_TIMER __LC_SYNC_ENTER_TIMER
219sysc_saveall: 219sysc_saveall:
@@ -233,24 +233,24 @@ sysc_update:
233#endif 233#endif
234sysc_do_svc: 234sysc_do_svc:
235 l %r9,__LC_THREAD_INFO # load pointer to thread_info struct 235 l %r9,__LC_THREAD_INFO # load pointer to thread_info struct
236 sla %r7,2 # *4 and test for svc 0 236 sla %r7,2 # *4 and test for svc 0
237 bnz BASED(sysc_nr_ok) # svc number > 0 237 bnz BASED(sysc_nr_ok) # svc number > 0
238 # svc 0: system call number in %r1 238 # svc 0: system call number in %r1
239 cl %r1,BASED(.Lnr_syscalls) 239 cl %r1,BASED(.Lnr_syscalls)
240 bnl BASED(sysc_nr_ok) 240 bnl BASED(sysc_nr_ok)
241 lr %r7,%r1 # copy svc number to %r7 241 lr %r7,%r1 # copy svc number to %r7
242 sla %r7,2 # *4 242 sla %r7,2 # *4
243sysc_nr_ok: 243sysc_nr_ok:
244 mvc SP_ARGS(4,%r15),SP_R7(%r15) 244 mvc SP_ARGS(4,%r15),SP_R7(%r15)
245sysc_do_restart: 245sysc_do_restart:
246 l %r8,BASED(.Lsysc_table) 246 l %r8,BASED(.Lsysc_table)
247 tm __TI_flags+3(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT) 247 tm __TI_flags+3(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
248 l %r8,0(%r7,%r8) # get system call addr. 248 l %r8,0(%r7,%r8) # get system call addr.
249 bnz BASED(sysc_tracesys) 249 bnz BASED(sysc_tracesys)
250 basr %r14,%r8 # call sys_xxxx 250 basr %r14,%r8 # call sys_xxxx
251 st %r2,SP_R2(%r15) # store return value (change R2 on stack) 251 st %r2,SP_R2(%r15) # store return value (change R2 on stack)
252 # ATTENTION: check sys_execve_glue before 252 # ATTENTION: check sys_execve_glue before
253 # changing anything here !! 253 # changing anything here !!
254 254
255sysc_return: 255sysc_return:
256 tm SP_PSW+1(%r15),0x01 # returning to user ? 256 tm SP_PSW+1(%r15),0x01 # returning to user ?
@@ -258,14 +258,14 @@ sysc_return:
258 tm __TI_flags+3(%r9),_TIF_WORK_SVC 258 tm __TI_flags+3(%r9),_TIF_WORK_SVC
259 bnz BASED(sysc_work) # there is work to do (signals etc.) 259 bnz BASED(sysc_work) # there is work to do (signals etc.)
260sysc_leave: 260sysc_leave:
261 RESTORE_ALL __LC_RETURN_PSW,1 261 RESTORE_ALL __LC_RETURN_PSW,1
262 262
263# 263#
264# recheck if there is more work to do 264# recheck if there is more work to do
265# 265#
266sysc_work_loop: 266sysc_work_loop:
267 tm __TI_flags+3(%r9),_TIF_WORK_SVC 267 tm __TI_flags+3(%r9),_TIF_WORK_SVC
268 bz BASED(sysc_leave) # there is no work to do 268 bz BASED(sysc_leave) # there is no work to do
269# 269#
270# One of the work bits is on. Find out which one. 270# One of the work bits is on. Find out which one.
271# 271#
@@ -284,11 +284,11 @@ sysc_work:
284 284
285# 285#
286# _TIF_NEED_RESCHED is set, call schedule 286# _TIF_NEED_RESCHED is set, call schedule
287# 287#
288sysc_reschedule: 288sysc_reschedule:
289 l %r1,BASED(.Lschedule) 289 l %r1,BASED(.Lschedule)
290 la %r14,BASED(sysc_work_loop) 290 la %r14,BASED(sysc_work_loop)
291 br %r1 # call scheduler 291 br %r1 # call scheduler
292 292
293# 293#
294# _TIF_MCCK_PENDING is set, call handler 294# _TIF_MCCK_PENDING is set, call handler
@@ -301,11 +301,11 @@ sysc_mcck_pending:
301# 301#
302# _TIF_SIGPENDING or _TIF_RESTORE_SIGMASK is set, call do_signal 302# _TIF_SIGPENDING or _TIF_RESTORE_SIGMASK is set, call do_signal
303# 303#
304sysc_sigpending: 304sysc_sigpending:
305 ni __TI_flags+3(%r9),255-_TIF_SINGLE_STEP # clear TIF_SINGLE_STEP 305 ni __TI_flags+3(%r9),255-_TIF_SINGLE_STEP # clear TIF_SINGLE_STEP
306 la %r2,SP_PTREGS(%r15) # load pt_regs 306 la %r2,SP_PTREGS(%r15) # load pt_regs
307 l %r1,BASED(.Ldo_signal) 307 l %r1,BASED(.Ldo_signal)
308 basr %r14,%r1 # call do_signal 308 basr %r14,%r1 # call do_signal
309 tm __TI_flags+3(%r9),_TIF_RESTART_SVC 309 tm __TI_flags+3(%r9),_TIF_RESTART_SVC
310 bo BASED(sysc_restart) 310 bo BASED(sysc_restart)
311 tm __TI_flags+3(%r9),_TIF_SINGLE_STEP 311 tm __TI_flags+3(%r9),_TIF_SINGLE_STEP
@@ -317,11 +317,11 @@ sysc_sigpending:
317# 317#
318sysc_restart: 318sysc_restart:
319 ni __TI_flags+3(%r9),255-_TIF_RESTART_SVC # clear TIF_RESTART_SVC 319 ni __TI_flags+3(%r9),255-_TIF_RESTART_SVC # clear TIF_RESTART_SVC
320 l %r7,SP_R2(%r15) # load new svc number 320 l %r7,SP_R2(%r15) # load new svc number
321 sla %r7,2 321 sla %r7,2
322 mvc SP_R2(4,%r15),SP_ORIG_R2(%r15) # restore first argument 322 mvc SP_R2(4,%r15),SP_ORIG_R2(%r15) # restore first argument
323 lm %r2,%r6,SP_R2(%r15) # load svc arguments 323 lm %r2,%r6,SP_R2(%r15) # load svc arguments
324 b BASED(sysc_do_restart) # restart svc 324 b BASED(sysc_do_restart) # restart svc
325 325
326# 326#
327# _TIF_SINGLE_STEP is set, call do_single_step 327# _TIF_SINGLE_STEP is set, call do_single_step
@@ -338,8 +338,8 @@ sysc_singlestep:
338# call trace before and after sys_call 338# call trace before and after sys_call
339# 339#
340sysc_tracesys: 340sysc_tracesys:
341 l %r1,BASED(.Ltrace) 341 l %r1,BASED(.Ltrace)
342 la %r2,SP_PTREGS(%r15) # load pt_regs 342 la %r2,SP_PTREGS(%r15) # load pt_regs
343 la %r3,0 343 la %r3,0
344 srl %r7,2 344 srl %r7,2
345 st %r7,SP_R2(%r15) 345 st %r7,SP_R2(%r15)
@@ -347,19 +347,19 @@ sysc_tracesys:
347 clc SP_R2(4,%r15),BASED(.Lnr_syscalls) 347 clc SP_R2(4,%r15),BASED(.Lnr_syscalls)
348 bnl BASED(sysc_tracenogo) 348 bnl BASED(sysc_tracenogo)
349 l %r8,BASED(.Lsysc_table) 349 l %r8,BASED(.Lsysc_table)
350 l %r7,SP_R2(%r15) # strace might have changed the 350 l %r7,SP_R2(%r15) # strace might have changed the
351 sll %r7,2 # system call 351 sll %r7,2 # system call
352 l %r8,0(%r7,%r8) 352 l %r8,0(%r7,%r8)
353sysc_tracego: 353sysc_tracego:
354 lm %r3,%r6,SP_R3(%r15) 354 lm %r3,%r6,SP_R3(%r15)
355 l %r2,SP_ORIG_R2(%r15) 355 l %r2,SP_ORIG_R2(%r15)
356 basr %r14,%r8 # call sys_xxx 356 basr %r14,%r8 # call sys_xxx
357 st %r2,SP_R2(%r15) # store return value 357 st %r2,SP_R2(%r15) # store return value
358sysc_tracenogo: 358sysc_tracenogo:
359 tm __TI_flags+3(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT) 359 tm __TI_flags+3(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
360 bz BASED(sysc_return) 360 bz BASED(sysc_return)
361 l %r1,BASED(.Ltrace) 361 l %r1,BASED(.Ltrace)
362 la %r2,SP_PTREGS(%r15) # load pt_regs 362 la %r2,SP_PTREGS(%r15) # load pt_regs
363 la %r3,1 363 la %r3,1
364 la %r14,BASED(sysc_return) 364 la %r14,BASED(sysc_return)
365 br %r1 365 br %r1
@@ -367,17 +367,17 @@ sysc_tracenogo:
367# 367#
368# a new process exits the kernel with ret_from_fork 368# a new process exits the kernel with ret_from_fork
369# 369#
370 .globl ret_from_fork 370 .globl ret_from_fork
371ret_from_fork: 371ret_from_fork:
372 l %r13,__LC_SVC_NEW_PSW+4 372 l %r13,__LC_SVC_NEW_PSW+4
373 l %r9,__LC_THREAD_INFO # load pointer to thread_info struct 373 l %r9,__LC_THREAD_INFO # load pointer to thread_info struct
374 tm SP_PSW+1(%r15),0x01 # forking a kernel thread ? 374 tm SP_PSW+1(%r15),0x01 # forking a kernel thread ?
375 bo BASED(0f) 375 bo BASED(0f)
376 st %r15,SP_R15(%r15) # store stack pointer for new kthread 376 st %r15,SP_R15(%r15) # store stack pointer for new kthread
3770: l %r1,BASED(.Lschedtail) 3770: l %r1,BASED(.Lschedtail)
378 basr %r14,%r1 378 basr %r14,%r1
379 TRACE_IRQS_ON 379 TRACE_IRQS_ON
380 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts 380 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts
381 b BASED(sysc_return) 381 b BASED(sysc_return)
382 382
383# 383#
@@ -386,52 +386,51 @@ ret_from_fork:
386# but are called with different parameter. 386# but are called with different parameter.
387# return-address is set up above 387# return-address is set up above
388# 388#
389sys_clone_glue: 389sys_clone_glue:
390 la %r2,SP_PTREGS(%r15) # load pt_regs 390 la %r2,SP_PTREGS(%r15) # load pt_regs
391 l %r1,BASED(.Lclone) 391 l %r1,BASED(.Lclone)
392 br %r1 # branch to sys_clone 392 br %r1 # branch to sys_clone
393
394sys_fork_glue:
395 la %r2,SP_PTREGS(%r15) # load pt_regs
396 l %r1,BASED(.Lfork)
397 br %r1 # branch to sys_fork
398
399sys_vfork_glue:
400 la %r2,SP_PTREGS(%r15) # load pt_regs
401 l %r1,BASED(.Lvfork)
402 br %r1 # branch to sys_vfork
403
404sys_execve_glue:
405 la %r2,SP_PTREGS(%r15) # load pt_regs
406 l %r1,BASED(.Lexecve)
407 lr %r12,%r14 # save return address
408 basr %r14,%r1 # call sys_execve
409 ltr %r2,%r2 # check if execve failed
410 bnz 0(%r12) # it did fail -> store result in gpr2
411 b 4(%r12) # SKIP ST 2,SP_R2(15) after BASR 14,8
412 # in system_call/sysc_tracesys
413
414sys_sigreturn_glue:
415 la %r2,SP_PTREGS(%r15) # load pt_regs as parameter
416 l %r1,BASED(.Lsigreturn)
417 br %r1 # branch to sys_sigreturn
418
419sys_rt_sigreturn_glue:
420 la %r2,SP_PTREGS(%r15) # load pt_regs as parameter
421 l %r1,BASED(.Lrt_sigreturn)
422 br %r1 # branch to sys_sigreturn
423 393
424sys_sigaltstack_glue: 394sys_fork_glue:
425 la %r4,SP_PTREGS(%r15) # load pt_regs as parameter 395 la %r2,SP_PTREGS(%r15) # load pt_regs
426 l %r1,BASED(.Lsigaltstack) 396 l %r1,BASED(.Lfork)
427 br %r1 # branch to sys_sigreturn 397 br %r1 # branch to sys_fork
428 398
399sys_vfork_glue:
400 la %r2,SP_PTREGS(%r15) # load pt_regs
401 l %r1,BASED(.Lvfork)
402 br %r1 # branch to sys_vfork
403
404sys_execve_glue:
405 la %r2,SP_PTREGS(%r15) # load pt_regs
406 l %r1,BASED(.Lexecve)
407 lr %r12,%r14 # save return address
408 basr %r14,%r1 # call sys_execve
409 ltr %r2,%r2 # check if execve failed
410 bnz 0(%r12) # it did fail -> store result in gpr2
411 b 4(%r12) # SKIP ST 2,SP_R2(15) after BASR 14,8
412 # in system_call/sysc_tracesys
413
414sys_sigreturn_glue:
415 la %r2,SP_PTREGS(%r15) # load pt_regs as parameter
416 l %r1,BASED(.Lsigreturn)
417 br %r1 # branch to sys_sigreturn
418
419sys_rt_sigreturn_glue:
420 la %r2,SP_PTREGS(%r15) # load pt_regs as parameter
421 l %r1,BASED(.Lrt_sigreturn)
422 br %r1 # branch to sys_sigreturn
423
424sys_sigaltstack_glue:
425 la %r4,SP_PTREGS(%r15) # load pt_regs as parameter
426 l %r1,BASED(.Lsigaltstack)
427 br %r1 # branch to sys_sigreturn
429 428
430/* 429/*
431 * Program check handler routine 430 * Program check handler routine
432 */ 431 */
433 432
434 .globl pgm_check_handler 433 .globl pgm_check_handler
435pgm_check_handler: 434pgm_check_handler:
436/* 435/*
437 * First we need to check for a special case: 436 * First we need to check for a special case:
@@ -448,8 +447,8 @@ pgm_check_handler:
448 */ 447 */
449 STORE_TIMER __LC_SYNC_ENTER_TIMER 448 STORE_TIMER __LC_SYNC_ENTER_TIMER
450 SAVE_ALL_BASE __LC_SAVE_AREA 449 SAVE_ALL_BASE __LC_SAVE_AREA
451 tm __LC_PGM_INT_CODE+1,0x80 # check whether we got a per exception 450 tm __LC_PGM_INT_CODE+1,0x80 # check whether we got a per exception
452 bnz BASED(pgm_per) # got per exception -> special case 451 bnz BASED(pgm_per) # got per exception -> special case
453 SAVE_ALL_SYNC __LC_PGM_OLD_PSW,__LC_SAVE_AREA 452 SAVE_ALL_SYNC __LC_PGM_OLD_PSW,__LC_SAVE_AREA
454 CREATE_STACK_FRAME __LC_PGM_OLD_PSW,__LC_SAVE_AREA 453 CREATE_STACK_FRAME __LC_PGM_OLD_PSW,__LC_SAVE_AREA
455#ifdef CONFIG_VIRT_CPU_ACCOUNTING 454#ifdef CONFIG_VIRT_CPU_ACCOUNTING
@@ -461,29 +460,29 @@ pgm_check_handler:
461pgm_no_vtime: 460pgm_no_vtime:
462#endif 461#endif
463 l %r9,__LC_THREAD_INFO # load pointer to thread_info struct 462 l %r9,__LC_THREAD_INFO # load pointer to thread_info struct
464 l %r3,__LC_PGM_ILC # load program interruption code 463 l %r3,__LC_PGM_ILC # load program interruption code
465 la %r8,0x7f 464 la %r8,0x7f
466 nr %r8,%r3 465 nr %r8,%r3
467pgm_do_call: 466pgm_do_call:
468 l %r7,BASED(.Ljump_table) 467 l %r7,BASED(.Ljump_table)
469 sll %r8,2 468 sll %r8,2
470 l %r7,0(%r8,%r7) # load address of handler routine 469 l %r7,0(%r8,%r7) # load address of handler routine
471 la %r2,SP_PTREGS(%r15) # address of register-save area 470 la %r2,SP_PTREGS(%r15) # address of register-save area
472 la %r14,BASED(sysc_return) 471 la %r14,BASED(sysc_return)
473 br %r7 # branch to interrupt-handler 472 br %r7 # branch to interrupt-handler
474 473
475# 474#
476# handle per exception 475# handle per exception
477# 476#
478pgm_per: 477pgm_per:
479 tm __LC_PGM_OLD_PSW,0x40 # test if per event recording is on 478 tm __LC_PGM_OLD_PSW,0x40 # test if per event recording is on
480 bnz BASED(pgm_per_std) # ok, normal per event from user space 479 bnz BASED(pgm_per_std) # ok, normal per event from user space
481# ok its one of the special cases, now we need to find out which one 480# ok its one of the special cases, now we need to find out which one
482 clc __LC_PGM_OLD_PSW(8),__LC_SVC_NEW_PSW 481 clc __LC_PGM_OLD_PSW(8),__LC_SVC_NEW_PSW
483 be BASED(pgm_svcper) 482 be BASED(pgm_svcper)
484# no interesting special case, ignore PER event 483# no interesting special case, ignore PER event
485 lm %r12,%r15,__LC_SAVE_AREA 484 lm %r12,%r15,__LC_SAVE_AREA
486 lpsw 0x28 485 lpsw 0x28
487 486
488# 487#
489# Normal per exception 488# Normal per exception
@@ -507,10 +506,10 @@ pgm_no_vtime2:
507 oi __TI_flags+3(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP 506 oi __TI_flags+3(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP
508 tm SP_PSW+1(%r15),0x01 # kernel per event ? 507 tm SP_PSW+1(%r15),0x01 # kernel per event ?
509 bz BASED(kernel_per) 508 bz BASED(kernel_per)
510 l %r3,__LC_PGM_ILC # load program interruption code 509 l %r3,__LC_PGM_ILC # load program interruption code
511 la %r8,0x7f 510 la %r8,0x7f
512 nr %r8,%r3 # clear per-event-bit and ilc 511 nr %r8,%r3 # clear per-event-bit and ilc
513 be BASED(sysc_return) # only per or per+check ? 512 be BASED(sysc_return) # only per or per+check ?
514 b BASED(pgm_do_call) 513 b BASED(pgm_do_call)
515 514
516# 515#
@@ -552,7 +551,7 @@ kernel_per:
552 * IO interrupt handler routine 551 * IO interrupt handler routine
553 */ 552 */
554 553
555 .globl io_int_handler 554 .globl io_int_handler
556io_int_handler: 555io_int_handler:
557 STORE_TIMER __LC_ASYNC_ENTER_TIMER 556 STORE_TIMER __LC_ASYNC_ENTER_TIMER
558 stck __LC_INT_CLOCK 557 stck __LC_INT_CLOCK
@@ -569,42 +568,42 @@ io_no_vtime:
569#endif 568#endif
570 l %r9,__LC_THREAD_INFO # load pointer to thread_info struct 569 l %r9,__LC_THREAD_INFO # load pointer to thread_info struct
571 TRACE_IRQS_OFF 570 TRACE_IRQS_OFF
572 l %r1,BASED(.Ldo_IRQ) # load address of do_IRQ 571 l %r1,BASED(.Ldo_IRQ) # load address of do_IRQ
573 la %r2,SP_PTREGS(%r15) # address of register-save area 572 la %r2,SP_PTREGS(%r15) # address of register-save area
574 basr %r14,%r1 # branch to standard irq handler 573 basr %r14,%r1 # branch to standard irq handler
575 TRACE_IRQS_ON 574 TRACE_IRQS_ON
576 575
577io_return: 576io_return:
578 tm SP_PSW+1(%r15),0x01 # returning to user ? 577 tm SP_PSW+1(%r15),0x01 # returning to user ?
579#ifdef CONFIG_PREEMPT 578#ifdef CONFIG_PREEMPT
580 bno BASED(io_preempt) # no -> check for preemptive scheduling 579 bno BASED(io_preempt) # no -> check for preemptive scheduling
581#else 580#else
582 bno BASED(io_leave) # no-> skip resched & signal 581 bno BASED(io_leave) # no-> skip resched & signal
583#endif 582#endif
584 tm __TI_flags+3(%r9),_TIF_WORK_INT 583 tm __TI_flags+3(%r9),_TIF_WORK_INT
585 bnz BASED(io_work) # there is work to do (signals etc.) 584 bnz BASED(io_work) # there is work to do (signals etc.)
586io_leave: 585io_leave:
587 RESTORE_ALL __LC_RETURN_PSW,0 586 RESTORE_ALL __LC_RETURN_PSW,0
588io_done: 587io_done:
589 588
590#ifdef CONFIG_PREEMPT 589#ifdef CONFIG_PREEMPT
591io_preempt: 590io_preempt:
592 icm %r0,15,__TI_precount(%r9) 591 icm %r0,15,__TI_precount(%r9)
593 bnz BASED(io_leave) 592 bnz BASED(io_leave)
594 l %r1,SP_R15(%r15) 593 l %r1,SP_R15(%r15)
595 s %r1,BASED(.Lc_spsize) 594 s %r1,BASED(.Lc_spsize)
596 mvc SP_PTREGS(__PT_SIZE,%r1),SP_PTREGS(%r15) 595 mvc SP_PTREGS(__PT_SIZE,%r1),SP_PTREGS(%r15)
597 xc __SF_BACKCHAIN(4,%r1),__SF_BACKCHAIN(%r1) # clear back chain 596 xc __SF_BACKCHAIN(4,%r1),__SF_BACKCHAIN(%r1) # clear back chain
598 lr %r15,%r1 597 lr %r15,%r1
599io_resume_loop: 598io_resume_loop:
600 tm __TI_flags+3(%r9),_TIF_NEED_RESCHED 599 tm __TI_flags+3(%r9),_TIF_NEED_RESCHED
601 bno BASED(io_leave) 600 bno BASED(io_leave)
602 mvc __TI_precount(4,%r9),BASED(.Lc_pactive) 601 mvc __TI_precount(4,%r9),BASED(.Lc_pactive)
603 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts 602 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts
604 l %r1,BASED(.Lschedule) 603 l %r1,BASED(.Lschedule)
605 basr %r14,%r1 # call schedule 604 basr %r14,%r1 # call schedule
606 stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts 605 stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts
607 xc __TI_precount(4,%r9),__TI_precount(%r9) 606 xc __TI_precount(4,%r9),__TI_precount(%r9)
608 b BASED(io_resume_loop) 607 b BASED(io_resume_loop)
609#endif 608#endif
610 609
@@ -615,16 +614,16 @@ io_work:
615 l %r1,__LC_KERNEL_STACK 614 l %r1,__LC_KERNEL_STACK
616 s %r1,BASED(.Lc_spsize) 615 s %r1,BASED(.Lc_spsize)
617 mvc SP_PTREGS(__PT_SIZE,%r1),SP_PTREGS(%r15) 616 mvc SP_PTREGS(__PT_SIZE,%r1),SP_PTREGS(%r15)
618 xc __SF_BACKCHAIN(4,%r1),__SF_BACKCHAIN(%r1) # clear back chain 617 xc __SF_BACKCHAIN(4,%r1),__SF_BACKCHAIN(%r1) # clear back chain
619 lr %r15,%r1 618 lr %r15,%r1
620# 619#
621# One of the work bits is on. Find out which one. 620# One of the work bits is on. Find out which one.
622# Checked are: _TIF_SIGPENDING, _TIF_RESTORE_SIGMASK, _TIF_NEED_RESCHED 621# Checked are: _TIF_SIGPENDING, _TIF_RESTORE_SIGMASK, _TIF_NEED_RESCHED
623# and _TIF_MCCK_PENDING 622# and _TIF_MCCK_PENDING
624# 623#
625io_work_loop: 624io_work_loop:
626 tm __TI_flags+3(%r9),_TIF_MCCK_PENDING 625 tm __TI_flags+3(%r9),_TIF_MCCK_PENDING
627 bo BASED(io_mcck_pending) 626 bo BASED(io_mcck_pending)
628 tm __TI_flags+3(%r9),_TIF_NEED_RESCHED 627 tm __TI_flags+3(%r9),_TIF_NEED_RESCHED
629 bo BASED(io_reschedule) 628 bo BASED(io_reschedule)
630 tm __TI_flags+3(%r9),(_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK) 629 tm __TI_flags+3(%r9),(_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK)
@@ -637,36 +636,36 @@ io_work_loop:
637io_mcck_pending: 636io_mcck_pending:
638 l %r1,BASED(.Ls390_handle_mcck) 637 l %r1,BASED(.Ls390_handle_mcck)
639 la %r14,BASED(io_work_loop) 638 la %r14,BASED(io_work_loop)
640 br %r1 # TIF bit will be cleared by handler 639 br %r1 # TIF bit will be cleared by handler
641 640
642# 641#
643# _TIF_NEED_RESCHED is set, call schedule 642# _TIF_NEED_RESCHED is set, call schedule
644# 643#
645io_reschedule: 644io_reschedule:
646 l %r1,BASED(.Lschedule) 645 l %r1,BASED(.Lschedule)
647 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts 646 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts
648 basr %r14,%r1 # call scheduler 647 basr %r14,%r1 # call scheduler
649 stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts 648 stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts
650 tm __TI_flags+3(%r9),_TIF_WORK_INT 649 tm __TI_flags+3(%r9),_TIF_WORK_INT
651 bz BASED(io_leave) # there is no work to do 650 bz BASED(io_leave) # there is no work to do
652 b BASED(io_work_loop) 651 b BASED(io_work_loop)
653 652
654# 653#
655# _TIF_SIGPENDING or _TIF_RESTORE_SIGMASK is set, call do_signal 654# _TIF_SIGPENDING or _TIF_RESTORE_SIGMASK is set, call do_signal
656# 655#
657io_sigpending: 656io_sigpending:
658 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts 657 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts
659 la %r2,SP_PTREGS(%r15) # load pt_regs 658 la %r2,SP_PTREGS(%r15) # load pt_regs
660 l %r1,BASED(.Ldo_signal) 659 l %r1,BASED(.Ldo_signal)
661 basr %r14,%r1 # call do_signal 660 basr %r14,%r1 # call do_signal
662 stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts 661 stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts
663 b BASED(io_work_loop) 662 b BASED(io_work_loop)
664 663
665/* 664/*
666 * External interrupt handler routine 665 * External interrupt handler routine
667 */ 666 */
668 667
669 .globl ext_int_handler 668 .globl ext_int_handler
670ext_int_handler: 669ext_int_handler:
671 STORE_TIMER __LC_ASYNC_ENTER_TIMER 670 STORE_TIMER __LC_ASYNC_ENTER_TIMER
672 stck __LC_INT_CLOCK 671 stck __LC_INT_CLOCK
@@ -683,8 +682,8 @@ ext_no_vtime:
683#endif 682#endif
684 l %r9,__LC_THREAD_INFO # load pointer to thread_info struct 683 l %r9,__LC_THREAD_INFO # load pointer to thread_info struct
685 TRACE_IRQS_OFF 684 TRACE_IRQS_OFF
686 la %r2,SP_PTREGS(%r15) # address of register-save area 685 la %r2,SP_PTREGS(%r15) # address of register-save area
687 lh %r3,__LC_EXT_INT_CODE # get interruption code 686 lh %r3,__LC_EXT_INT_CODE # get interruption code
688 l %r1,BASED(.Ldo_extint) 687 l %r1,BASED(.Ldo_extint)
689 basr %r14,%r1 688 basr %r14,%r1
690 TRACE_IRQS_ON 689 TRACE_IRQS_ON
@@ -696,13 +695,13 @@ __critical_end:
696 * Machine check handler routines 695 * Machine check handler routines
697 */ 696 */
698 697
699 .globl mcck_int_handler 698 .globl mcck_int_handler
700mcck_int_handler: 699mcck_int_handler:
701 spt __LC_CPU_TIMER_SAVE_AREA # revalidate cpu timer 700 spt __LC_CPU_TIMER_SAVE_AREA # revalidate cpu timer
702 lm %r0,%r15,__LC_GPREGS_SAVE_AREA # revalidate gprs 701 lm %r0,%r15,__LC_GPREGS_SAVE_AREA # revalidate gprs
703 SAVE_ALL_BASE __LC_SAVE_AREA+32 702 SAVE_ALL_BASE __LC_SAVE_AREA+32
704 la %r12,__LC_MCK_OLD_PSW 703 la %r12,__LC_MCK_OLD_PSW
705 tm __LC_MCCK_CODE,0x80 # system damage? 704 tm __LC_MCCK_CODE,0x80 # system damage?
706 bo BASED(mcck_int_main) # yes -> rest of mcck code invalid 705 bo BASED(mcck_int_main) # yes -> rest of mcck code invalid
707#ifdef CONFIG_VIRT_CPU_ACCOUNTING 706#ifdef CONFIG_VIRT_CPU_ACCOUNTING
708 mvc __LC_SAVE_AREA+52(8),__LC_ASYNC_ENTER_TIMER 707 mvc __LC_SAVE_AREA+52(8),__LC_ASYNC_ENTER_TIMER
@@ -741,7 +740,7 @@ mcck_int_main:
741 l %r15,__LC_PANIC_STACK # load panic stack 740 l %r15,__LC_PANIC_STACK # load panic stack
7420: CREATE_STACK_FRAME __LC_MCK_OLD_PSW,__LC_SAVE_AREA+32 7410: CREATE_STACK_FRAME __LC_MCK_OLD_PSW,__LC_SAVE_AREA+32
743#ifdef CONFIG_VIRT_CPU_ACCOUNTING 742#ifdef CONFIG_VIRT_CPU_ACCOUNTING
744 tm __LC_MCCK_CODE+2,0x08 # mwp of old psw valid? 743 tm __LC_MCCK_CODE+2,0x08 # mwp of old psw valid?
745 bno BASED(mcck_no_vtime) # no -> skip cleanup critical 744 bno BASED(mcck_no_vtime) # no -> skip cleanup critical
746 tm SP_PSW+1(%r15),0x01 # interrupting from user ? 745 tm SP_PSW+1(%r15),0x01 # interrupting from user ?
747 bz BASED(mcck_no_vtime) 746 bz BASED(mcck_no_vtime)
@@ -752,14 +751,14 @@ mcck_no_vtime:
752#endif 751#endif
753 l %r9,__LC_THREAD_INFO # load pointer to thread_info struct 752 l %r9,__LC_THREAD_INFO # load pointer to thread_info struct
754 la %r2,SP_PTREGS(%r15) # load pt_regs 753 la %r2,SP_PTREGS(%r15) # load pt_regs
755 l %r1,BASED(.Ls390_mcck) 754 l %r1,BASED(.Ls390_mcck)
756 basr %r14,%r1 # call machine check handler 755 basr %r14,%r1 # call machine check handler
757 tm SP_PSW+1(%r15),0x01 # returning to user ? 756 tm SP_PSW+1(%r15),0x01 # returning to user ?
758 bno BASED(mcck_return) 757 bno BASED(mcck_return)
759 l %r1,__LC_KERNEL_STACK # switch to kernel stack 758 l %r1,__LC_KERNEL_STACK # switch to kernel stack
760 s %r1,BASED(.Lc_spsize) 759 s %r1,BASED(.Lc_spsize)
761 mvc SP_PTREGS(__PT_SIZE,%r1),SP_PTREGS(%r15) 760 mvc SP_PTREGS(__PT_SIZE,%r1),SP_PTREGS(%r15)
762 xc __SF_BACKCHAIN(4,%r1),__SF_BACKCHAIN(%r1) # clear back chain 761 xc __SF_BACKCHAIN(4,%r1),__SF_BACKCHAIN(%r1) # clear back chain
763 lr %r15,%r1 762 lr %r15,%r1
764 stosm __SF_EMPTY(%r15),0x04 # turn dat on 763 stosm __SF_EMPTY(%r15),0x04 # turn dat on
765 tm __TI_flags+3(%r9),_TIF_MCCK_PENDING 764 tm __TI_flags+3(%r9),_TIF_MCCK_PENDING
@@ -783,36 +782,36 @@ mcck_return:
783 lm %r0,%r15,SP_R0(%r15) # load gprs 0-15 782 lm %r0,%r15,SP_R0(%r15) # load gprs 0-15
784 lpsw __LC_RETURN_MCCK_PSW # back to caller 783 lpsw __LC_RETURN_MCCK_PSW # back to caller
785 784
786 RESTORE_ALL __LC_RETURN_MCCK_PSW,0 785 RESTORE_ALL __LC_RETURN_MCCK_PSW,0
787 786
788#ifdef CONFIG_SMP 787#ifdef CONFIG_SMP
789/* 788/*
790 * Restart interruption handler, kick starter for additional CPUs 789 * Restart interruption handler, kick starter for additional CPUs
791 */ 790 */
792 .globl restart_int_handler 791 .globl restart_int_handler
793restart_int_handler: 792restart_int_handler:
794 l %r15,__LC_SAVE_AREA+60 # load ksp 793 l %r15,__LC_SAVE_AREA+60 # load ksp
795 lctl %c0,%c15,__LC_CREGS_SAVE_AREA # get new ctl regs 794 lctl %c0,%c15,__LC_CREGS_SAVE_AREA # get new ctl regs
796 lam %a0,%a15,__LC_AREGS_SAVE_AREA 795 lam %a0,%a15,__LC_AREGS_SAVE_AREA
797 lm %r6,%r15,__SF_GPRS(%r15) # load registers from clone 796 lm %r6,%r15,__SF_GPRS(%r15) # load registers from clone
798 stosm __SF_EMPTY(%r15),0x04 # now we can turn dat on 797 stosm __SF_EMPTY(%r15),0x04 # now we can turn dat on
799 basr %r14,0 798 basr %r14,0
800 l %r14,restart_addr-.(%r14) 799 l %r14,restart_addr-.(%r14)
801 br %r14 # branch to start_secondary 800 br %r14 # branch to start_secondary
802restart_addr: 801restart_addr:
803 .long start_secondary 802 .long start_secondary
804#else 803#else
805/* 804/*
806 * If we do not run with SMP enabled, let the new CPU crash ... 805 * If we do not run with SMP enabled, let the new CPU crash ...
807 */ 806 */
808 .globl restart_int_handler 807 .globl restart_int_handler
809restart_int_handler: 808restart_int_handler:
810 basr %r1,0 809 basr %r1,0
811restart_base: 810restart_base:
812 lpsw restart_crash-restart_base(%r1) 811 lpsw restart_crash-restart_base(%r1)
813 .align 8 812 .align 8
814restart_crash: 813restart_crash:
815 .long 0x000a0000,0x00000000 814 .long 0x000a0000,0x00000000
816restart_go: 815restart_go:
817#endif 816#endif
818 817
@@ -834,11 +833,11 @@ stack_overflow:
834 be BASED(0f) 833 be BASED(0f)
835 la %r1,__LC_SAVE_AREA+16 834 la %r1,__LC_SAVE_AREA+16
8360: mvc SP_R12(16,%r15),0(%r1) # move %r12-%r15 to stack 8350: mvc SP_R12(16,%r15),0(%r1) # move %r12-%r15 to stack
837 xc __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15) # clear back chain 836 xc __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15) # clear back chain
838 l %r1,BASED(1f) # branch to kernel_stack_overflow 837 l %r1,BASED(1f) # branch to kernel_stack_overflow
839 la %r2,SP_PTREGS(%r15) # load pt_regs 838 la %r2,SP_PTREGS(%r15) # load pt_regs
840 br %r1 839 br %r1
8411: .long kernel_stack_overflow 8401: .long kernel_stack_overflow
842#endif 841#endif
843 842
844cleanup_table_system_call: 843cleanup_table_system_call:
@@ -940,10 +939,10 @@ cleanup_novtime:
940cleanup_system_call_insn: 939cleanup_system_call_insn:
941 .long sysc_saveall + 0x80000000 940 .long sysc_saveall + 0x80000000
942#ifdef CONFIG_VIRT_CPU_ACCOUNTING 941#ifdef CONFIG_VIRT_CPU_ACCOUNTING
943 .long system_call + 0x80000000 942 .long system_call + 0x80000000
944 .long sysc_vtime + 0x80000000 943 .long sysc_vtime + 0x80000000
945 .long sysc_stime + 0x80000000 944 .long sysc_stime + 0x80000000
946 .long sysc_update + 0x80000000 945 .long sysc_update + 0x80000000
947#endif 946#endif
948 947
949cleanup_sysc_return: 948cleanup_sysc_return:
@@ -1009,57 +1008,57 @@ cleanup_io_leave_insn:
1009/* 1008/*
1010 * Integer constants 1009 * Integer constants
1011 */ 1010 */
1012 .align 4 1011 .align 4
1013.Lc_spsize: .long SP_SIZE 1012.Lc_spsize: .long SP_SIZE
1014.Lc_overhead: .long STACK_FRAME_OVERHEAD 1013.Lc_overhead: .long STACK_FRAME_OVERHEAD
1015.Lc_pactive: .long PREEMPT_ACTIVE 1014.Lc_pactive: .long PREEMPT_ACTIVE
1016.Lnr_syscalls: .long NR_syscalls 1015.Lnr_syscalls: .long NR_syscalls
1017.L0x018: .short 0x018 1016.L0x018: .short 0x018
1018.L0x020: .short 0x020 1017.L0x020: .short 0x020
1019.L0x028: .short 0x028 1018.L0x028: .short 0x028
1020.L0x030: .short 0x030 1019.L0x030: .short 0x030
1021.L0x038: .short 0x038 1020.L0x038: .short 0x038
1022.Lc_1: .long 1 1021.Lc_1: .long 1
1023 1022
1024/* 1023/*
1025 * Symbol constants 1024 * Symbol constants
1026 */ 1025 */
1027.Ls390_mcck: .long s390_do_machine_check 1026.Ls390_mcck: .long s390_do_machine_check
1028.Ls390_handle_mcck: 1027.Ls390_handle_mcck:
1029 .long s390_handle_mcck 1028 .long s390_handle_mcck
1030.Lmck_old_psw: .long __LC_MCK_OLD_PSW 1029.Lmck_old_psw: .long __LC_MCK_OLD_PSW
1031.Ldo_IRQ: .long do_IRQ 1030.Ldo_IRQ: .long do_IRQ
1032.Ldo_extint: .long do_extint 1031.Ldo_extint: .long do_extint
1033.Ldo_signal: .long do_signal 1032.Ldo_signal: .long do_signal
1034.Lhandle_per: .long do_single_step 1033.Lhandle_per: .long do_single_step
1035.Ljump_table: .long pgm_check_table 1034.Ljump_table: .long pgm_check_table
1036.Lschedule: .long schedule 1035.Lschedule: .long schedule
1037.Lclone: .long sys_clone 1036.Lclone: .long sys_clone
1038.Lexecve: .long sys_execve 1037.Lexecve: .long sys_execve
1039.Lfork: .long sys_fork 1038.Lfork: .long sys_fork
1040.Lrt_sigreturn:.long sys_rt_sigreturn 1039.Lrt_sigreturn: .long sys_rt_sigreturn
1041.Lrt_sigsuspend: 1040.Lrt_sigsuspend:
1042 .long sys_rt_sigsuspend 1041 .long sys_rt_sigsuspend
1043.Lsigreturn: .long sys_sigreturn 1042.Lsigreturn: .long sys_sigreturn
1044.Lsigsuspend: .long sys_sigsuspend 1043.Lsigsuspend: .long sys_sigsuspend
1045.Lsigaltstack: .long sys_sigaltstack 1044.Lsigaltstack: .long sys_sigaltstack
1046.Ltrace: .long syscall_trace 1045.Ltrace: .long syscall_trace
1047.Lvfork: .long sys_vfork 1046.Lvfork: .long sys_vfork
1048.Lschedtail: .long schedule_tail 1047.Lschedtail: .long schedule_tail
1049.Lsysc_table: .long sys_call_table 1048.Lsysc_table: .long sys_call_table
1050#ifdef CONFIG_TRACE_IRQFLAGS 1049#ifdef CONFIG_TRACE_IRQFLAGS
1051.Ltrace_irq_on:.long trace_hardirqs_on 1050.Ltrace_irq_on: .long trace_hardirqs_on
1052.Ltrace_irq_off: 1051.Ltrace_irq_off:
1053 .long trace_hardirqs_off 1052 .long trace_hardirqs_off
1054#endif 1053#endif
1055.Lcritical_start: 1054.Lcritical_start:
1056 .long __critical_start + 0x80000000 1055 .long __critical_start + 0x80000000
1057.Lcritical_end: 1056.Lcritical_end:
1058 .long __critical_end + 0x80000000 1057 .long __critical_end + 0x80000000
1059.Lcleanup_critical: 1058.Lcleanup_critical:
1060 .long cleanup_critical 1059 .long cleanup_critical
1061 1060
1062 .section .rodata, "a" 1061 .section .rodata, "a"
1063#define SYSCALL(esa,esame,emu) .long esa 1062#define SYSCALL(esa,esame,emu) .long esa
1064sys_call_table: 1063sys_call_table:
1065#include "syscalls.S" 1064#include "syscalls.S"
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S
index 29bbfbab7332..0f758c329a5d 100644
--- a/arch/s390/kernel/entry64.S
+++ b/arch/s390/kernel/entry64.S
@@ -4,8 +4,8 @@
4 * 4 *
5 * Copyright (C) IBM Corp. 1999,2006 5 * Copyright (C) IBM Corp. 1999,2006
6 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com), 6 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
7 * Hartmut Penner (hp@de.ibm.com), 7 * Hartmut Penner (hp@de.ibm.com),
8 * Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com), 8 * Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com),
9 * Heiko Carstens <heiko.carstens@de.ibm.com> 9 * Heiko Carstens <heiko.carstens@de.ibm.com>
10 */ 10 */
11 11
@@ -24,29 +24,29 @@
24 * Stack layout for the system_call stack entry. 24 * Stack layout for the system_call stack entry.
25 * The first few entries are identical to the user_regs_struct. 25 * The first few entries are identical to the user_regs_struct.
26 */ 26 */
27SP_PTREGS = STACK_FRAME_OVERHEAD 27SP_PTREGS = STACK_FRAME_OVERHEAD
28SP_ARGS = STACK_FRAME_OVERHEAD + __PT_ARGS 28SP_ARGS = STACK_FRAME_OVERHEAD + __PT_ARGS
29SP_PSW = STACK_FRAME_OVERHEAD + __PT_PSW 29SP_PSW = STACK_FRAME_OVERHEAD + __PT_PSW
30SP_R0 = STACK_FRAME_OVERHEAD + __PT_GPRS 30SP_R0 = STACK_FRAME_OVERHEAD + __PT_GPRS
31SP_R1 = STACK_FRAME_OVERHEAD + __PT_GPRS + 8 31SP_R1 = STACK_FRAME_OVERHEAD + __PT_GPRS + 8
32SP_R2 = STACK_FRAME_OVERHEAD + __PT_GPRS + 16 32SP_R2 = STACK_FRAME_OVERHEAD + __PT_GPRS + 16
33SP_R3 = STACK_FRAME_OVERHEAD + __PT_GPRS + 24 33SP_R3 = STACK_FRAME_OVERHEAD + __PT_GPRS + 24
34SP_R4 = STACK_FRAME_OVERHEAD + __PT_GPRS + 32 34SP_R4 = STACK_FRAME_OVERHEAD + __PT_GPRS + 32
35SP_R5 = STACK_FRAME_OVERHEAD + __PT_GPRS + 40 35SP_R5 = STACK_FRAME_OVERHEAD + __PT_GPRS + 40
36SP_R6 = STACK_FRAME_OVERHEAD + __PT_GPRS + 48 36SP_R6 = STACK_FRAME_OVERHEAD + __PT_GPRS + 48
37SP_R7 = STACK_FRAME_OVERHEAD + __PT_GPRS + 56 37SP_R7 = STACK_FRAME_OVERHEAD + __PT_GPRS + 56
38SP_R8 = STACK_FRAME_OVERHEAD + __PT_GPRS + 64 38SP_R8 = STACK_FRAME_OVERHEAD + __PT_GPRS + 64
39SP_R9 = STACK_FRAME_OVERHEAD + __PT_GPRS + 72 39SP_R9 = STACK_FRAME_OVERHEAD + __PT_GPRS + 72
40SP_R10 = STACK_FRAME_OVERHEAD + __PT_GPRS + 80 40SP_R10 = STACK_FRAME_OVERHEAD + __PT_GPRS + 80
41SP_R11 = STACK_FRAME_OVERHEAD + __PT_GPRS + 88 41SP_R11 = STACK_FRAME_OVERHEAD + __PT_GPRS + 88
42SP_R12 = STACK_FRAME_OVERHEAD + __PT_GPRS + 96 42SP_R12 = STACK_FRAME_OVERHEAD + __PT_GPRS + 96
43SP_R13 = STACK_FRAME_OVERHEAD + __PT_GPRS + 104 43SP_R13 = STACK_FRAME_OVERHEAD + __PT_GPRS + 104
44SP_R14 = STACK_FRAME_OVERHEAD + __PT_GPRS + 112 44SP_R14 = STACK_FRAME_OVERHEAD + __PT_GPRS + 112
45SP_R15 = STACK_FRAME_OVERHEAD + __PT_GPRS + 120 45SP_R15 = STACK_FRAME_OVERHEAD + __PT_GPRS + 120
46SP_ORIG_R2 = STACK_FRAME_OVERHEAD + __PT_ORIG_GPR2 46SP_ORIG_R2 = STACK_FRAME_OVERHEAD + __PT_ORIG_GPR2
47SP_ILC = STACK_FRAME_OVERHEAD + __PT_ILC 47SP_ILC = STACK_FRAME_OVERHEAD + __PT_ILC
48SP_TRAP = STACK_FRAME_OVERHEAD + __PT_TRAP 48SP_TRAP = STACK_FRAME_OVERHEAD + __PT_TRAP
49SP_SIZE = STACK_FRAME_OVERHEAD + __PT_SIZE 49SP_SIZE = STACK_FRAME_OVERHEAD + __PT_SIZE
50 50
51STACK_SHIFT = PAGE_SHIFT + THREAD_ORDER 51STACK_SHIFT = PAGE_SHIFT + THREAD_ORDER
52STACK_SIZE = 1 << STACK_SHIFT 52STACK_SIZE = 1 << STACK_SHIFT
@@ -71,14 +71,14 @@ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | _TIF_NEED_RESCHED | \
71#define TRACE_IRQS_OFF 71#define TRACE_IRQS_OFF
72#endif 72#endif
73 73
74 .macro STORE_TIMER lc_offset 74 .macro STORE_TIMER lc_offset
75#ifdef CONFIG_VIRT_CPU_ACCOUNTING 75#ifdef CONFIG_VIRT_CPU_ACCOUNTING
76 stpt \lc_offset 76 stpt \lc_offset
77#endif 77#endif
78 .endm 78 .endm
79 79
80#ifdef CONFIG_VIRT_CPU_ACCOUNTING 80#ifdef CONFIG_VIRT_CPU_ACCOUNTING
81 .macro UPDATE_VTIME lc_from,lc_to,lc_sum 81 .macro UPDATE_VTIME lc_from,lc_to,lc_sum
82 lg %r10,\lc_from 82 lg %r10,\lc_from
83 slg %r10,\lc_to 83 slg %r10,\lc_to
84 alg %r10,\lc_sum 84 alg %r10,\lc_sum
@@ -94,7 +94,7 @@ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | _TIF_NEED_RESCHED | \
94 * R15 - kernel stack pointer 94 * R15 - kernel stack pointer
95 */ 95 */
96 96
97 .macro SAVE_ALL_BASE savearea 97 .macro SAVE_ALL_BASE savearea
98 stmg %r12,%r15,\savearea 98 stmg %r12,%r15,\savearea
99 larl %r13,system_call 99 larl %r13,system_call
100 .endm 100 .endm
@@ -139,8 +139,8 @@ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | _TIF_NEED_RESCHED | \
139 .endm 139 .endm
140 140
141 .macro CREATE_STACK_FRAME psworg,savearea 141 .macro CREATE_STACK_FRAME psworg,savearea
142 aghi %r15,-SP_SIZE # make room for registers & psw 142 aghi %r15,-SP_SIZE # make room for registers & psw
143 mvc SP_PSW(16,%r15),0(%r12) # move user PSW to stack 143 mvc SP_PSW(16,%r15),0(%r12) # move user PSW to stack
144 la %r12,\psworg 144 la %r12,\psworg
145 stg %r2,SP_ORIG_R2(%r15) # store original content of gpr 2 145 stg %r2,SP_ORIG_R2(%r15) # store original content of gpr 2
146 icm %r12,12,__LC_SVC_ILC 146 icm %r12,12,__LC_SVC_ILC
@@ -149,7 +149,7 @@ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | _TIF_NEED_RESCHED | \
149 mvc SP_R12(32,%r15),\savearea # move %r12-%r15 to stack 149 mvc SP_R12(32,%r15),\savearea # move %r12-%r15 to stack
150 la %r12,0 150 la %r12,0
151 stg %r12,__SF_BACKCHAIN(%r15) 151 stg %r12,__SF_BACKCHAIN(%r15)
152 .endm 152 .endm
153 153
154 .macro RESTORE_ALL psworg,sync 154 .macro RESTORE_ALL psworg,sync
155 mvc \psworg(16),SP_PSW(%r15) # move user PSW to lowcore 155 mvc \psworg(16),SP_PSW(%r15) # move user PSW to lowcore
@@ -168,29 +168,29 @@ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | _TIF_NEED_RESCHED | \
168 * Returns: 168 * Returns:
169 * gpr2 = prev 169 * gpr2 = prev
170 */ 170 */
171 .globl __switch_to 171 .globl __switch_to
172__switch_to: 172__switch_to:
173 tm __THREAD_per+4(%r3),0xe8 # is the new process using per ? 173 tm __THREAD_per+4(%r3),0xe8 # is the new process using per ?
174 jz __switch_to_noper # if not we're fine 174 jz __switch_to_noper # if not we're fine
175 stctg %c9,%c11,__SF_EMPTY(%r15)# We are using per stuff 175 stctg %c9,%c11,__SF_EMPTY(%r15)# We are using per stuff
176 clc __THREAD_per(24,%r3),__SF_EMPTY(%r15) 176 clc __THREAD_per(24,%r3),__SF_EMPTY(%r15)
177 je __switch_to_noper # we got away without bashing TLB's 177 je __switch_to_noper # we got away without bashing TLB's
178 lctlg %c9,%c11,__THREAD_per(%r3) # Nope we didn't 178 lctlg %c9,%c11,__THREAD_per(%r3) # Nope we didn't
179__switch_to_noper: 179__switch_to_noper:
180 lg %r4,__THREAD_info(%r2) # get thread_info of prev 180 lg %r4,__THREAD_info(%r2) # get thread_info of prev
181 tm __TI_flags+7(%r4),_TIF_MCCK_PENDING # machine check pending? 181 tm __TI_flags+7(%r4),_TIF_MCCK_PENDING # machine check pending?
182 jz __switch_to_no_mcck 182 jz __switch_to_no_mcck
183 ni __TI_flags+7(%r4),255-_TIF_MCCK_PENDING # clear flag in prev 183 ni __TI_flags+7(%r4),255-_TIF_MCCK_PENDING # clear flag in prev
184 lg %r4,__THREAD_info(%r3) # get thread_info of next 184 lg %r4,__THREAD_info(%r3) # get thread_info of next
185 oi __TI_flags+7(%r4),_TIF_MCCK_PENDING # set it in next 185 oi __TI_flags+7(%r4),_TIF_MCCK_PENDING # set it in next
186__switch_to_no_mcck: 186__switch_to_no_mcck:
187 stmg %r6,%r15,__SF_GPRS(%r15)# store __switch_to registers of prev task 187 stmg %r6,%r15,__SF_GPRS(%r15)# store __switch_to registers of prev task
188 stg %r15,__THREAD_ksp(%r2) # store kernel stack to prev->tss.ksp 188 stg %r15,__THREAD_ksp(%r2) # store kernel stack to prev->tss.ksp
189 lg %r15,__THREAD_ksp(%r3) # load kernel stack from next->tss.ksp 189 lg %r15,__THREAD_ksp(%r3) # load kernel stack from next->tss.ksp
190 lmg %r6,%r15,__SF_GPRS(%r15)# load __switch_to registers of next task 190 lmg %r6,%r15,__SF_GPRS(%r15)# load __switch_to registers of next task
191 stg %r3,__LC_CURRENT # __LC_CURRENT = current task struct 191 stg %r3,__LC_CURRENT # __LC_CURRENT = current task struct
192 lctl %c4,%c4,__TASK_pid(%r3) # load pid to control reg. 4 192 lctl %c4,%c4,__TASK_pid(%r3) # load pid to control reg. 4
193 lg %r3,__THREAD_info(%r3) # load thread_info from task struct 193 lg %r3,__THREAD_info(%r3) # load thread_info from task struct
194 stg %r3,__LC_THREAD_INFO 194 stg %r3,__LC_THREAD_INFO
195 aghi %r3,STACK_SIZE 195 aghi %r3,STACK_SIZE
196 stg %r3,__LC_KERNEL_STACK # __LC_KERNEL_STACK = new kernel stack 196 stg %r3,__LC_KERNEL_STACK # __LC_KERNEL_STACK = new kernel stack
@@ -202,14 +202,14 @@ __critical_start:
202 * are executed with interrupts enabled. 202 * are executed with interrupts enabled.
203 */ 203 */
204 204
205 .globl system_call 205 .globl system_call
206system_call: 206system_call:
207 STORE_TIMER __LC_SYNC_ENTER_TIMER 207 STORE_TIMER __LC_SYNC_ENTER_TIMER
208sysc_saveall: 208sysc_saveall:
209 SAVE_ALL_BASE __LC_SAVE_AREA 209 SAVE_ALL_BASE __LC_SAVE_AREA
210 SAVE_ALL_SYNC __LC_SVC_OLD_PSW,__LC_SAVE_AREA 210 SAVE_ALL_SYNC __LC_SVC_OLD_PSW,__LC_SAVE_AREA
211 CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA 211 CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA
212 llgh %r7,__LC_SVC_INT_CODE # get svc number from lowcore 212 llgh %r7,__LC_SVC_INT_CODE # get svc number from lowcore
213#ifdef CONFIG_VIRT_CPU_ACCOUNTING 213#ifdef CONFIG_VIRT_CPU_ACCOUNTING
214sysc_vtime: 214sysc_vtime:
215 tm SP_PSW+1(%r15),0x01 # interrupting from user ? 215 tm SP_PSW+1(%r15),0x01 # interrupting from user ?
@@ -222,45 +222,45 @@ sysc_update:
222#endif 222#endif
223sysc_do_svc: 223sysc_do_svc:
224 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct 224 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct
225 slag %r7,%r7,2 # *4 and test for svc 0 225 slag %r7,%r7,2 # *4 and test for svc 0
226 jnz sysc_nr_ok 226 jnz sysc_nr_ok
227 # svc 0: system call number in %r1 227 # svc 0: system call number in %r1
228 cl %r1,BASED(.Lnr_syscalls) 228 cl %r1,BASED(.Lnr_syscalls)
229 jnl sysc_nr_ok 229 jnl sysc_nr_ok
230 lgfr %r7,%r1 # clear high word in r1 230 lgfr %r7,%r1 # clear high word in r1
231 slag %r7,%r7,2 # svc 0: system call number in %r1 231 slag %r7,%r7,2 # svc 0: system call number in %r1
232sysc_nr_ok: 232sysc_nr_ok:
233 mvc SP_ARGS(8,%r15),SP_R7(%r15) 233 mvc SP_ARGS(8,%r15),SP_R7(%r15)
234sysc_do_restart: 234sysc_do_restart:
235 larl %r10,sys_call_table 235 larl %r10,sys_call_table
236#ifdef CONFIG_COMPAT 236#ifdef CONFIG_COMPAT
237 tm __TI_flags+5(%r9),(_TIF_31BIT>>16) # running in 31 bit mode ? 237 tm __TI_flags+5(%r9),(_TIF_31BIT>>16) # running in 31 bit mode ?
238 jno sysc_noemu 238 jno sysc_noemu
239 larl %r10,sys_call_table_emu # use 31 bit emulation system calls 239 larl %r10,sys_call_table_emu # use 31 bit emulation system calls
240sysc_noemu: 240sysc_noemu:
241#endif 241#endif
242 tm __TI_flags+7(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT) 242 tm __TI_flags+7(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
243 lgf %r8,0(%r7,%r10) # load address of system call routine 243 lgf %r8,0(%r7,%r10) # load address of system call routine
244 jnz sysc_tracesys 244 jnz sysc_tracesys
245 basr %r14,%r8 # call sys_xxxx 245 basr %r14,%r8 # call sys_xxxx
246 stg %r2,SP_R2(%r15) # store return value (change R2 on stack) 246 stg %r2,SP_R2(%r15) # store return value (change R2 on stack)
247 # ATTENTION: check sys_execve_glue before 247 # ATTENTION: check sys_execve_glue before
248 # changing anything here !! 248 # changing anything here !!
249 249
250sysc_return: 250sysc_return:
251 tm SP_PSW+1(%r15),0x01 # returning to user ? 251 tm SP_PSW+1(%r15),0x01 # returning to user ?
252 jno sysc_leave 252 jno sysc_leave
253 tm __TI_flags+7(%r9),_TIF_WORK_SVC 253 tm __TI_flags+7(%r9),_TIF_WORK_SVC
254 jnz sysc_work # there is work to do (signals etc.) 254 jnz sysc_work # there is work to do (signals etc.)
255sysc_leave: 255sysc_leave:
256 RESTORE_ALL __LC_RETURN_PSW,1 256 RESTORE_ALL __LC_RETURN_PSW,1
257 257
258# 258#
259# recheck if there is more work to do 259# recheck if there is more work to do
260# 260#
261sysc_work_loop: 261sysc_work_loop:
262 tm __TI_flags+7(%r9),_TIF_WORK_SVC 262 tm __TI_flags+7(%r9),_TIF_WORK_SVC
263 jz sysc_leave # there is no work to do 263 jz sysc_leave # there is no work to do
264# 264#
265# One of the work bits is on. Find out which one. 265# One of the work bits is on. Find out which one.
266# 266#
@@ -279,25 +279,25 @@ sysc_work:
279 279
280# 280#
281# _TIF_NEED_RESCHED is set, call schedule 281# _TIF_NEED_RESCHED is set, call schedule
282# 282#
283sysc_reschedule: 283sysc_reschedule:
284 larl %r14,sysc_work_loop 284 larl %r14,sysc_work_loop
285 jg schedule # return point is sysc_return 285 jg schedule # return point is sysc_return
286 286
287# 287#
288# _TIF_MCCK_PENDING is set, call handler 288# _TIF_MCCK_PENDING is set, call handler
289# 289#
290sysc_mcck_pending: 290sysc_mcck_pending:
291 larl %r14,sysc_work_loop 291 larl %r14,sysc_work_loop
292 jg s390_handle_mcck # TIF bit will be cleared by handler 292 jg s390_handle_mcck # TIF bit will be cleared by handler
293 293
294# 294#
295# _TIF_SIGPENDING or _TIF_RESTORE_SIGMASK is set, call do_signal 295# _TIF_SIGPENDING or _TIF_RESTORE_SIGMASK is set, call do_signal
296# 296#
297sysc_sigpending: 297sysc_sigpending:
298 ni __TI_flags+7(%r9),255-_TIF_SINGLE_STEP # clear TIF_SINGLE_STEP 298 ni __TI_flags+7(%r9),255-_TIF_SINGLE_STEP # clear TIF_SINGLE_STEP
299 la %r2,SP_PTREGS(%r15) # load pt_regs 299 la %r2,SP_PTREGS(%r15) # load pt_regs
300 brasl %r14,do_signal # call do_signal 300 brasl %r14,do_signal # call do_signal
301 tm __TI_flags+7(%r9),_TIF_RESTART_SVC 301 tm __TI_flags+7(%r9),_TIF_RESTART_SVC
302 jo sysc_restart 302 jo sysc_restart
303 tm __TI_flags+7(%r9),_TIF_SINGLE_STEP 303 tm __TI_flags+7(%r9),_TIF_SINGLE_STEP
@@ -309,11 +309,11 @@ sysc_sigpending:
309# 309#
310sysc_restart: 310sysc_restart:
311 ni __TI_flags+7(%r9),255-_TIF_RESTART_SVC # clear TIF_RESTART_SVC 311 ni __TI_flags+7(%r9),255-_TIF_RESTART_SVC # clear TIF_RESTART_SVC
312 lg %r7,SP_R2(%r15) # load new svc number 312 lg %r7,SP_R2(%r15) # load new svc number
313 slag %r7,%r7,2 # *4 313 slag %r7,%r7,2 # *4
314 mvc SP_R2(8,%r15),SP_ORIG_R2(%r15) # restore first argument 314 mvc SP_R2(8,%r15),SP_ORIG_R2(%r15) # restore first argument
315 lmg %r2,%r6,SP_R2(%r15) # load svc arguments 315 lmg %r2,%r6,SP_R2(%r15) # load svc arguments
316 j sysc_do_restart # restart svc 316 j sysc_do_restart # restart svc
317 317
318# 318#
319# _TIF_SINGLE_STEP is set, call do_single_step 319# _TIF_SINGLE_STEP is set, call do_single_step
@@ -326,49 +326,48 @@ sysc_singlestep:
326 larl %r14,sysc_return # load adr. of system return 326 larl %r14,sysc_return # load adr. of system return
327 jg do_single_step # branch to do_sigtrap 327 jg do_single_step # branch to do_sigtrap
328 328
329
330# 329#
331# call syscall_trace before and after system call 330# call syscall_trace before and after system call
332# special linkage: %r12 contains the return address for trace_svc 331# special linkage: %r12 contains the return address for trace_svc
333# 332#
334sysc_tracesys: 333sysc_tracesys:
335 la %r2,SP_PTREGS(%r15) # load pt_regs 334 la %r2,SP_PTREGS(%r15) # load pt_regs
336 la %r3,0 335 la %r3,0
337 srl %r7,2 336 srl %r7,2
338 stg %r7,SP_R2(%r15) 337 stg %r7,SP_R2(%r15)
339 brasl %r14,syscall_trace 338 brasl %r14,syscall_trace
340 lghi %r0,NR_syscalls 339 lghi %r0,NR_syscalls
341 clg %r0,SP_R2(%r15) 340 clg %r0,SP_R2(%r15)
342 jnh sysc_tracenogo 341 jnh sysc_tracenogo
343 lg %r7,SP_R2(%r15) # strace might have changed the 342 lg %r7,SP_R2(%r15) # strace might have changed the
344 sll %r7,2 # system call 343 sll %r7,2 # system call
345 lgf %r8,0(%r7,%r10) 344 lgf %r8,0(%r7,%r10)
346sysc_tracego: 345sysc_tracego:
347 lmg %r3,%r6,SP_R3(%r15) 346 lmg %r3,%r6,SP_R3(%r15)
348 lg %r2,SP_ORIG_R2(%r15) 347 lg %r2,SP_ORIG_R2(%r15)
349 basr %r14,%r8 # call sys_xxx 348 basr %r14,%r8 # call sys_xxx
350 stg %r2,SP_R2(%r15) # store return value 349 stg %r2,SP_R2(%r15) # store return value
351sysc_tracenogo: 350sysc_tracenogo:
352 tm __TI_flags+7(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT) 351 tm __TI_flags+7(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
353 jz sysc_return 352 jz sysc_return
354 la %r2,SP_PTREGS(%r15) # load pt_regs 353 la %r2,SP_PTREGS(%r15) # load pt_regs
355 la %r3,1 354 la %r3,1
356 larl %r14,sysc_return # return point is sysc_return 355 larl %r14,sysc_return # return point is sysc_return
357 jg syscall_trace 356 jg syscall_trace
358 357
359# 358#
360# a new process exits the kernel with ret_from_fork 359# a new process exits the kernel with ret_from_fork
361# 360#
362 .globl ret_from_fork 361 .globl ret_from_fork
363ret_from_fork: 362ret_from_fork:
364 lg %r13,__LC_SVC_NEW_PSW+8 363 lg %r13,__LC_SVC_NEW_PSW+8
365 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct 364 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct
366 tm SP_PSW+1(%r15),0x01 # forking a kernel thread ? 365 tm SP_PSW+1(%r15),0x01 # forking a kernel thread ?
367 jo 0f 366 jo 0f
368 stg %r15,SP_R15(%r15) # store stack pointer for new kthread 367 stg %r15,SP_R15(%r15) # store stack pointer for new kthread
3690: brasl %r14,schedule_tail 3680: brasl %r14,schedule_tail
370 TRACE_IRQS_ON 369 TRACE_IRQS_ON
371 stosm 24(%r15),0x03 # reenable interrupts 370 stosm 24(%r15),0x03 # reenable interrupts
372 j sysc_return 371 j sysc_return
373 372
374# 373#
@@ -377,78 +376,78 @@ ret_from_fork:
377# but are called with different parameter. 376# but are called with different parameter.
378# return-address is set up above 377# return-address is set up above
379# 378#
380sys_clone_glue: 379sys_clone_glue:
381 la %r2,SP_PTREGS(%r15) # load pt_regs 380 la %r2,SP_PTREGS(%r15) # load pt_regs
382 jg sys_clone # branch to sys_clone 381 jg sys_clone # branch to sys_clone
383 382
384#ifdef CONFIG_COMPAT 383#ifdef CONFIG_COMPAT
385sys32_clone_glue: 384sys32_clone_glue:
386 la %r2,SP_PTREGS(%r15) # load pt_regs 385 la %r2,SP_PTREGS(%r15) # load pt_regs
387 jg sys32_clone # branch to sys32_clone 386 jg sys32_clone # branch to sys32_clone
388#endif 387#endif
389 388
390sys_fork_glue: 389sys_fork_glue:
391 la %r2,SP_PTREGS(%r15) # load pt_regs 390 la %r2,SP_PTREGS(%r15) # load pt_regs
392 jg sys_fork # branch to sys_fork 391 jg sys_fork # branch to sys_fork
393 392
394sys_vfork_glue: 393sys_vfork_glue:
395 la %r2,SP_PTREGS(%r15) # load pt_regs 394 la %r2,SP_PTREGS(%r15) # load pt_regs
396 jg sys_vfork # branch to sys_vfork 395 jg sys_vfork # branch to sys_vfork
397 396
398sys_execve_glue: 397sys_execve_glue:
399 la %r2,SP_PTREGS(%r15) # load pt_regs 398 la %r2,SP_PTREGS(%r15) # load pt_regs
400 lgr %r12,%r14 # save return address 399 lgr %r12,%r14 # save return address
401 brasl %r14,sys_execve # call sys_execve 400 brasl %r14,sys_execve # call sys_execve
402 ltgr %r2,%r2 # check if execve failed 401 ltgr %r2,%r2 # check if execve failed
403 bnz 0(%r12) # it did fail -> store result in gpr2 402 bnz 0(%r12) # it did fail -> store result in gpr2
404 b 6(%r12) # SKIP STG 2,SP_R2(15) in 403 b 6(%r12) # SKIP STG 2,SP_R2(15) in
405 # system_call/sysc_tracesys 404 # system_call/sysc_tracesys
406#ifdef CONFIG_COMPAT 405#ifdef CONFIG_COMPAT
407sys32_execve_glue: 406sys32_execve_glue:
408 la %r2,SP_PTREGS(%r15) # load pt_regs 407 la %r2,SP_PTREGS(%r15) # load pt_regs
409 lgr %r12,%r14 # save return address 408 lgr %r12,%r14 # save return address
410 brasl %r14,sys32_execve # call sys32_execve 409 brasl %r14,sys32_execve # call sys32_execve
411 ltgr %r2,%r2 # check if execve failed 410 ltgr %r2,%r2 # check if execve failed
412 bnz 0(%r12) # it did fail -> store result in gpr2 411 bnz 0(%r12) # it did fail -> store result in gpr2
413 b 6(%r12) # SKIP STG 2,SP_R2(15) in 412 b 6(%r12) # SKIP STG 2,SP_R2(15) in
414 # system_call/sysc_tracesys 413 # system_call/sysc_tracesys
415#endif 414#endif
416 415
417sys_sigreturn_glue: 416sys_sigreturn_glue:
418 la %r2,SP_PTREGS(%r15) # load pt_regs as parameter 417 la %r2,SP_PTREGS(%r15) # load pt_regs as parameter
419 jg sys_sigreturn # branch to sys_sigreturn 418 jg sys_sigreturn # branch to sys_sigreturn
420 419
421#ifdef CONFIG_COMPAT 420#ifdef CONFIG_COMPAT
422sys32_sigreturn_glue: 421sys32_sigreturn_glue:
423 la %r2,SP_PTREGS(%r15) # load pt_regs as parameter 422 la %r2,SP_PTREGS(%r15) # load pt_regs as parameter
424 jg sys32_sigreturn # branch to sys32_sigreturn 423 jg sys32_sigreturn # branch to sys32_sigreturn
425#endif 424#endif
426 425
427sys_rt_sigreturn_glue: 426sys_rt_sigreturn_glue:
428 la %r2,SP_PTREGS(%r15) # load pt_regs as parameter 427 la %r2,SP_PTREGS(%r15) # load pt_regs as parameter
429 jg sys_rt_sigreturn # branch to sys_sigreturn 428 jg sys_rt_sigreturn # branch to sys_sigreturn
430 429
431#ifdef CONFIG_COMPAT 430#ifdef CONFIG_COMPAT
432sys32_rt_sigreturn_glue: 431sys32_rt_sigreturn_glue:
433 la %r2,SP_PTREGS(%r15) # load pt_regs as parameter 432 la %r2,SP_PTREGS(%r15) # load pt_regs as parameter
434 jg sys32_rt_sigreturn # branch to sys32_sigreturn 433 jg sys32_rt_sigreturn # branch to sys32_sigreturn
435#endif 434#endif
436 435
437sys_sigaltstack_glue: 436sys_sigaltstack_glue:
438 la %r4,SP_PTREGS(%r15) # load pt_regs as parameter 437 la %r4,SP_PTREGS(%r15) # load pt_regs as parameter
439 jg sys_sigaltstack # branch to sys_sigreturn 438 jg sys_sigaltstack # branch to sys_sigreturn
440 439
441#ifdef CONFIG_COMPAT 440#ifdef CONFIG_COMPAT
442sys32_sigaltstack_glue: 441sys32_sigaltstack_glue:
443 la %r4,SP_PTREGS(%r15) # load pt_regs as parameter 442 la %r4,SP_PTREGS(%r15) # load pt_regs as parameter
444 jg sys32_sigaltstack_wrapper # branch to sys_sigreturn 443 jg sys32_sigaltstack_wrapper # branch to sys_sigreturn
445#endif 444#endif
446 445
447/* 446/*
448 * Program check handler routine 447 * Program check handler routine
449 */ 448 */
450 449
451 .globl pgm_check_handler 450 .globl pgm_check_handler
452pgm_check_handler: 451pgm_check_handler:
453/* 452/*
454 * First we need to check for a special case: 453 * First we need to check for a special case:
@@ -465,8 +464,8 @@ pgm_check_handler:
465 */ 464 */
466 STORE_TIMER __LC_SYNC_ENTER_TIMER 465 STORE_TIMER __LC_SYNC_ENTER_TIMER
467 SAVE_ALL_BASE __LC_SAVE_AREA 466 SAVE_ALL_BASE __LC_SAVE_AREA
468 tm __LC_PGM_INT_CODE+1,0x80 # check whether we got a per exception 467 tm __LC_PGM_INT_CODE+1,0x80 # check whether we got a per exception
469 jnz pgm_per # got per exception -> special case 468 jnz pgm_per # got per exception -> special case
470 SAVE_ALL_SYNC __LC_PGM_OLD_PSW,__LC_SAVE_AREA 469 SAVE_ALL_SYNC __LC_PGM_OLD_PSW,__LC_SAVE_AREA
471 CREATE_STACK_FRAME __LC_PGM_OLD_PSW,__LC_SAVE_AREA 470 CREATE_STACK_FRAME __LC_PGM_OLD_PSW,__LC_SAVE_AREA
472#ifdef CONFIG_VIRT_CPU_ACCOUNTING 471#ifdef CONFIG_VIRT_CPU_ACCOUNTING
@@ -478,29 +477,29 @@ pgm_check_handler:
478pgm_no_vtime: 477pgm_no_vtime:
479#endif 478#endif
480 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct 479 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct
481 lgf %r3,__LC_PGM_ILC # load program interruption code 480 lgf %r3,__LC_PGM_ILC # load program interruption code
482 lghi %r8,0x7f 481 lghi %r8,0x7f
483 ngr %r8,%r3 482 ngr %r8,%r3
484pgm_do_call: 483pgm_do_call:
485 sll %r8,3 484 sll %r8,3
486 larl %r1,pgm_check_table 485 larl %r1,pgm_check_table
487 lg %r1,0(%r8,%r1) # load address of handler routine 486 lg %r1,0(%r8,%r1) # load address of handler routine
488 la %r2,SP_PTREGS(%r15) # address of register-save area 487 la %r2,SP_PTREGS(%r15) # address of register-save area
489 larl %r14,sysc_return 488 larl %r14,sysc_return
490 br %r1 # branch to interrupt-handler 489 br %r1 # branch to interrupt-handler
491 490
492# 491#
493# handle per exception 492# handle per exception
494# 493#
495pgm_per: 494pgm_per:
496 tm __LC_PGM_OLD_PSW,0x40 # test if per event recording is on 495 tm __LC_PGM_OLD_PSW,0x40 # test if per event recording is on
497 jnz pgm_per_std # ok, normal per event from user space 496 jnz pgm_per_std # ok, normal per event from user space
498# ok its one of the special cases, now we need to find out which one 497# ok its one of the special cases, now we need to find out which one
499 clc __LC_PGM_OLD_PSW(16),__LC_SVC_NEW_PSW 498 clc __LC_PGM_OLD_PSW(16),__LC_SVC_NEW_PSW
500 je pgm_svcper 499 je pgm_svcper
501# no interesting special case, ignore PER event 500# no interesting special case, ignore PER event
502 lmg %r12,%r15,__LC_SAVE_AREA 501 lmg %r12,%r15,__LC_SAVE_AREA
503 lpswe __LC_PGM_OLD_PSW 502 lpswe __LC_PGM_OLD_PSW
504 503
505# 504#
506# Normal per exception 505# Normal per exception
@@ -524,9 +523,9 @@ pgm_no_vtime2:
524 mvc __THREAD_per+__PER_address(8,%r1),__LC_PER_ADDRESS 523 mvc __THREAD_per+__PER_address(8,%r1),__LC_PER_ADDRESS
525 mvc __THREAD_per+__PER_access_id(1,%r1),__LC_PER_ACCESS_ID 524 mvc __THREAD_per+__PER_access_id(1,%r1),__LC_PER_ACCESS_ID
526 oi __TI_flags+7(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP 525 oi __TI_flags+7(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP
527 lgf %r3,__LC_PGM_ILC # load program interruption code 526 lgf %r3,__LC_PGM_ILC # load program interruption code
528 lghi %r8,0x7f 527 lghi %r8,0x7f
529 ngr %r8,%r3 # clear per-event-bit and ilc 528 ngr %r8,%r3 # clear per-event-bit and ilc
530 je sysc_return 529 je sysc_return
531 j pgm_do_call 530 j pgm_do_call
532 531
@@ -544,7 +543,7 @@ pgm_svcper:
544 mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER 543 mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER
545pgm_no_vtime3: 544pgm_no_vtime3:
546#endif 545#endif
547 llgh %r7,__LC_SVC_INT_CODE # get svc number from lowcore 546 llgh %r7,__LC_SVC_INT_CODE # get svc number from lowcore
548 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct 547 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct
549 lg %r1,__TI_task(%r9) 548 lg %r1,__TI_task(%r9)
550 mvc __THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID 549 mvc __THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID
@@ -568,7 +567,7 @@ kernel_per:
568/* 567/*
569 * IO interrupt handler routine 568 * IO interrupt handler routine
570 */ 569 */
571 .globl io_int_handler 570 .globl io_int_handler
572io_int_handler: 571io_int_handler:
573 STORE_TIMER __LC_ASYNC_ENTER_TIMER 572 STORE_TIMER __LC_ASYNC_ENTER_TIMER
574 stck __LC_INT_CLOCK 573 stck __LC_INT_CLOCK
@@ -585,42 +584,42 @@ io_no_vtime:
585#endif 584#endif
586 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct 585 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct
587 TRACE_IRQS_OFF 586 TRACE_IRQS_OFF
588 la %r2,SP_PTREGS(%r15) # address of register-save area 587 la %r2,SP_PTREGS(%r15) # address of register-save area
589 brasl %r14,do_IRQ # call standard irq handler 588 brasl %r14,do_IRQ # call standard irq handler
590 TRACE_IRQS_ON 589 TRACE_IRQS_ON
591 590
592io_return: 591io_return:
593 tm SP_PSW+1(%r15),0x01 # returning to user ? 592 tm SP_PSW+1(%r15),0x01 # returning to user ?
594#ifdef CONFIG_PREEMPT 593#ifdef CONFIG_PREEMPT
595 jno io_preempt # no -> check for preemptive scheduling 594 jno io_preempt # no -> check for preemptive scheduling
596#else 595#else
597 jno io_leave # no-> skip resched & signal 596 jno io_leave # no-> skip resched & signal
598#endif 597#endif
599 tm __TI_flags+7(%r9),_TIF_WORK_INT 598 tm __TI_flags+7(%r9),_TIF_WORK_INT
600 jnz io_work # there is work to do (signals etc.) 599 jnz io_work # there is work to do (signals etc.)
601io_leave: 600io_leave:
602 RESTORE_ALL __LC_RETURN_PSW,0 601 RESTORE_ALL __LC_RETURN_PSW,0
603io_done: 602io_done:
604 603
605#ifdef CONFIG_PREEMPT 604#ifdef CONFIG_PREEMPT
606io_preempt: 605io_preempt:
607 icm %r0,15,__TI_precount(%r9) 606 icm %r0,15,__TI_precount(%r9)
608 jnz io_leave 607 jnz io_leave
609 # switch to kernel stack 608 # switch to kernel stack
610 lg %r1,SP_R15(%r15) 609 lg %r1,SP_R15(%r15)
611 aghi %r1,-SP_SIZE 610 aghi %r1,-SP_SIZE
612 mvc SP_PTREGS(__PT_SIZE,%r1),SP_PTREGS(%r15) 611 mvc SP_PTREGS(__PT_SIZE,%r1),SP_PTREGS(%r15)
613 xc __SF_BACKCHAIN(8,%r1),__SF_BACKCHAIN(%r1) # clear back chain 612 xc __SF_BACKCHAIN(8,%r1),__SF_BACKCHAIN(%r1) # clear back chain
614 lgr %r15,%r1 613 lgr %r15,%r1
615io_resume_loop: 614io_resume_loop:
616 tm __TI_flags+7(%r9),_TIF_NEED_RESCHED 615 tm __TI_flags+7(%r9),_TIF_NEED_RESCHED
617 jno io_leave 616 jno io_leave
618 larl %r1,.Lc_pactive 617 larl %r1,.Lc_pactive
619 mvc __TI_precount(4,%r9),0(%r1) 618 mvc __TI_precount(4,%r9),0(%r1)
620 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts 619 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts
621 brasl %r14,schedule # call schedule 620 brasl %r14,schedule # call schedule
622 stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts 621 stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts
623 xc __TI_precount(4,%r9),__TI_precount(%r9) 622 xc __TI_precount(4,%r9),__TI_precount(%r9)
624 j io_resume_loop 623 j io_resume_loop
625#endif 624#endif
626 625
@@ -631,7 +630,7 @@ io_work:
631 lg %r1,__LC_KERNEL_STACK 630 lg %r1,__LC_KERNEL_STACK
632 aghi %r1,-SP_SIZE 631 aghi %r1,-SP_SIZE
633 mvc SP_PTREGS(__PT_SIZE,%r1),SP_PTREGS(%r15) 632 mvc SP_PTREGS(__PT_SIZE,%r1),SP_PTREGS(%r15)
634 xc __SF_BACKCHAIN(8,%r1),__SF_BACKCHAIN(%r1) # clear back chain 633 xc __SF_BACKCHAIN(8,%r1),__SF_BACKCHAIN(%r1) # clear back chain
635 lgr %r15,%r1 634 lgr %r15,%r1
636# 635#
637# One of the work bits is on. Find out which one. 636# One of the work bits is on. Find out which one.
@@ -656,11 +655,11 @@ io_mcck_pending:
656 655
657# 656#
658# _TIF_NEED_RESCHED is set, call schedule 657# _TIF_NEED_RESCHED is set, call schedule
659# 658#
660io_reschedule: 659io_reschedule:
661 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts 660 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts
662 brasl %r14,schedule # call scheduler 661 brasl %r14,schedule # call scheduler
663 stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts 662 stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts
664 tm __TI_flags+7(%r9),_TIF_WORK_INT 663 tm __TI_flags+7(%r9),_TIF_WORK_INT
665 jz io_leave # there is no work to do 664 jz io_leave # there is no work to do
666 j io_work_loop 665 j io_work_loop
@@ -668,17 +667,17 @@ io_reschedule:
668# 667#
669# _TIF_SIGPENDING or _TIF_RESTORE_SIGMASK is set, call do_signal 668# _TIF_SIGPENDING or _TIF_RESTORE_SIGMASK is set, call do_signal
670# 669#
671io_sigpending: 670io_sigpending:
672 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts 671 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts
673 la %r2,SP_PTREGS(%r15) # load pt_regs 672 la %r2,SP_PTREGS(%r15) # load pt_regs
674 brasl %r14,do_signal # call do_signal 673 brasl %r14,do_signal # call do_signal
675 stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts 674 stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts
676 j io_work_loop 675 j io_work_loop
677 676
678/* 677/*
679 * External interrupt handler routine 678 * External interrupt handler routine
680 */ 679 */
681 .globl ext_int_handler 680 .globl ext_int_handler
682ext_int_handler: 681ext_int_handler:
683 STORE_TIMER __LC_ASYNC_ENTER_TIMER 682 STORE_TIMER __LC_ASYNC_ENTER_TIMER
684 stck __LC_INT_CLOCK 683 stck __LC_INT_CLOCK
@@ -695,9 +694,9 @@ ext_no_vtime:
695#endif 694#endif
696 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct 695 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct
697 TRACE_IRQS_OFF 696 TRACE_IRQS_OFF
698 la %r2,SP_PTREGS(%r15) # address of register-save area 697 la %r2,SP_PTREGS(%r15) # address of register-save area
699 llgh %r3,__LC_EXT_INT_CODE # get interruption code 698 llgh %r3,__LC_EXT_INT_CODE # get interruption code
700 brasl %r14,do_extint 699 brasl %r14,do_extint
701 TRACE_IRQS_ON 700 TRACE_IRQS_ON
702 j io_return 701 j io_return
703 702
@@ -706,14 +705,14 @@ __critical_end:
706/* 705/*
707 * Machine check handler routines 706 * Machine check handler routines
708 */ 707 */
709 .globl mcck_int_handler 708 .globl mcck_int_handler
710mcck_int_handler: 709mcck_int_handler:
711 la %r1,4095 # revalidate r1 710 la %r1,4095 # revalidate r1
712 spt __LC_CPU_TIMER_SAVE_AREA-4095(%r1) # revalidate cpu timer 711 spt __LC_CPU_TIMER_SAVE_AREA-4095(%r1) # revalidate cpu timer
713 lmg %r0,%r15,__LC_GPREGS_SAVE_AREA-4095(%r1)# revalidate gprs 712 lmg %r0,%r15,__LC_GPREGS_SAVE_AREA-4095(%r1)# revalidate gprs
714 SAVE_ALL_BASE __LC_SAVE_AREA+64 713 SAVE_ALL_BASE __LC_SAVE_AREA+64
715 la %r12,__LC_MCK_OLD_PSW 714 la %r12,__LC_MCK_OLD_PSW
716 tm __LC_MCCK_CODE,0x80 # system damage? 715 tm __LC_MCCK_CODE,0x80 # system damage?
717 jo mcck_int_main # yes -> rest of mcck code invalid 716 jo mcck_int_main # yes -> rest of mcck code invalid
718#ifdef CONFIG_VIRT_CPU_ACCOUNTING 717#ifdef CONFIG_VIRT_CPU_ACCOUNTING
719 la %r14,4095 718 la %r14,4095
@@ -737,19 +736,19 @@ mcck_int_handler:
737#endif 736#endif
738 tm __LC_MCCK_CODE+2,0x09 # mwp + ia of old psw valid? 737 tm __LC_MCCK_CODE+2,0x09 # mwp + ia of old psw valid?
739 jno mcck_int_main # no -> skip cleanup critical 738 jno mcck_int_main # no -> skip cleanup critical
740 tm __LC_MCK_OLD_PSW+1,0x01 # test problem state bit 739 tm __LC_MCK_OLD_PSW+1,0x01 # test problem state bit
741 jnz mcck_int_main # from user -> load kernel stack 740 jnz mcck_int_main # from user -> load kernel stack
742 clc __LC_MCK_OLD_PSW+8(8),BASED(.Lcritical_end) 741 clc __LC_MCK_OLD_PSW+8(8),BASED(.Lcritical_end)
743 jhe mcck_int_main 742 jhe mcck_int_main
744 clc __LC_MCK_OLD_PSW+8(8),BASED(.Lcritical_start) 743 clc __LC_MCK_OLD_PSW+8(8),BASED(.Lcritical_start)
745 jl mcck_int_main 744 jl mcck_int_main
746 brasl %r14,cleanup_critical 745 brasl %r14,cleanup_critical
747mcck_int_main: 746mcck_int_main:
748 lg %r14,__LC_PANIC_STACK # are we already on the panic stack? 747 lg %r14,__LC_PANIC_STACK # are we already on the panic stack?
749 slgr %r14,%r15 748 slgr %r14,%r15
750 srag %r14,%r14,PAGE_SHIFT 749 srag %r14,%r14,PAGE_SHIFT
751 jz 0f 750 jz 0f
752 lg %r15,__LC_PANIC_STACK # load panic stack 751 lg %r15,__LC_PANIC_STACK # load panic stack
7530: CREATE_STACK_FRAME __LC_MCK_OLD_PSW,__LC_SAVE_AREA+64 7520: CREATE_STACK_FRAME __LC_MCK_OLD_PSW,__LC_SAVE_AREA+64
754#ifdef CONFIG_VIRT_CPU_ACCOUNTING 753#ifdef CONFIG_VIRT_CPU_ACCOUNTING
755 tm __LC_MCCK_CODE+2,0x08 # mwp of old psw valid? 754 tm __LC_MCCK_CODE+2,0x08 # mwp of old psw valid?
@@ -764,7 +763,7 @@ mcck_no_vtime:
764 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct 763 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct
765 la %r2,SP_PTREGS(%r15) # load pt_regs 764 la %r2,SP_PTREGS(%r15) # load pt_regs
766 brasl %r14,s390_do_machine_check 765 brasl %r14,s390_do_machine_check
767 tm SP_PSW+1(%r15),0x01 # returning to user ? 766 tm SP_PSW+1(%r15),0x01 # returning to user ?
768 jno mcck_return 767 jno mcck_return
769 lg %r1,__LC_KERNEL_STACK # switch to kernel stack 768 lg %r1,__LC_KERNEL_STACK # switch to kernel stack
770 aghi %r1,-SP_SIZE 769 aghi %r1,-SP_SIZE
@@ -794,28 +793,28 @@ mcck_return:
794/* 793/*
795 * Restart interruption handler, kick starter for additional CPUs 794 * Restart interruption handler, kick starter for additional CPUs
796 */ 795 */
797 .globl restart_int_handler 796 .globl restart_int_handler
798restart_int_handler: 797restart_int_handler:
799 lg %r15,__LC_SAVE_AREA+120 # load ksp 798 lg %r15,__LC_SAVE_AREA+120 # load ksp
800 lghi %r10,__LC_CREGS_SAVE_AREA 799 lghi %r10,__LC_CREGS_SAVE_AREA
801 lctlg %c0,%c15,0(%r10) # get new ctl regs 800 lctlg %c0,%c15,0(%r10) # get new ctl regs
802 lghi %r10,__LC_AREGS_SAVE_AREA 801 lghi %r10,__LC_AREGS_SAVE_AREA
803 lam %a0,%a15,0(%r10) 802 lam %a0,%a15,0(%r10)
804 lmg %r6,%r15,__SF_GPRS(%r15) # load registers from clone 803 lmg %r6,%r15,__SF_GPRS(%r15) # load registers from clone
805 stosm __SF_EMPTY(%r15),0x04 # now we can turn dat on 804 stosm __SF_EMPTY(%r15),0x04 # now we can turn dat on
806 jg start_secondary 805 jg start_secondary
807#else 806#else
808/* 807/*
809 * If we do not run with SMP enabled, let the new CPU crash ... 808 * If we do not run with SMP enabled, let the new CPU crash ...
810 */ 809 */
811 .globl restart_int_handler 810 .globl restart_int_handler
812restart_int_handler: 811restart_int_handler:
813 basr %r1,0 812 basr %r1,0
814restart_base: 813restart_base:
815 lpswe restart_crash-restart_base(%r1) 814 lpswe restart_crash-restart_base(%r1)
816 .align 8 815 .align 8
817restart_crash: 816restart_crash:
818 .long 0x000a0000,0x00000000,0x00000000,0x00000000 817 .long 0x000a0000,0x00000000,0x00000000,0x00000000
819restart_go: 818restart_go:
820#endif 819#endif
821 820
@@ -836,9 +835,9 @@ stack_overflow:
836 chi %r12,__LC_PGM_OLD_PSW 835 chi %r12,__LC_PGM_OLD_PSW
837 je 0f 836 je 0f
838 la %r1,__LC_SAVE_AREA+32 837 la %r1,__LC_SAVE_AREA+32
8390: mvc SP_R12(32,%r15),0(%r1) # move %r12-%r15 to stack 8380: mvc SP_R12(32,%r15),0(%r1) # move %r12-%r15 to stack
840 xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) # clear back chain 839 xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) # clear back chain
841 la %r2,SP_PTREGS(%r15) # load pt_regs 840 la %r2,SP_PTREGS(%r15) # load pt_regs
842 jg kernel_stack_overflow 841 jg kernel_stack_overflow
843#endif 842#endif
844 843
@@ -941,10 +940,10 @@ cleanup_novtime:
941cleanup_system_call_insn: 940cleanup_system_call_insn:
942 .quad sysc_saveall 941 .quad sysc_saveall
943#ifdef CONFIG_VIRT_CPU_ACCOUNTING 942#ifdef CONFIG_VIRT_CPU_ACCOUNTING
944 .quad system_call 943 .quad system_call
945 .quad sysc_vtime 944 .quad sysc_vtime
946 .quad sysc_stime 945 .quad sysc_stime
947 .quad sysc_update 946 .quad sysc_update
948#endif 947#endif
949 948
950cleanup_sysc_return: 949cleanup_sysc_return:
@@ -1010,21 +1009,21 @@ cleanup_io_leave_insn:
1010/* 1009/*
1011 * Integer constants 1010 * Integer constants
1012 */ 1011 */
1013 .align 4 1012 .align 4
1014.Lconst: 1013.Lconst:
1015.Lc_pactive: .long PREEMPT_ACTIVE 1014.Lc_pactive: .long PREEMPT_ACTIVE
1016.Lnr_syscalls: .long NR_syscalls 1015.Lnr_syscalls: .long NR_syscalls
1017.L0x0130: .short 0x130 1016.L0x0130: .short 0x130
1018.L0x0140: .short 0x140 1017.L0x0140: .short 0x140
1019.L0x0150: .short 0x150 1018.L0x0150: .short 0x150
1020.L0x0160: .short 0x160 1019.L0x0160: .short 0x160
1021.L0x0170: .short 0x170 1020.L0x0170: .short 0x170
1022.Lcritical_start: 1021.Lcritical_start:
1023 .quad __critical_start 1022 .quad __critical_start
1024.Lcritical_end: 1023.Lcritical_end:
1025 .quad __critical_end 1024 .quad __critical_end
1026 1025
1027 .section .rodata, "a" 1026 .section .rodata, "a"
1028#define SYSCALL(esa,esame,emu) .long esame 1027#define SYSCALL(esa,esame,emu) .long esame
1029sys_call_table: 1028sys_call_table:
1030#include "syscalls.S" 1029#include "syscalls.S"
diff --git a/arch/s390/kernel/head.S b/arch/s390/kernel/head.S
index 0f1db268a8a9..0cf59bb7a857 100644
--- a/arch/s390/kernel/head.S
+++ b/arch/s390/kernel/head.S
@@ -36,449 +36,449 @@
36#endif 36#endif
37 37
38#ifndef CONFIG_IPL 38#ifndef CONFIG_IPL
39 .org 0 39 .org 0
40 .long 0x00080000,0x80000000+startup # Just a restart PSW 40 .long 0x00080000,0x80000000+startup # Just a restart PSW
41#else 41#else
42#ifdef CONFIG_IPL_TAPE 42#ifdef CONFIG_IPL_TAPE
43#define IPL_BS 1024 43#define IPL_BS 1024
44 .org 0 44 .org 0
45 .long 0x00080000,0x80000000+iplstart # The first 24 bytes are loaded 45 .long 0x00080000,0x80000000+iplstart # The first 24 bytes are loaded
46 .long 0x27000000,0x60000001 # by ipl to addresses 0-23. 46 .long 0x27000000,0x60000001 # by ipl to addresses 0-23.
47 .long 0x02000000,0x20000000+IPL_BS # (a PSW and two CCWs). 47 .long 0x02000000,0x20000000+IPL_BS # (a PSW and two CCWs).
48 .long 0x00000000,0x00000000 # external old psw 48 .long 0x00000000,0x00000000 # external old psw
49 .long 0x00000000,0x00000000 # svc old psw 49 .long 0x00000000,0x00000000 # svc old psw
50 .long 0x00000000,0x00000000 # program check old psw 50 .long 0x00000000,0x00000000 # program check old psw
51 .long 0x00000000,0x00000000 # machine check old psw 51 .long 0x00000000,0x00000000 # machine check old psw
52 .long 0x00000000,0x00000000 # io old psw 52 .long 0x00000000,0x00000000 # io old psw
53 .long 0x00000000,0x00000000 53 .long 0x00000000,0x00000000
54 .long 0x00000000,0x00000000 54 .long 0x00000000,0x00000000
55 .long 0x00000000,0x00000000 55 .long 0x00000000,0x00000000
56 .long 0x000a0000,0x00000058 # external new psw 56 .long 0x000a0000,0x00000058 # external new psw
57 .long 0x000a0000,0x00000060 # svc new psw 57 .long 0x000a0000,0x00000060 # svc new psw
58 .long 0x000a0000,0x00000068 # program check new psw 58 .long 0x000a0000,0x00000068 # program check new psw
59 .long 0x000a0000,0x00000070 # machine check new psw 59 .long 0x000a0000,0x00000070 # machine check new psw
60 .long 0x00080000,0x80000000+.Lioint # io new psw 60 .long 0x00080000,0x80000000+.Lioint # io new psw
61 61
62 .org 0x100 62 .org 0x100
63# 63#
64# subroutine for loading from tape 64# subroutine for loading from tape
65# Paramters: 65# Paramters:
66# R1 = device number 66# R1 = device number
67# R2 = load address 67# R2 = load address
68.Lloader: 68.Lloader:
69 st %r14,.Lldret 69 st %r14,.Lldret
70 la %r3,.Lorbread # r3 = address of orb 70 la %r3,.Lorbread # r3 = address of orb
71 la %r5,.Lirb # r5 = address of irb 71 la %r5,.Lirb # r5 = address of irb
72 st %r2,.Lccwread+4 # initialize CCW data addresses 72 st %r2,.Lccwread+4 # initialize CCW data addresses
73 lctl %c6,%c6,.Lcr6 73 lctl %c6,%c6,.Lcr6
74 slr %r2,%r2 74 slr %r2,%r2
75.Lldlp: 75.Lldlp:
76 la %r6,3 # 3 retries 76 la %r6,3 # 3 retries
77.Lssch: 77.Lssch:
78 ssch 0(%r3) # load chunk of IPL_BS bytes 78 ssch 0(%r3) # load chunk of IPL_BS bytes
79 bnz .Llderr 79 bnz .Llderr
80.Lw4end: 80.Lw4end:
81 bas %r14,.Lwait4io 81 bas %r14,.Lwait4io
82 tm 8(%r5),0x82 # do we have a problem ? 82 tm 8(%r5),0x82 # do we have a problem ?
83 bnz .Lrecov 83 bnz .Lrecov
84 slr %r7,%r7 84 slr %r7,%r7
85 icm %r7,3,10(%r5) # get residual count 85 icm %r7,3,10(%r5) # get residual count
86 lcr %r7,%r7 86 lcr %r7,%r7
87 la %r7,IPL_BS(%r7) # IPL_BS-residual=#bytes read 87 la %r7,IPL_BS(%r7) # IPL_BS-residual=#bytes read
88 ar %r2,%r7 # add to total size 88 ar %r2,%r7 # add to total size
89 tm 8(%r5),0x01 # found a tape mark ? 89 tm 8(%r5),0x01 # found a tape mark ?
90 bnz .Ldone 90 bnz .Ldone
91 l %r0,.Lccwread+4 # update CCW data addresses 91 l %r0,.Lccwread+4 # update CCW data addresses
92 ar %r0,%r7 92 ar %r0,%r7
93 st %r0,.Lccwread+4 93 st %r0,.Lccwread+4
94 b .Lldlp 94 b .Lldlp
95.Ldone: 95.Ldone:
96 l %r14,.Lldret 96 l %r14,.Lldret
97 br %r14 # r2 contains the total size 97 br %r14 # r2 contains the total size
98.Lrecov: 98.Lrecov:
99 bas %r14,.Lsense # do the sensing 99 bas %r14,.Lsense # do the sensing
100 bct %r6,.Lssch # dec. retry count & branch 100 bct %r6,.Lssch # dec. retry count & branch
101 b .Llderr 101 b .Llderr
102# 102#
103# Sense subroutine 103# Sense subroutine
104# 104#
105.Lsense: 105.Lsense:
106 st %r14,.Lsnsret 106 st %r14,.Lsnsret
107 la %r7,.Lorbsense 107 la %r7,.Lorbsense
108 ssch 0(%r7) # start sense command 108 ssch 0(%r7) # start sense command
109 bnz .Llderr 109 bnz .Llderr
110 bas %r14,.Lwait4io 110 bas %r14,.Lwait4io
111 l %r14,.Lsnsret 111 l %r14,.Lsnsret
112 tm 8(%r5),0x82 # do we have a problem ? 112 tm 8(%r5),0x82 # do we have a problem ?
113 bnz .Llderr 113 bnz .Llderr
114 br %r14 114 br %r14
115# 115#
116# Wait for interrupt subroutine 116# Wait for interrupt subroutine
117# 117#
118.Lwait4io: 118.Lwait4io:
119 lpsw .Lwaitpsw 119 lpsw .Lwaitpsw
120.Lioint: 120.Lioint:
121 c %r1,0xb8 # compare subchannel number 121 c %r1,0xb8 # compare subchannel number
122 bne .Lwait4io 122 bne .Lwait4io
123 tsch 0(%r5) 123 tsch 0(%r5)
124 slr %r0,%r0 124 slr %r0,%r0
125 tm 8(%r5),0x82 # do we have a problem ? 125 tm 8(%r5),0x82 # do we have a problem ?
126 bnz .Lwtexit 126 bnz .Lwtexit
127 tm 8(%r5),0x04 # got device end ? 127 tm 8(%r5),0x04 # got device end ?
128 bz .Lwait4io 128 bz .Lwait4io
129.Lwtexit: 129.Lwtexit:
130 br %r14 130 br %r14
131.Llderr: 131.Llderr:
132 lpsw .Lcrash 132 lpsw .Lcrash
133 133
134 .align 8 134 .align 8
135.Lorbread: 135.Lorbread:
136 .long 0x00000000,0x0080ff00,.Lccwread 136 .long 0x00000000,0x0080ff00,.Lccwread
137 .align 8 137 .align 8
138.Lorbsense: 138.Lorbsense:
139 .long 0x00000000,0x0080ff00,.Lccwsense 139 .long 0x00000000,0x0080ff00,.Lccwsense
140 .align 8 140 .align 8
141.Lccwread: 141.Lccwread:
142 .long 0x02200000+IPL_BS,0x00000000 142 .long 0x02200000+IPL_BS,0x00000000
143.Lccwsense: 143.Lccwsense:
144 .long 0x04200001,0x00000000 144 .long 0x04200001,0x00000000
145.Lwaitpsw: 145.Lwaitpsw:
146 .long 0x020a0000,0x80000000+.Lioint 146 .long 0x020a0000,0x80000000+.Lioint
147 147
148.Lirb: .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 148.Lirb: .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
149.Lcr6: .long 0xff000000 149.Lcr6: .long 0xff000000
150 .align 8 150 .align 8
151.Lcrash:.long 0x000a0000,0x00000000 151.Lcrash:.long 0x000a0000,0x00000000
152.Lldret:.long 0 152.Lldret:.long 0
153.Lsnsret: .long 0 153.Lsnsret: .long 0
154#endif /* CONFIG_IPL_TAPE */ 154#endif /* CONFIG_IPL_TAPE */
155 155
156#ifdef CONFIG_IPL_VM 156#ifdef CONFIG_IPL_VM
157#define IPL_BS 0x730 157#define IPL_BS 0x730
158 .org 0 158 .org 0
159 .long 0x00080000,0x80000000+iplstart # The first 24 bytes are loaded 159 .long 0x00080000,0x80000000+iplstart # The first 24 bytes are loaded
160 .long 0x02000018,0x60000050 # by ipl to addresses 0-23. 160 .long 0x02000018,0x60000050 # by ipl to addresses 0-23.
161 .long 0x02000068,0x60000050 # (a PSW and two CCWs). 161 .long 0x02000068,0x60000050 # (a PSW and two CCWs).
162 .fill 80-24,1,0x40 # bytes 24-79 are discarded !! 162 .fill 80-24,1,0x40 # bytes 24-79 are discarded !!
163 .long 0x020000f0,0x60000050 # The next 160 byte are loaded 163 .long 0x020000f0,0x60000050 # The next 160 byte are loaded
164 .long 0x02000140,0x60000050 # to addresses 0x18-0xb7 164 .long 0x02000140,0x60000050 # to addresses 0x18-0xb7
165 .long 0x02000190,0x60000050 # They form the continuation 165 .long 0x02000190,0x60000050 # They form the continuation
166 .long 0x020001e0,0x60000050 # of the CCW program started 166 .long 0x020001e0,0x60000050 # of the CCW program started
167 .long 0x02000230,0x60000050 # by ipl and load the range 167 .long 0x02000230,0x60000050 # by ipl and load the range
168 .long 0x02000280,0x60000050 # 0x0f0-0x730 from the image 168 .long 0x02000280,0x60000050 # 0x0f0-0x730 from the image
169 .long 0x020002d0,0x60000050 # to the range 0x0f0-0x730 169 .long 0x020002d0,0x60000050 # to the range 0x0f0-0x730
170 .long 0x02000320,0x60000050 # in memory. At the end of 170 .long 0x02000320,0x60000050 # in memory. At the end of
171 .long 0x02000370,0x60000050 # the channel program the PSW 171 .long 0x02000370,0x60000050 # the channel program the PSW
172 .long 0x020003c0,0x60000050 # at location 0 is loaded. 172 .long 0x020003c0,0x60000050 # at location 0 is loaded.
173 .long 0x02000410,0x60000050 # Initial processing starts 173 .long 0x02000410,0x60000050 # Initial processing starts
174 .long 0x02000460,0x60000050 # at 0xf0 = iplstart. 174 .long 0x02000460,0x60000050 # at 0xf0 = iplstart.
175 .long 0x020004b0,0x60000050 175 .long 0x020004b0,0x60000050
176 .long 0x02000500,0x60000050 176 .long 0x02000500,0x60000050
177 .long 0x02000550,0x60000050 177 .long 0x02000550,0x60000050
178 .long 0x020005a0,0x60000050 178 .long 0x020005a0,0x60000050
179 .long 0x020005f0,0x60000050 179 .long 0x020005f0,0x60000050
180 .long 0x02000640,0x60000050 180 .long 0x02000640,0x60000050
181 .long 0x02000690,0x60000050 181 .long 0x02000690,0x60000050
182 .long 0x020006e0,0x20000050 182 .long 0x020006e0,0x20000050
183 183
184 .org 0xf0 184 .org 0xf0
185# 185#
186# subroutine for loading cards from the reader 186# subroutine for loading cards from the reader
187# 187#
188.Lloader: 188.Lloader:
189 la %r3,.Lorb # r2 = address of orb into r2 189 la %r3,.Lorb # r2 = address of orb into r2
190 la %r5,.Lirb # r4 = address of irb 190 la %r5,.Lirb # r4 = address of irb
191 la %r6,.Lccws 191 la %r6,.Lccws
192 la %r7,20 192 la %r7,20
193.Linit: 193.Linit:
194 st %r2,4(%r6) # initialize CCW data addresses 194 st %r2,4(%r6) # initialize CCW data addresses
195 la %r2,0x50(%r2) 195 la %r2,0x50(%r2)
196 la %r6,8(%r6) 196 la %r6,8(%r6)
197 bct 7,.Linit 197 bct 7,.Linit
198 198
199 lctl %c6,%c6,.Lcr6 # set IO subclass mask 199 lctl %c6,%c6,.Lcr6 # set IO subclass mask
200 slr %r2,%r2 200 slr %r2,%r2
201.Lldlp: 201.Lldlp:
202 ssch 0(%r3) # load chunk of 1600 bytes 202 ssch 0(%r3) # load chunk of 1600 bytes
203 bnz .Llderr 203 bnz .Llderr
204.Lwait4irq: 204.Lwait4irq:
205 mvc 0x78(8),.Lnewpsw # set up IO interrupt psw 205 mvc 0x78(8),.Lnewpsw # set up IO interrupt psw
206 lpsw .Lwaitpsw 206 lpsw .Lwaitpsw
207.Lioint: 207.Lioint:
208 c %r1,0xb8 # compare subchannel number 208 c %r1,0xb8 # compare subchannel number
209 bne .Lwait4irq 209 bne .Lwait4irq
210 tsch 0(%r5) 210 tsch 0(%r5)
211 211
212 slr %r0,%r0 212 slr %r0,%r0
213 ic %r0,8(%r5) # get device status 213 ic %r0,8(%r5) # get device status
214 chi %r0,8 # channel end ? 214 chi %r0,8 # channel end ?
215 be .Lcont 215 be .Lcont
216 chi %r0,12 # channel end + device end ? 216 chi %r0,12 # channel end + device end ?
217 be .Lcont 217 be .Lcont
218 218
219 l %r0,4(%r5) 219 l %r0,4(%r5)
220 s %r0,8(%r3) # r0/8 = number of ccws executed 220 s %r0,8(%r3) # r0/8 = number of ccws executed
221 mhi %r0,10 # *10 = number of bytes in ccws 221 mhi %r0,10 # *10 = number of bytes in ccws
222 lh %r3,10(%r5) # get residual count 222 lh %r3,10(%r5) # get residual count
223 sr %r0,%r3 # #ccws*80-residual=#bytes read 223 sr %r0,%r3 # #ccws*80-residual=#bytes read
224 ar %r2,%r0 224 ar %r2,%r0
225 225
226 br %r14 # r2 contains the total size 226 br %r14 # r2 contains the total size
227 227
228.Lcont: 228.Lcont:
229 ahi %r2,0x640 # add 0x640 to total size 229 ahi %r2,0x640 # add 0x640 to total size
230 la %r6,.Lccws 230 la %r6,.Lccws
231 la %r7,20 231 la %r7,20
232.Lincr: 232.Lincr:
233 l %r0,4(%r6) # update CCW data addresses 233 l %r0,4(%r6) # update CCW data addresses
234 ahi %r0,0x640 234 ahi %r0,0x640
235 st %r0,4(%r6) 235 st %r0,4(%r6)
236 ahi %r6,8 236 ahi %r6,8
237 bct 7,.Lincr 237 bct 7,.Lincr
238 238
239 b .Lldlp 239 b .Lldlp
240.Llderr: 240.Llderr:
241 lpsw .Lcrash 241 lpsw .Lcrash
242 242
243 .align 8 243 .align 8
244.Lorb: .long 0x00000000,0x0080ff00,.Lccws 244.Lorb: .long 0x00000000,0x0080ff00,.Lccws
245.Lirb: .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 245.Lirb: .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
246.Lcr6: .long 0xff000000 246.Lcr6: .long 0xff000000
247.Lloadp:.long 0,0 247.Lloadp:.long 0,0
248 .align 8 248 .align 8
249.Lcrash:.long 0x000a0000,0x00000000 249.Lcrash:.long 0x000a0000,0x00000000
250.Lnewpsw: 250.Lnewpsw:
251 .long 0x00080000,0x80000000+.Lioint 251 .long 0x00080000,0x80000000+.Lioint
252.Lwaitpsw: 252.Lwaitpsw:
253 .long 0x020a0000,0x80000000+.Lioint 253 .long 0x020a0000,0x80000000+.Lioint
254 254
255 .align 8 255 .align 8
256.Lccws: .rept 19 256.Lccws: .rept 19
257 .long 0x02600050,0x00000000 257 .long 0x02600050,0x00000000
258 .endr 258 .endr
259 .long 0x02200050,0x00000000 259 .long 0x02200050,0x00000000
260#endif /* CONFIG_IPL_VM */ 260#endif /* CONFIG_IPL_VM */
261 261
262iplstart: 262iplstart:
263 lh %r1,0xb8 # test if subchannel number 263 lh %r1,0xb8 # test if subchannel number
264 bct %r1,.Lnoload # is valid 264 bct %r1,.Lnoload # is valid
265 l %r1,0xb8 # load ipl subchannel number 265 l %r1,0xb8 # load ipl subchannel number
266 la %r2,IPL_BS # load start address 266 la %r2,IPL_BS # load start address
267 bas %r14,.Lloader # load rest of ipl image 267 bas %r14,.Lloader # load rest of ipl image
268 l %r12,.Lparm # pointer to parameter area 268 l %r12,.Lparm # pointer to parameter area
269 st %r1,IPL_DEVICE+ARCH_OFFSET-PARMAREA(%r12) # save ipl device number 269 st %r1,IPL_DEVICE+ARCH_OFFSET-PARMAREA(%r12) # save ipl device number
270 270
271# 271#
272# load parameter file from ipl device 272# load parameter file from ipl device
273# 273#
274.Lagain1: 274.Lagain1:
275 l %r2,.Linitrd # ramdisk loc. is temp 275 l %r2,.Linitrd # ramdisk loc. is temp
276 bas %r14,.Lloader # load parameter file 276 bas %r14,.Lloader # load parameter file
277 ltr %r2,%r2 # got anything ? 277 ltr %r2,%r2 # got anything ?
278 bz .Lnopf 278 bz .Lnopf
279 chi %r2,895 279 chi %r2,895
280 bnh .Lnotrunc 280 bnh .Lnotrunc
281 la %r2,895 281 la %r2,895
282.Lnotrunc: 282.Lnotrunc:
283 l %r4,.Linitrd 283 l %r4,.Linitrd
284 clc 0(3,%r4),.L_hdr # if it is HDRx 284 clc 0(3,%r4),.L_hdr # if it is HDRx
285 bz .Lagain1 # skip dataset header 285 bz .Lagain1 # skip dataset header
286 clc 0(3,%r4),.L_eof # if it is EOFx 286 clc 0(3,%r4),.L_eof # if it is EOFx
287 bz .Lagain1 # skip dateset trailer 287 bz .Lagain1 # skip dateset trailer
288 la %r5,0(%r4,%r2) 288 la %r5,0(%r4,%r2)
289 lr %r3,%r2 289 lr %r3,%r2
290.Lidebc: 290.Lidebc:
291 tm 0(%r5),0x80 # high order bit set ? 291 tm 0(%r5),0x80 # high order bit set ?
292 bo .Ldocv # yes -> convert from EBCDIC 292 bo .Ldocv # yes -> convert from EBCDIC
293 ahi %r5,-1 293 ahi %r5,-1
294 bct %r3,.Lidebc 294 bct %r3,.Lidebc
295 b .Lnocv 295 b .Lnocv
296.Ldocv: 296.Ldocv:
297 l %r3,.Lcvtab 297 l %r3,.Lcvtab
298 tr 0(256,%r4),0(%r3) # convert parameters to ascii 298 tr 0(256,%r4),0(%r3) # convert parameters to ascii
299 tr 256(256,%r4),0(%r3) 299 tr 256(256,%r4),0(%r3)
300 tr 512(256,%r4),0(%r3) 300 tr 512(256,%r4),0(%r3)
301 tr 768(122,%r4),0(%r3) 301 tr 768(122,%r4),0(%r3)
302.Lnocv: la %r3,COMMAND_LINE-PARMAREA(%r12) # load adr. of command line 302.Lnocv: la %r3,COMMAND_LINE-PARMAREA(%r12) # load adr. of command line
303 mvc 0(256,%r3),0(%r4) 303 mvc 0(256,%r3),0(%r4)
304 mvc 256(256,%r3),256(%r4) 304 mvc 256(256,%r3),256(%r4)
305 mvc 512(256,%r3),512(%r4) 305 mvc 512(256,%r3),512(%r4)
306 mvc 768(122,%r3),768(%r4) 306 mvc 768(122,%r3),768(%r4)
307 slr %r0,%r0 307 slr %r0,%r0
308 b .Lcntlp 308 b .Lcntlp
309.Ldelspc: 309.Ldelspc:
310 ic %r0,0(%r2,%r3) 310 ic %r0,0(%r2,%r3)
311 chi %r0,0x20 # is it a space ? 311 chi %r0,0x20 # is it a space ?
312 be .Lcntlp 312 be .Lcntlp
313 ahi %r2,1 313 ahi %r2,1
314 b .Leolp 314 b .Leolp
315.Lcntlp: 315.Lcntlp:
316 brct %r2,.Ldelspc 316 brct %r2,.Ldelspc
317.Leolp: 317.Leolp:
318 slr %r0,%r0 318 slr %r0,%r0
319 stc %r0,0(%r2,%r3) # terminate buffer 319 stc %r0,0(%r2,%r3) # terminate buffer
320.Lnopf: 320.Lnopf:
321 321
322# 322#
323# load ramdisk from ipl device 323# load ramdisk from ipl device
324# 324#
325.Lagain2: 325.Lagain2:
326 l %r2,.Linitrd # addr of ramdisk 326 l %r2,.Linitrd # addr of ramdisk
327 st %r2,INITRD_START+ARCH_OFFSET-PARMAREA(%r12) 327 st %r2,INITRD_START+ARCH_OFFSET-PARMAREA(%r12)
328 bas %r14,.Lloader # load ramdisk 328 bas %r14,.Lloader # load ramdisk
329 st %r2,INITRD_SIZE+ARCH_OFFSET-PARMAREA(%r12) # store size of ramdisk 329 st %r2,INITRD_SIZE+ARCH_OFFSET-PARMAREA(%r12) # store size of rd
330 ltr %r2,%r2 330 ltr %r2,%r2
331 bnz .Lrdcont 331 bnz .Lrdcont
332 st %r2,INITRD_START+ARCH_OFFSET-PARMAREA(%r12) # no ramdisk found 332 st %r2,INITRD_START+ARCH_OFFSET-PARMAREA(%r12) # no ramdisk found
333.Lrdcont: 333.Lrdcont:
334 l %r2,.Linitrd 334 l %r2,.Linitrd
335 335
336 clc 0(3,%r2),.L_hdr # skip HDRx and EOFx 336 clc 0(3,%r2),.L_hdr # skip HDRx and EOFx
337 bz .Lagain2 337 bz .Lagain2
338 clc 0(3,%r2),.L_eof 338 clc 0(3,%r2),.L_eof
339 bz .Lagain2 339 bz .Lagain2
340 340
341#ifdef CONFIG_IPL_VM 341#ifdef CONFIG_IPL_VM
342# 342#
343# reset files in VM reader 343# reset files in VM reader
344# 344#
345 stidp __LC_CPUID # store cpuid 345 stidp __LC_CPUID # store cpuid
346 tm __LC_CPUID,0xff # running VM ? 346 tm __LC_CPUID,0xff # running VM ?
347 bno .Lnoreset 347 bno .Lnoreset
348 la %r2,.Lreset 348 la %r2,.Lreset
349 lhi %r3,26 349 lhi %r3,26
350 diag %r2,%r3,8 350 diag %r2,%r3,8
351 la %r5,.Lirb 351 la %r5,.Lirb
352 stsch 0(%r5) # check if irq is pending 352 stsch 0(%r5) # check if irq is pending
353 tm 30(%r5),0x0f # by verifying if any of the 353 tm 30(%r5),0x0f # by verifying if any of the
354 bnz .Lwaitforirq # activity or status control 354 bnz .Lwaitforirq # activity or status control
355 tm 31(%r5),0xff # bits is set in the schib 355 tm 31(%r5),0xff # bits is set in the schib
356 bz .Lnoreset 356 bz .Lnoreset
357.Lwaitforirq: 357.Lwaitforirq:
358 mvc 0x78(8),.Lrdrnewpsw # set up IO interrupt psw 358 mvc 0x78(8),.Lrdrnewpsw # set up IO interrupt psw
359.Lwaitrdrirq: 359.Lwaitrdrirq:
360 lpsw .Lrdrwaitpsw 360 lpsw .Lrdrwaitpsw
361.Lrdrint: 361.Lrdrint:
362 c %r1,0xb8 # compare subchannel number 362 c %r1,0xb8 # compare subchannel number
363 bne .Lwaitrdrirq 363 bne .Lwaitrdrirq
364 la %r5,.Lirb 364 la %r5,.Lirb
365 tsch 0(%r5) 365 tsch 0(%r5)
366.Lnoreset: 366.Lnoreset:
367 b .Lnoload 367 b .Lnoload
368 368
369 .align 8 369 .align 8
370.Lrdrnewpsw: 370.Lrdrnewpsw:
371 .long 0x00080000,0x80000000+.Lrdrint 371 .long 0x00080000,0x80000000+.Lrdrint
372.Lrdrwaitpsw: 372.Lrdrwaitpsw:
373 .long 0x020a0000,0x80000000+.Lrdrint 373 .long 0x020a0000,0x80000000+.Lrdrint
374#endif 374#endif
375 375
376# 376#
377# everything loaded, go for it 377# everything loaded, go for it
378# 378#
379.Lnoload: 379.Lnoload:
380 l %r1,.Lstartup 380 l %r1,.Lstartup
381 br %r1 381 br %r1
382 382
383.Linitrd:.long _end + 0x400000 # default address of initrd 383.Linitrd:.long _end + 0x400000 # default address of initrd
384.Lparm: .long PARMAREA 384.Lparm: .long PARMAREA
385.Lstartup: .long startup 385.Lstartup: .long startup
386.Lcvtab:.long _ebcasc # ebcdic to ascii table 386.Lcvtab:.long _ebcasc # ebcdic to ascii table
387.Lreset:.byte 0xc3,0xc8,0xc1,0xd5,0xc7,0xc5,0x40,0xd9,0xc4,0xd9,0x40 387.Lreset:.byte 0xc3,0xc8,0xc1,0xd5,0xc7,0xc5,0x40,0xd9,0xc4,0xd9,0x40
388 .byte 0xc1,0xd3,0xd3,0x40,0xd2,0xc5,0xc5,0xd7,0x40,0xd5,0xd6 388 .byte 0xc1,0xd3,0xd3,0x40,0xd2,0xc5,0xc5,0xd7,0x40,0xd5,0xd6
389 .byte 0xc8,0xd6,0xd3,0xc4 # "change rdr all keep nohold" 389 .byte 0xc8,0xd6,0xd3,0xc4 # "change rdr all keep nohold"
390.L_eof: .long 0xc5d6c600 /* C'EOF' */ 390.L_eof: .long 0xc5d6c600 /* C'EOF' */
391.L_hdr: .long 0xc8c4d900 /* C'HDR' */ 391.L_hdr: .long 0xc8c4d900 /* C'HDR' */
392 392
393#endif /* CONFIG_IPL */ 393#endif /* CONFIG_IPL */
394 394
395# 395#
396# SALIPL loader support. Based on a patch by Rob van der Heij. 396# SALIPL loader support. Based on a patch by Rob van der Heij.
397# This entry point is called directly from the SALIPL loader and 397# This entry point is called directly from the SALIPL loader and
398# doesn't need a builtin ipl record. 398# doesn't need a builtin ipl record.
399# 399#
400 .org 0x800 400 .org 0x800
401 .globl start 401 .globl start
402start: 402start:
403 stm %r0,%r15,0x07b0 # store registers 403 stm %r0,%r15,0x07b0 # store registers
404 basr %r12,%r0 404 basr %r12,%r0
405.base: 405.base:
406 l %r11,.parm 406 l %r11,.parm
407 l %r8,.cmd # pointer to command buffer 407 l %r8,.cmd # pointer to command buffer
408 408
409 ltr %r9,%r9 # do we have SALIPL parameters? 409 ltr %r9,%r9 # do we have SALIPL parameters?
410 bp .sk8x8 410 bp .sk8x8
411 411
412 mvc 0(64,%r8),0x00b0 # copy saved registers 412 mvc 0(64,%r8),0x00b0 # copy saved registers
413 xc 64(240-64,%r8),0(%r8) # remainder of buffer 413 xc 64(240-64,%r8),0(%r8) # remainder of buffer
414 tr 0(64,%r8),.lowcase 414 tr 0(64,%r8),.lowcase
415 b .gotr 415 b .gotr
416.sk8x8: 416.sk8x8:
417 mvc 0(240,%r8),0(%r9) # copy iplparms into buffer 417 mvc 0(240,%r8),0(%r9) # copy iplparms into buffer
418.gotr: 418.gotr:
419 l %r10,.tbl # EBCDIC to ASCII table 419 l %r10,.tbl # EBCDIC to ASCII table
420 tr 0(240,%r8),0(%r10) 420 tr 0(240,%r8),0(%r10)
421 stidp __LC_CPUID # Are we running on VM maybe 421 stidp __LC_CPUID # Are we running on VM maybe
422 cli __LC_CPUID,0xff 422 cli __LC_CPUID,0xff
423 bnz .test 423 bnz .test
424 .long 0x83300060 # diag 3,0,x'0060' - storage size 424 .long 0x83300060 # diag 3,0,x'0060' - storage size
425 b .done 425 b .done
426.test: 426.test:
427 mvc 0x68(8),.pgmnw # set up pgm check handler 427 mvc 0x68(8),.pgmnw # set up pgm check handler
428 l %r2,.fourmeg 428 l %r2,.fourmeg
429 lr %r3,%r2 429 lr %r3,%r2
430 bctr %r3,%r0 # 4M-1 430 bctr %r3,%r0 # 4M-1
431.loop: iske %r0,%r3 431.loop: iske %r0,%r3
432 ar %r3,%r2 432 ar %r3,%r2
433.pgmx: 433.pgmx:
434 sr %r3,%r2 434 sr %r3,%r2
435 la %r3,1(%r3) 435 la %r3,1(%r3)
436.done: 436.done:
437 l %r1,.memsize 437 l %r1,.memsize
438 st %r3,ARCH_OFFSET(%r1) 438 st %r3,ARCH_OFFSET(%r1)
439 slr %r0,%r0 439 slr %r0,%r0
440 st %r0,INITRD_SIZE+ARCH_OFFSET-PARMAREA(%r11) 440 st %r0,INITRD_SIZE+ARCH_OFFSET-PARMAREA(%r11)
441 st %r0,INITRD_START+ARCH_OFFSET-PARMAREA(%r11) 441 st %r0,INITRD_START+ARCH_OFFSET-PARMAREA(%r11)
442 j startup # continue with startup 442 j startup # continue with startup
443.tbl: .long _ebcasc # translate table 443.tbl: .long _ebcasc # translate table
444.cmd: .long COMMAND_LINE # address of command line buffer 444.cmd: .long COMMAND_LINE # address of command line buffer
445.parm: .long PARMAREA 445.parm: .long PARMAREA
446.memsize: .long memory_size 446.memsize: .long memory_size
447.fourmeg: .long 0x00400000 # 4M 447.fourmeg: .long 0x00400000 # 4M
448.pgmnw: .long 0x00080000,.pgmx 448.pgmnw: .long 0x00080000,.pgmx
449.lowcase: 449.lowcase:
450 .byte 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07 450 .byte 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07
451 .byte 0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f 451 .byte 0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f
452 .byte 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17 452 .byte 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17
453 .byte 0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f 453 .byte 0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f
454 .byte 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27 454 .byte 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27
455 .byte 0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f 455 .byte 0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f
456 .byte 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37 456 .byte 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37
457 .byte 0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f 457 .byte 0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f
458 .byte 0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47 458 .byte 0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47
459 .byte 0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f 459 .byte 0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f
460 .byte 0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57 460 .byte 0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57
461 .byte 0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f 461 .byte 0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f
462 .byte 0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67 462 .byte 0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67
463 .byte 0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f 463 .byte 0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f
464 .byte 0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77 464 .byte 0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77
465 .byte 0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f 465 .byte 0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f
466 466
467 .byte 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87 467 .byte 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87
468 .byte 0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f 468 .byte 0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f
469 .byte 0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97 469 .byte 0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97
470 .byte 0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f 470 .byte 0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f
471 .byte 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7 471 .byte 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7
472 .byte 0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf 472 .byte 0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf
473 .byte 0xb0,0xb1,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7 473 .byte 0xb0,0xb1,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7
474 .byte 0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf 474 .byte 0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf
475 .byte 0xc0,0x81,0x82,0x83,0x84,0x85,0x86,0x87 # .abcdefg 475 .byte 0xc0,0x81,0x82,0x83,0x84,0x85,0x86,0x87 # .abcdefg
476 .byte 0x88,0x89,0xca,0xcb,0xcc,0xcd,0xce,0xcf # hi 476 .byte 0x88,0x89,0xca,0xcb,0xcc,0xcd,0xce,0xcf # hi
477 .byte 0xd0,0x91,0x92,0x93,0x94,0x95,0x96,0x97 # .jklmnop 477 .byte 0xd0,0x91,0x92,0x93,0x94,0x95,0x96,0x97 # .jklmnop
478 .byte 0x98,0x99,0xda,0xdb,0xdc,0xdd,0xde,0xdf # qr 478 .byte 0x98,0x99,0xda,0xdb,0xdc,0xdd,0xde,0xdf # qr
479 .byte 0xe0,0xe1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7 # ..stuvwx 479 .byte 0xe0,0xe1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7 # ..stuvwx
480 .byte 0xa8,0xa9,0xea,0xeb,0xec,0xed,0xee,0xef # yz 480 .byte 0xa8,0xa9,0xea,0xeb,0xec,0xed,0xee,0xef # yz
481 .byte 0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7 481 .byte 0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7
482 .byte 0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff 482 .byte 0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff
483 483
484#ifdef CONFIG_64BIT 484#ifdef CONFIG_64BIT
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S
index a8bdd96494c7..48998d50b00a 100644
--- a/arch/s390/kernel/head64.S
+++ b/arch/s390/kernel/head64.S
@@ -15,232 +15,232 @@
15# this is called either by the ipl loader or directly by PSW restart 15# this is called either by the ipl loader or directly by PSW restart
16# or linload or SALIPL 16# or linload or SALIPL
17# 17#
18 .org 0x10000 18 .org 0x10000
19startup:basr %r13,0 # get base 19startup:basr %r13,0 # get base
20.LPG0: l %r13,0f-.LPG0(%r13) 20.LPG0: l %r13,0f-.LPG0(%r13)
21 b 0(%r13) 21 b 0(%r13)
220: .long startup_continue 220: .long startup_continue
23 23
24# 24#
25# params at 10400 (setup.h) 25# params at 10400 (setup.h)
26# 26#
27 .org PARMAREA 27 .org PARMAREA
28 .quad 0 # IPL_DEVICE 28 .quad 0 # IPL_DEVICE
29 .quad 0 # INITRD_START 29 .quad 0 # INITRD_START
30 .quad 0 # INITRD_SIZE 30 .quad 0 # INITRD_SIZE
31 31
32 .org COMMAND_LINE 32 .org COMMAND_LINE
33 .byte "root=/dev/ram0 ro" 33 .byte "root=/dev/ram0 ro"
34 .byte 0 34 .byte 0
35 35
36 .org 0x11000 36 .org 0x11000
37 37
38startup_continue: 38startup_continue:
39 basr %r13,0 # get base 39 basr %r13,0 # get base
40.LPG1: sll %r13,1 # remove high order bit 40.LPG1: sll %r13,1 # remove high order bit
41 srl %r13,1 41 srl %r13,1
42 lhi %r1,1 # mode 1 = esame 42 lhi %r1,1 # mode 1 = esame
43 mvi __LC_AR_MODE_ID,1 # set esame flag 43 mvi __LC_AR_MODE_ID,1 # set esame flag
44 slr %r0,%r0 # set cpuid to zero 44 slr %r0,%r0 # set cpuid to zero
45 sigp %r1,%r0,0x12 # switch to esame mode 45 sigp %r1,%r0,0x12 # switch to esame mode
46 sam64 # switch to 64 bit mode 46 sam64 # switch to 64 bit mode
47 lctlg %c0,%c15,.Lctl-.LPG1(%r13) # load control registers 47 lctlg %c0,%c15,.Lctl-.LPG1(%r13) # load control registers
48 lg %r12,.Lparmaddr-.LPG1(%r13)# pointer to parameter area 48 lg %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area
49 # move IPL device to lowcore 49 # move IPL device to lowcore
50 mvc __LC_IPLDEV(4),IPL_DEVICE+4-PARMAREA(%r12) 50 mvc __LC_IPLDEV(4),IPL_DEVICE+4-PARMAREA(%r12)
51# 51#
52# Setup stack 52# Setup stack
53# 53#
54 larl %r15,init_thread_union 54 larl %r15,init_thread_union
55 lg %r14,__TI_task(%r15) # cache current in lowcore 55 lg %r14,__TI_task(%r15) # cache current in lowcore
56 stg %r14,__LC_CURRENT 56 stg %r14,__LC_CURRENT
57 aghi %r15,1<<(PAGE_SHIFT+THREAD_ORDER) # init_task_union + THREAD_SIZE 57 aghi %r15,1<<(PAGE_SHIFT+THREAD_ORDER) # init_task_union + THREAD_SIZE
58 stg %r15,__LC_KERNEL_STACK # set end of kernel stack 58 stg %r15,__LC_KERNEL_STACK # set end of kernel stack
59 aghi %r15,-160 59 aghi %r15,-160
60 xc __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15) # clear backchain 60 xc __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15) # clear backchain
61 61
62 brasl %r14,ipl_save_parameters 62 brasl %r14,ipl_save_parameters
63# 63#
64# clear bss memory 64# clear bss memory
65# 65#
66 larl %r2,__bss_start # start of bss segment 66 larl %r2,__bss_start # start of bss segment
67 larl %r3,_end # end of bss segment 67 larl %r3,_end # end of bss segment
68 sgr %r3,%r2 # length of bss 68 sgr %r3,%r2 # length of bss
69 sgr %r4,%r4 # 69 sgr %r4,%r4 #
70 sgr %r5,%r5 # set src,length and pad to zero 70 sgr %r5,%r5 # set src,length and pad to zero
71 mvcle %r2,%r4,0 # clear mem 71 mvcle %r2,%r4,0 # clear mem
72 jo .-4 # branch back, if not finish 72 jo .-4 # branch back, if not finish
73 73
74 l %r2,.Lrcp-.LPG1(%r13) # Read SCP forced command word 74 l %r2,.Lrcp-.LPG1(%r13) # Read SCP forced command word
75.Lservicecall: 75.Lservicecall:
76 stosm .Lpmask-.LPG1(%r13),0x01 # authorize ext interrupts 76 stosm .Lpmask-.LPG1(%r13),0x01 # authorize ext interrupts
77 77
78 stctg %r0,%r0,.Lcr-.LPG1(%r13) # get cr0 78 stctg %r0,%r0,.Lcr-.LPG1(%r13) # get cr0
79 la %r1,0x200 # set bit 22 79 la %r1,0x200 # set bit 22
80 og %r1,.Lcr-.LPG1(%r13) # or old cr0 with r1 80 og %r1,.Lcr-.LPG1(%r13) # or old cr0 with r1
81 stg %r1,.Lcr-.LPG1(%r13) 81 stg %r1,.Lcr-.LPG1(%r13)
82 lctlg %r0,%r0,.Lcr-.LPG1(%r13) # load modified cr0 82 lctlg %r0,%r0,.Lcr-.LPG1(%r13) # load modified cr0
83 83
84 mvc __LC_EXT_NEW_PSW(8),.Lpcmsk-.LPG1(%r13) # set postcall psw 84 mvc __LC_EXT_NEW_PSW(8),.Lpcmsk-.LPG1(%r13) # set postcall psw
85 larl %r1,.Lsclph 85 larl %r1,.Lsclph
86 stg %r1,__LC_EXT_NEW_PSW+8 # set handler 86 stg %r1,__LC_EXT_NEW_PSW+8 # set handler
87 87
88 larl %r4,.Lsccb # %r4 is our index for sccb stuff 88 larl %r4,.Lsccb # %r4 is our index for sccb stuff
89 lgr %r1,%r4 # our sccb 89 lgr %r1,%r4 # our sccb
90 .insn rre,0xb2200000,%r2,%r1 # service call 90 .insn rre,0xb2200000,%r2,%r1 # service call
91 ipm %r1 91 ipm %r1
92 srl %r1,28 # get cc code 92 srl %r1,28 # get cc code
93 xr %r3,%r3 93 xr %r3,%r3
94 chi %r1,3 94 chi %r1,3
95 be .Lfchunk-.LPG1(%r13) # leave 95 be .Lfchunk-.LPG1(%r13) # leave
96 chi %r1,2 96 chi %r1,2
97 be .Lservicecall-.LPG1(%r13) 97 be .Lservicecall-.LPG1(%r13)
98 lpswe .Lwaitsclp-.LPG1(%r13) 98 lpswe .Lwaitsclp-.LPG1(%r13)
99.Lsclph: 99.Lsclph:
100 lh %r1,.Lsccbr-.Lsccb(%r4) 100 lh %r1,.Lsccbr-.Lsccb(%r4)
101 chi %r1,0x10 # 0x0010 is the sucess code 101 chi %r1,0x10 # 0x0010 is the sucess code
102 je .Lprocsccb # let's process the sccb 102 je .Lprocsccb # let's process the sccb
103 chi %r1,0x1f0 103 chi %r1,0x1f0
104 bne .Lfchunk-.LPG1(%r13) # unhandled error code 104 bne .Lfchunk-.LPG1(%r13) # unhandled error code
105 c %r2,.Lrcp-.LPG1(%r13) # Did we try Read SCP forced 105 c %r2,.Lrcp-.LPG1(%r13) # Did we try Read SCP forced
106 bne .Lfchunk-.LPG1(%r13) # if no, give up 106 bne .Lfchunk-.LPG1(%r13) # if no, give up
107 l %r2,.Lrcp2-.LPG1(%r13) # try with Read SCP 107 l %r2,.Lrcp2-.LPG1(%r13) # try with Read SCP
108 b .Lservicecall-.LPG1(%r13) 108 b .Lservicecall-.LPG1(%r13)
109.Lprocsccb: 109.Lprocsccb:
110 lghi %r1,0 110 lghi %r1,0
111 icm %r1,3,.Lscpincr1-.Lsccb(%r4) # use this one if != 0 111 icm %r1,3,.Lscpincr1-.Lsccb(%r4) # use this one if != 0
112 jnz .Lscnd 112 jnz .Lscnd
113 lg %r1,.Lscpincr2-.Lsccb(%r4) # otherwise use this one 113 lg %r1,.Lscpincr2-.Lsccb(%r4) # otherwise use this one
114.Lscnd: 114.Lscnd:
115 xr %r3,%r3 # same logic 115 xr %r3,%r3 # same logic
116 ic %r3,.Lscpa1-.Lsccb(%r4) 116 ic %r3,.Lscpa1-.Lsccb(%r4)
117 chi %r3,0x00 117 chi %r3,0x00
118 jne .Lcompmem 118 jne .Lcompmem
119 l %r3,.Lscpa2-.Lsccb(%r4) 119 l %r3,.Lscpa2-.Lsccb(%r4)
120.Lcompmem: 120.Lcompmem:
121 mlgr %r2,%r1 # mem in MB on 128-bit 121 mlgr %r2,%r1 # mem in MB on 128-bit
122 l %r1,.Lonemb-.LPG1(%r13) 122 l %r1,.Lonemb-.LPG1(%r13)
123 mlgr %r2,%r1 # mem size in bytes in %r3 123 mlgr %r2,%r1 # mem size in bytes in %r3
124 b .Lfchunk-.LPG1(%r13) 124 b .Lfchunk-.LPG1(%r13)
125 125
126 .align 4 126 .align 4
127.Lpmask: 127.Lpmask:
128 .byte 0 128 .byte 0
129 .align 8 129 .align 8
130.Lcr: 130.Lcr:
131 .quad 0x00 # place holder for cr0 131 .quad 0x00 # place holder for cr0
132.Lwaitsclp: 132.Lwaitsclp:
133 .quad 0x0102000180000000,.Lsclph 133 .quad 0x0102000180000000,.Lsclph
134.Lrcp: 134.Lrcp:
135 .int 0x00120001 # Read SCP forced code 135 .int 0x00120001 # Read SCP forced code
136.Lrcp2: 136.Lrcp2:
137 .int 0x00020001 # Read SCP code 137 .int 0x00020001 # Read SCP code
138.Lonemb: 138.Lonemb:
139 .int 0x100000 139 .int 0x100000
140 140
141.Lfchunk: 141.Lfchunk:
142 # set program check new psw mask 142 # set program check new psw mask
143 mvc __LC_PGM_NEW_PSW(8),.Lpcmsk-.LPG1(%r13) 143 mvc __LC_PGM_NEW_PSW(8),.Lpcmsk-.LPG1(%r13)
144 144
145# 145#
146# find memory chunks. 146# find memory chunks.
147# 147#
148 lgr %r9,%r3 # end of mem 148 lgr %r9,%r3 # end of mem
149 larl %r1,.Lchkmem # set program check address 149 larl %r1,.Lchkmem # set program check address
150 stg %r1,__LC_PGM_NEW_PSW+8 150 stg %r1,__LC_PGM_NEW_PSW+8
151 la %r1,1 # test in increments of 128KB 151 la %r1,1 # test in increments of 128KB
152 sllg %r1,%r1,17 152 sllg %r1,%r1,17
153 larl %r3,memory_chunk 153 larl %r3,memory_chunk
154 slgr %r4,%r4 # set start of chunk to zero 154 slgr %r4,%r4 # set start of chunk to zero
155 slgr %r5,%r5 # set end of chunk to zero 155 slgr %r5,%r5 # set end of chunk to zero
156 slr %r6,%r6 # set access code to zero 156 slr %r6,%r6 # set access code to zero
157 la %r10,MEMORY_CHUNKS # number of chunks 157 la %r10,MEMORY_CHUNKS # number of chunks
158.Lloop: 158.Lloop:
159 tprot 0(%r5),0 # test protection of first byte 159 tprot 0(%r5),0 # test protection of first byte
160 ipm %r7 160 ipm %r7
161 srl %r7,28 161 srl %r7,28
162 clr %r6,%r7 # compare cc with last access code 162 clr %r6,%r7 # compare cc with last access code
163 je .Lsame 163 je .Lsame
164 j .Lchkmem 164 j .Lchkmem
165.Lsame: 165.Lsame:
166 algr %r5,%r1 # add 128KB to end of chunk 166 algr %r5,%r1 # add 128KB to end of chunk
167 # no need to check here, 167 # no need to check here,
168 brc 12,.Lloop # this is the same chunk 168 brc 12,.Lloop # this is the same chunk
169.Lchkmem: # > 16EB or tprot got a program check 169.Lchkmem: # > 16EB or tprot got a program check
170 clgr %r4,%r5 # chunk size > 0? 170 clgr %r4,%r5 # chunk size > 0?
171 je .Lchkloop 171 je .Lchkloop
172 stg %r4,0(%r3) # store start address of chunk 172 stg %r4,0(%r3) # store start address of chunk
173 lgr %r0,%r5 173 lgr %r0,%r5
174 slgr %r0,%r4 174 slgr %r0,%r4
175 stg %r0,8(%r3) # store size of chunk 175 stg %r0,8(%r3) # store size of chunk
176 st %r6,20(%r3) # store type of chunk 176 st %r6,20(%r3) # store type of chunk
177 la %r3,24(%r3) 177 la %r3,24(%r3)
178 larl %r8,memory_size 178 larl %r8,memory_size
179 stg %r5,0(%r8) # store memory size 179 stg %r5,0(%r8) # store memory size
180 ahi %r10,-1 # update chunk number 180 ahi %r10,-1 # update chunk number
181.Lchkloop: 181.Lchkloop:
182 lr %r6,%r7 # set access code to last cc 182 lr %r6,%r7 # set access code to last cc
183 # we got an exception or we're starting a new 183 # we got an exception or we're starting a new
184 # chunk , we must check if we should 184 # chunk , we must check if we should
185 # still try to find valid memory (if we detected 185 # still try to find valid memory (if we detected
186 # the amount of available storage), and if we 186 # the amount of available storage), and if we
187 # have chunks left 187 # have chunks left
188 lghi %r4,1 188 lghi %r4,1
189 sllg %r4,%r4,31 189 sllg %r4,%r4,31
190 clgr %r5,%r4 190 clgr %r5,%r4
191 je .Lhsaskip 191 je .Lhsaskip
192 xr %r0, %r0 192 xr %r0, %r0
193 clgr %r0, %r9 # did we detect memory? 193 clgr %r0, %r9 # did we detect memory?
194 je .Ldonemem # if not, leave 194 je .Ldonemem # if not, leave
195 chi %r10, 0 # do we have chunks left? 195 chi %r10, 0 # do we have chunks left?
196 je .Ldonemem 196 je .Ldonemem
197.Lhsaskip: 197.Lhsaskip:
198 algr %r5,%r1 # add 128KB to end of chunk 198 algr %r5,%r1 # add 128KB to end of chunk
199 lgr %r4,%r5 # potential new chunk 199 lgr %r4,%r5 # potential new chunk
200 clgr %r5,%r9 # should we go on? 200 clgr %r5,%r9 # should we go on?
201 jl .Lloop 201 jl .Lloop
202.Ldonemem: 202.Ldonemem:
203 203
204 larl %r12,machine_flags 204 larl %r12,machine_flags
205# 205#
206# find out if we are running under VM 206# find out if we are running under VM
207# 207#
208 stidp __LC_CPUID # store cpuid 208 stidp __LC_CPUID # store cpuid
209 tm __LC_CPUID,0xff # running under VM ? 209 tm __LC_CPUID,0xff # running under VM ?
210 bno 0f-.LPG1(%r13) 210 bno 0f-.LPG1(%r13)
211 oi 7(%r12),1 # set VM flag 211 oi 7(%r12),1 # set VM flag
2120: lh %r0,__LC_CPUID+4 # get cpu version 2120: lh %r0,__LC_CPUID+4 # get cpu version
213 chi %r0,0x7490 # running on a P/390 ? 213 chi %r0,0x7490 # running on a P/390 ?
214 bne 1f-.LPG1(%r13) 214 bne 1f-.LPG1(%r13)
215 oi 7(%r12),4 # set P/390 flag 215 oi 7(%r12),4 # set P/390 flag
2161: 2161:
217 217
218# 218#
219# find out if we have the MVPG instruction 219# find out if we have the MVPG instruction
220# 220#
221 la %r1,0f-.LPG1(%r13) # set program check address 221 la %r1,0f-.LPG1(%r13) # set program check address
222 stg %r1,__LC_PGM_NEW_PSW+8 222 stg %r1,__LC_PGM_NEW_PSW+8
223 sgr %r0,%r0 223 sgr %r0,%r0
224 lghi %r1,0 224 lghi %r1,0
225 lghi %r2,0 225 lghi %r2,0
226 mvpg %r1,%r2 # test MVPG instruction 226 mvpg %r1,%r2 # test MVPG instruction
227 oi 7(%r12),16 # set MVPG flag 227 oi 7(%r12),16 # set MVPG flag
2280: 2280:
229 229
230# 230#
231# find out if the diag 0x44 works in 64 bit mode 231# find out if the diag 0x44 works in 64 bit mode
232# 232#
233 la %r1,0f-.LPG1(%r13) # set program check address 233 la %r1,0f-.LPG1(%r13) # set program check address
234 stg %r1,__LC_PGM_NEW_PSW+8 234 stg %r1,__LC_PGM_NEW_PSW+8
235 diag 0,0,0x44 # test diag 0x44 235 diag 0,0,0x44 # test diag 0x44
236 oi 7(%r12),32 # set diag44 flag 236 oi 7(%r12),32 # set diag44 flag
2370: 2370:
238 238
239# 239#
240# find out if we have the IDTE instruction 240# find out if we have the IDTE instruction
241# 241#
242 la %r1,0f-.LPG1(%r13) # set program check address 242 la %r1,0f-.LPG1(%r13) # set program check address
243 stg %r1,__LC_PGM_NEW_PSW+8 243 stg %r1,__LC_PGM_NEW_PSW+8
244 .long 0xb2b10000 # store facility list 244 .long 0xb2b10000 # store facility list
245 tm 0xc8,0x08 # check bit for clearing-by-ASCE 245 tm 0xc8,0x08 # check bit for clearing-by-ASCE
246 bno 0f-.LPG1(%r13) 246 bno 0f-.LPG1(%r13)
@@ -263,45 +263,45 @@ startup_continue:
263 oi 6(%r12),2 # set MVCOS flag 263 oi 6(%r12),2 # set MVCOS flag
2641: 2641:
265 265
266 lpswe .Lentry-.LPG1(13) # jump to _stext in primary-space, 266 lpswe .Lentry-.LPG1(13) # jump to _stext in primary-space,
267 # virtual and never return ... 267 # virtual and never return ...
268 .align 16 268 .align 16
269.Lentry:.quad 0x0000000180000000,_stext 269.Lentry:.quad 0x0000000180000000,_stext
270.Lctl: .quad 0x04b50002 # cr0: various things 270.Lctl: .quad 0x04b50002 # cr0: various things
271 .quad 0 # cr1: primary space segment table 271 .quad 0 # cr1: primary space segment table
272 .quad .Lduct # cr2: dispatchable unit control table 272 .quad .Lduct # cr2: dispatchable unit control table
273 .quad 0 # cr3: instruction authorization 273 .quad 0 # cr3: instruction authorization
274 .quad 0 # cr4: instruction authorization 274 .quad 0 # cr4: instruction authorization
275 .quad 0xffffffffffffffff # cr5: primary-aste origin 275 .quad 0xffffffffffffffff # cr5: primary-aste origin
276 .quad 0 # cr6: I/O interrupts 276 .quad 0 # cr6: I/O interrupts
277 .quad 0 # cr7: secondary space segment table 277 .quad 0 # cr7: secondary space segment table
278 .quad 0 # cr8: access registers translation 278 .quad 0 # cr8: access registers translation
279 .quad 0 # cr9: tracing off 279 .quad 0 # cr9: tracing off
280 .quad 0 # cr10: tracing off 280 .quad 0 # cr10: tracing off
281 .quad 0 # cr11: tracing off 281 .quad 0 # cr11: tracing off
282 .quad 0 # cr12: tracing off 282 .quad 0 # cr12: tracing off
283 .quad 0 # cr13: home space segment table 283 .quad 0 # cr13: home space segment table
284 .quad 0xc0000000 # cr14: machine check handling off 284 .quad 0xc0000000 # cr14: machine check handling off
285 .quad 0 # cr15: linkage stack operations 285 .quad 0 # cr15: linkage stack operations
286.Lduct: .long 0,0,0,0,0,0,0,0 286.Lduct: .long 0,0,0,0,0,0,0,0
287 .long 0,0,0,0,0,0,0,0 287 .long 0,0,0,0,0,0,0,0
288.Lpcmsk:.quad 0x0000000180000000 288.Lpcmsk:.quad 0x0000000180000000
289.L4malign:.quad 0xffffffffffc00000 289.L4malign:.quad 0xffffffffffc00000
290.Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8 290.Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8
291.Lnop: .long 0x07000700 291.Lnop: .long 0x07000700
292.Lparmaddr: 292.Lparmaddr:
293 .quad PARMAREA 293 .quad PARMAREA
294 294
295 .globl ipl_schib 295 .globl ipl_schib
296ipl_schib: 296ipl_schib:
297 .rept 13 297 .rept 13
298 .long 0 298 .long 0
299 .endr 299 .endr
300 300
301 .globl ipl_flags 301 .globl ipl_flags
302ipl_flags: 302ipl_flags:
303 .long 0 303 .long 0
304 .globl ipl_devno 304 .globl ipl_devno
305ipl_devno: 305ipl_devno:
306 .word 0 306 .word 0
307 307
@@ -309,47 +309,47 @@ ipl_devno:
309.globl s390_readinfo_sccb 309.globl s390_readinfo_sccb
310s390_readinfo_sccb: 310s390_readinfo_sccb:
311.Lsccb: 311.Lsccb:
312 .hword 0x1000 # length, one page 312 .hword 0x1000 # length, one page
313 .byte 0x00,0x00,0x00 313 .byte 0x00,0x00,0x00
314 .byte 0x80 # variable response bit set 314 .byte 0x80 # variable response bit set
315.Lsccbr: 315.Lsccbr:
316 .hword 0x00 # response code 316 .hword 0x00 # response code
317.Lscpincr1: 317.Lscpincr1:
318 .hword 0x00 318 .hword 0x00
319.Lscpa1: 319.Lscpa1:
320 .byte 0x00 320 .byte 0x00
321 .fill 89,1,0 321 .fill 89,1,0
322.Lscpa2: 322.Lscpa2:
323 .int 0x00 323 .int 0x00
324.Lscpincr2: 324.Lscpincr2:
325 .quad 0x00 325 .quad 0x00
326 .fill 3984,1,0 326 .fill 3984,1,0
327 .org 0x13000 327 .org 0x13000
328 328
329#ifdef CONFIG_SHARED_KERNEL 329#ifdef CONFIG_SHARED_KERNEL
330 .org 0x100000 330 .org 0x100000
331#endif 331#endif
332 332
333# 333#
334# startup-code, running in absolute addressing mode 334# startup-code, running in absolute addressing mode
335# 335#
336 .globl _stext 336 .globl _stext
337_stext: basr %r13,0 # get base 337_stext: basr %r13,0 # get base
338.LPG3: 338.LPG3:
339# check control registers 339# check control registers
340 stctg %c0,%c15,0(%r15) 340 stctg %c0,%c15,0(%r15)
341 oi 6(%r15),0x40 # enable sigp emergency signal 341 oi 6(%r15),0x40 # enable sigp emergency signal
342 oi 4(%r15),0x10 # switch on low address proctection 342 oi 4(%r15),0x10 # switch on low address proctection
343 lctlg %c0,%c15,0(%r15) 343 lctlg %c0,%c15,0(%r15)
344 344
345 lam 0,15,.Laregs-.LPG3(%r13) # load access regs needed by uaccess 345 lam 0,15,.Laregs-.LPG3(%r13) # load acrs needed by uaccess
346 brasl %r14,start_kernel # go to C code 346 brasl %r14,start_kernel # go to C code
347# 347#
348# We returned from start_kernel ?!? PANIK 348# We returned from start_kernel ?!? PANIK
349# 349#
350 basr %r13,0 350 basr %r13,0
351 lpswe .Ldw-.(%r13) # load disabled wait psw 351 lpswe .Ldw-.(%r13) # load disabled wait psw
352 352
353 .align 8 353 .align 8
354.Ldw: .quad 0x0002000180000000,0x0000000000000000 354.Ldw: .quad 0x0002000180000000,0x0000000000000000
355.Laregs: .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 355.Laregs:.long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
diff --git a/arch/s390/kernel/reipl.S b/arch/s390/kernel/reipl.S
index 4562cdbce8eb..0340477f3b08 100644
--- a/arch/s390/kernel/reipl.S
+++ b/arch/s390/kernel/reipl.S
@@ -32,58 +32,58 @@ do_reipl_asm: basr %r13,0
32 st %r13, __LC_PSW_SAVE_AREA+4 32 st %r13, __LC_PSW_SAVE_AREA+4
33 33
34 lctl %c6,%c6,.Lall-.Lpg0(%r13) 34 lctl %c6,%c6,.Lall-.Lpg0(%r13)
35 lr %r1,%r2 35 lr %r1,%r2
36 mvc __LC_PGM_NEW_PSW(8),.Lpcnew-.Lpg0(%r13) 36 mvc __LC_PGM_NEW_PSW(8),.Lpcnew-.Lpg0(%r13)
37 stsch .Lschib-.Lpg0(%r13) 37 stsch .Lschib-.Lpg0(%r13)
38 oi .Lschib+5-.Lpg0(%r13),0x84 38 oi .Lschib+5-.Lpg0(%r13),0x84
39.Lecs: xi .Lschib+27-.Lpg0(%r13),0x01 39.Lecs: xi .Lschib+27-.Lpg0(%r13),0x01
40 msch .Lschib-.Lpg0(%r13) 40 msch .Lschib-.Lpg0(%r13)
41 lhi %r0,5 41 lhi %r0,5
42.Lssch: ssch .Liplorb-.Lpg0(%r13) 42.Lssch: ssch .Liplorb-.Lpg0(%r13)
43 jz .L001 43 jz .L001
44 brct %r0,.Lssch 44 brct %r0,.Lssch
45 bas %r14,.Ldisab-.Lpg0(%r13) 45 bas %r14,.Ldisab-.Lpg0(%r13)
46.L001: mvc __LC_IO_NEW_PSW(8),.Lionew-.Lpg0(%r13) 46.L001: mvc __LC_IO_NEW_PSW(8),.Lionew-.Lpg0(%r13)
47.Ltpi: lpsw .Lwaitpsw-.Lpg0(%r13) 47.Ltpi: lpsw .Lwaitpsw-.Lpg0(%r13)
48.Lcont: c %r1,__LC_SUBCHANNEL_ID 48.Lcont: c %r1,__LC_SUBCHANNEL_ID
49 jnz .Ltpi 49 jnz .Ltpi
50 clc __LC_IO_INT_PARM(4),.Liplorb-.Lpg0(%r13) 50 clc __LC_IO_INT_PARM(4),.Liplorb-.Lpg0(%r13)
51 jnz .Ltpi 51 jnz .Ltpi
52 tsch .Liplirb-.Lpg0(%r13) 52 tsch .Liplirb-.Lpg0(%r13)
53 tm .Liplirb+9-.Lpg0(%r13),0xbf 53 tm .Liplirb+9-.Lpg0(%r13),0xbf
54 jz .L002 54 jz .L002
55 bas %r14,.Ldisab-.Lpg0(%r13) 55 bas %r14,.Ldisab-.Lpg0(%r13)
56.L002: tm .Liplirb+8-.Lpg0(%r13),0xf3 56.L002: tm .Liplirb+8-.Lpg0(%r13),0xf3
57 jz .L003 57 jz .L003
58 bas %r14,.Ldisab-.Lpg0(%r13) 58 bas %r14,.Ldisab-.Lpg0(%r13)
59.L003: spx .Lnull-.Lpg0(%r13) 59.L003: spx .Lnull-.Lpg0(%r13)
60 st %r1,__LC_SUBCHANNEL_ID 60 st %r1,__LC_SUBCHANNEL_ID
61 lpsw 0 61 lpsw 0
62 sigp 0,0,0(6) 62 sigp 0,0,0(6)
63.Ldisab: st %r14,.Ldispsw+4-.Lpg0(%r13) 63.Ldisab: st %r14,.Ldispsw+4-.Lpg0(%r13)
64 lpsw .Ldispsw-.Lpg0(%r13) 64 lpsw .Ldispsw-.Lpg0(%r13)
65 .align 8 65 .align 8
66.Lclkcmp: .quad 0x0000000000000000 66.Lclkcmp: .quad 0x0000000000000000
67.Lall: .long 0xff000000 67.Lall: .long 0xff000000
68.Lnull: .long 0x00000000 68.Lnull: .long 0x00000000
69.Lctlsave1: .long 0x00000000 69.Lctlsave1: .long 0x00000000
70.Lctlsave2: .long 0x00000000 70.Lctlsave2: .long 0x00000000
71 .align 8 71 .align 8
72.Lnewpsw: .long 0x00080000,0x80000000+.Lpg1 72.Lnewpsw: .long 0x00080000,0x80000000+.Lpg1
73.Lpcnew: .long 0x00080000,0x80000000+.Lecs 73.Lpcnew: .long 0x00080000,0x80000000+.Lecs
74.Lionew: .long 0x00080000,0x80000000+.Lcont 74.Lionew: .long 0x00080000,0x80000000+.Lcont
75.Lwaitpsw: .long 0x020a0000,0x00000000+.Ltpi 75.Lwaitpsw: .long 0x020a0000,0x00000000+.Ltpi
76.Ldispsw: .long 0x000a0000,0x00000000 76.Ldispsw: .long 0x000a0000,0x00000000
77.Liplccws: .long 0x02000000,0x60000018 77.Liplccws: .long 0x02000000,0x60000018
78 .long 0x08000008,0x20000001 78 .long 0x08000008,0x20000001
79.Liplorb: .long 0x0049504c,0x0040ff80 79.Liplorb: .long 0x0049504c,0x0040ff80
80 .long 0x00000000+.Liplccws 80 .long 0x00000000+.Liplccws
81.Lschib: .long 0x00000000,0x00000000 81.Lschib: .long 0x00000000,0x00000000
82 .long 0x00000000,0x00000000 82 .long 0x00000000,0x00000000
83 .long 0x00000000,0x00000000 83 .long 0x00000000,0x00000000
84 .long 0x00000000,0x00000000 84 .long 0x00000000,0x00000000
85 .long 0x00000000,0x00000000 85 .long 0x00000000,0x00000000
86 .long 0x00000000,0x00000000 86 .long 0x00000000,0x00000000
87.Liplirb: .long 0x00000000,0x00000000 87.Liplirb: .long 0x00000000,0x00000000
88 .long 0x00000000,0x00000000 88 .long 0x00000000,0x00000000
89 .long 0x00000000,0x00000000 89 .long 0x00000000,0x00000000
@@ -92,6 +92,3 @@ do_reipl_asm: basr %r13,0
92 .long 0x00000000,0x00000000 92 .long 0x00000000,0x00000000
93 .long 0x00000000,0x00000000 93 .long 0x00000000,0x00000000
94 .long 0x00000000,0x00000000 94 .long 0x00000000,0x00000000
95
96
97
diff --git a/arch/s390/kernel/reipl64.S b/arch/s390/kernel/reipl64.S
index 95bd1e234f63..de7435054f7c 100644
--- a/arch/s390/kernel/reipl64.S
+++ b/arch/s390/kernel/reipl64.S
@@ -4,7 +4,7 @@
4 * S390 version 4 * S390 version
5 * Copyright (C) 2000 IBM Deutschland Entwicklung GmbH, IBM Corporation 5 * Copyright (C) 2000 IBM Deutschland Entwicklung GmbH, IBM Corporation
6 * Author(s): Holger Smolinski (Holger.Smolinski@de.ibm.com) 6 * Author(s): Holger Smolinski (Holger.Smolinski@de.ibm.com)
7 Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com) 7 Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
8 */ 8 */
9 9
10#include <asm/lowcore.h> 10#include <asm/lowcore.h>
@@ -32,46 +32,46 @@ do_reipl_asm: basr %r13,0
32 stctg %c0,%c0,.Lregsave-.Lpg0(%r13) 32 stctg %c0,%c0,.Lregsave-.Lpg0(%r13)
33 ni .Lregsave+4-.Lpg0(%r13),0xef 33 ni .Lregsave+4-.Lpg0(%r13),0xef
34 lctlg %c0,%c0,.Lregsave-.Lpg0(%r13) 34 lctlg %c0,%c0,.Lregsave-.Lpg0(%r13)
35 lgr %r1,%r2 35 lgr %r1,%r2
36 mvc __LC_PGM_NEW_PSW(16),.Lpcnew-.Lpg0(%r13) 36 mvc __LC_PGM_NEW_PSW(16),.Lpcnew-.Lpg0(%r13)
37 stsch .Lschib-.Lpg0(%r13) 37 stsch .Lschib-.Lpg0(%r13)
38 oi .Lschib+5-.Lpg0(%r13),0x84 38 oi .Lschib+5-.Lpg0(%r13),0x84
39.Lecs: xi .Lschib+27-.Lpg0(%r13),0x01 39.Lecs: xi .Lschib+27-.Lpg0(%r13),0x01
40 msch .Lschib-.Lpg0(%r13) 40 msch .Lschib-.Lpg0(%r13)
41 lghi %r0,5 41 lghi %r0,5
42.Lssch: ssch .Liplorb-.Lpg0(%r13) 42.Lssch: ssch .Liplorb-.Lpg0(%r13)
43 jz .L001 43 jz .L001
44 brct %r0,.Lssch 44 brct %r0,.Lssch
45 bas %r14,.Ldisab-.Lpg0(%r13) 45 bas %r14,.Ldisab-.Lpg0(%r13)
46.L001: mvc __LC_IO_NEW_PSW(16),.Lionew-.Lpg0(%r13) 46.L001: mvc __LC_IO_NEW_PSW(16),.Lionew-.Lpg0(%r13)
47.Ltpi: lpswe .Lwaitpsw-.Lpg0(%r13) 47.Ltpi: lpswe .Lwaitpsw-.Lpg0(%r13)
48.Lcont: c %r1,__LC_SUBCHANNEL_ID 48.Lcont: c %r1,__LC_SUBCHANNEL_ID
49 jnz .Ltpi 49 jnz .Ltpi
50 clc __LC_IO_INT_PARM(4),.Liplorb-.Lpg0(%r13) 50 clc __LC_IO_INT_PARM(4),.Liplorb-.Lpg0(%r13)
51 jnz .Ltpi 51 jnz .Ltpi
52 tsch .Liplirb-.Lpg0(%r13) 52 tsch .Liplirb-.Lpg0(%r13)
53 tm .Liplirb+9-.Lpg0(%r13),0xbf 53 tm .Liplirb+9-.Lpg0(%r13),0xbf
54 jz .L002 54 jz .L002
55 bas %r14,.Ldisab-.Lpg0(%r13) 55 bas %r14,.Ldisab-.Lpg0(%r13)
56.L002: tm .Liplirb+8-.Lpg0(%r13),0xf3 56.L002: tm .Liplirb+8-.Lpg0(%r13),0xf3
57 jz .L003 57 jz .L003
58 bas %r14,.Ldisab-.Lpg0(%r13) 58 bas %r14,.Ldisab-.Lpg0(%r13)
59.L003: spx .Lnull-.Lpg0(%r13) 59.L003: spx .Lnull-.Lpg0(%r13)
60 st %r1,__LC_SUBCHANNEL_ID 60 st %r1,__LC_SUBCHANNEL_ID
61 lhi %r1,0 # mode 0 = esa 61 lhi %r1,0 # mode 0 = esa
62 slr %r0,%r0 # set cpuid to zero 62 slr %r0,%r0 # set cpuid to zero
63 sigp %r1,%r0,0x12 # switch to esa mode 63 sigp %r1,%r0,0x12 # switch to esa mode
64 lpsw 0 64 lpsw 0
65.Ldisab: sll %r14,1 65.Ldisab: sll %r14,1
66 srl %r14,1 # need to kill hi bit to avoid specification exceptions. 66 srl %r14,1 # need to kill hi bit to avoid specification exceptions.
67 st %r14,.Ldispsw+12-.Lpg0(%r13) 67 st %r14,.Ldispsw+12-.Lpg0(%r13)
68 lpswe .Ldispsw-.Lpg0(%r13) 68 lpswe .Ldispsw-.Lpg0(%r13)
69 .align 8 69 .align 8
70.Lclkcmp: .quad 0x0000000000000000 70.Lclkcmp: .quad 0x0000000000000000
71.Lall: .quad 0x00000000ff000000 71.Lall: .quad 0x00000000ff000000
72.Lregsave: .quad 0x0000000000000000 72.Lregsave: .quad 0x0000000000000000
73.Lnull: .long 0x0000000000000000 73.Lnull: .long 0x0000000000000000
74 .align 16 74 .align 16
75/* 75/*
76 * These addresses have to be 31 bit otherwise 76 * These addresses have to be 31 bit otherwise
77 * the sigp will throw a specifcation exception 77 * the sigp will throw a specifcation exception
@@ -81,26 +81,26 @@ do_reipl_asm: basr %r13,0
81 * 31bit lpswe instruction a fact they appear to have 81 * 31bit lpswe instruction a fact they appear to have
82 * ommited from the pop. 82 * ommited from the pop.
83 */ 83 */
84.Lnewpsw: .quad 0x0000000080000000 84.Lnewpsw: .quad 0x0000000080000000
85 .quad .Lpg1 85 .quad .Lpg1
86.Lpcnew: .quad 0x0000000080000000 86.Lpcnew: .quad 0x0000000080000000
87 .quad .Lecs 87 .quad .Lecs
88.Lionew: .quad 0x0000000080000000 88.Lionew: .quad 0x0000000080000000
89 .quad .Lcont 89 .quad .Lcont
90.Lwaitpsw: .quad 0x0202000080000000 90.Lwaitpsw: .quad 0x0202000080000000
91 .quad .Ltpi 91 .quad .Ltpi
92.Ldispsw: .quad 0x0002000080000000 92.Ldispsw: .quad 0x0002000080000000
93 .quad 0x0000000000000000 93 .quad 0x0000000000000000
94.Liplccws: .long 0x02000000,0x60000018 94.Liplccws: .long 0x02000000,0x60000018
95 .long 0x08000008,0x20000001 95 .long 0x08000008,0x20000001
96.Liplorb: .long 0x0049504c,0x0040ff80 96.Liplorb: .long 0x0049504c,0x0040ff80
97 .long 0x00000000+.Liplccws 97 .long 0x00000000+.Liplccws
98.Lschib: .long 0x00000000,0x00000000 98.Lschib: .long 0x00000000,0x00000000
99 .long 0x00000000,0x00000000 99 .long 0x00000000,0x00000000
100 .long 0x00000000,0x00000000 100 .long 0x00000000,0x00000000
101 .long 0x00000000,0x00000000 101 .long 0x00000000,0x00000000
102 .long 0x00000000,0x00000000 102 .long 0x00000000,0x00000000
103 .long 0x00000000,0x00000000 103 .long 0x00000000,0x00000000
104.Liplirb: .long 0x00000000,0x00000000 104.Liplirb: .long 0x00000000,0x00000000
105 .long 0x00000000,0x00000000 105 .long 0x00000000,0x00000000
106 .long 0x00000000,0x00000000 106 .long 0x00000000,0x00000000
@@ -109,4 +109,3 @@ do_reipl_asm: basr %r13,0
109 .long 0x00000000,0x00000000 109 .long 0x00000000,0x00000000
110 .long 0x00000000,0x00000000 110 .long 0x00000000,0x00000000
111 .long 0x00000000,0x00000000 111 .long 0x00000000,0x00000000
112
diff --git a/arch/s390/kernel/relocate_kernel.S b/arch/s390/kernel/relocate_kernel.S
index 2a25ec7147ff..f9899ff2e5b0 100644
--- a/arch/s390/kernel/relocate_kernel.S
+++ b/arch/s390/kernel/relocate_kernel.S
@@ -3,7 +3,7 @@
3 * 3 *
4 * (C) Copyright IBM Corp. 2005 4 * (C) Copyright IBM Corp. 2005
5 * 5 *
6 * Author(s): Rolf Adelsberger <adelsberger@de.ibm.com> 6 * Author(s): Rolf Adelsberger,
7 * Heiko Carstens <heiko.carstens@de.ibm.com> 7 * Heiko Carstens <heiko.carstens@de.ibm.com>
8 * 8 *
9 */ 9 */
@@ -24,14 +24,14 @@
24 .text 24 .text
25 .globl relocate_kernel 25 .globl relocate_kernel
26 relocate_kernel: 26 relocate_kernel:
27 basr %r13,0 #base address 27 basr %r13,0 # base address
28 .base: 28 .base:
29 stnsm sys_msk-.base(%r13),0xf8 #disable DAT and IRQ (external) 29 stnsm sys_msk-.base(%r13),0xf8 # disable DAT and IRQ (external)
30 spx zero64-.base(%r13) #absolute addressing mode 30 spx zero64-.base(%r13) # absolute addressing mode
31 stctl %c0,%c15,ctlregs-.base(%r13) 31 stctl %c0,%c15,ctlregs-.base(%r13)
32 stm %r0,%r15,gprregs-.base(%r13) 32 stm %r0,%r15,gprregs-.base(%r13)
33 la %r1,load_psw-.base(%r13) 33 la %r1,load_psw-.base(%r13)
34 mvc 0(8,%r0),0(%r1) 34 mvc 0(8,%r0),0(%r1)
35 la %r0,.back-.base(%r13) 35 la %r0,.back-.base(%r13)
36 st %r0,4(%r0) 36 st %r0,4(%r0)
37 oi 4(%r0),0x80 37 oi 4(%r0),0x80
@@ -51,50 +51,50 @@
51 .back_pgm: 51 .back_pgm:
52 lm %r0,%r15,gprregs-.base(%r13) 52 lm %r0,%r15,gprregs-.base(%r13)
53 .start_reloc: 53 .start_reloc:
54 lhi %r10,-1 #preparing the mask 54 lhi %r10,-1 # preparing the mask
55 sll %r10,12 #shift it such that it becomes 0xf000 55 sll %r10,12 # shift it such that it becomes 0xf000
56 .top: 56 .top:
57 lhi %r7,4096 #load PAGE_SIZE in r7 57 lhi %r7,4096 # load PAGE_SIZE in r7
58 lhi %r9,4096 #load PAGE_SIZE in r9 58 lhi %r9,4096 # load PAGE_SIZE in r9
59 l %r5,0(%r2) #read another word for indirection page 59 l %r5,0(%r2) # read another word for indirection page
60 ahi %r2,4 #increment pointer 60 ahi %r2,4 # increment pointer
61 tml %r5,0x1 #is it a destination page? 61 tml %r5,0x1 # is it a destination page?
62 je .indir_check #NO, goto "indir_check" 62 je .indir_check # NO, goto "indir_check"
63 lr %r6,%r5 #r6 = r5 63 lr %r6,%r5 # r6 = r5
64 nr %r6,%r10 #mask it out and... 64 nr %r6,%r10 # mask it out and...
65 j .top #...next iteration 65 j .top # ...next iteration
66 .indir_check: 66 .indir_check:
67 tml %r5,0x2 #is it a indirection page? 67 tml %r5,0x2 # is it a indirection page?
68 je .done_test #NO, goto "done_test" 68 je .done_test # NO, goto "done_test"
69 nr %r5,%r10 #YES, mask out, 69 nr %r5,%r10 # YES, mask out,
70 lr %r2,%r5 #move it into the right register, 70 lr %r2,%r5 # move it into the right register,
71 j .top #and read next... 71 j .top # and read next...
72 .done_test: 72 .done_test:
73 tml %r5,0x4 #is it the done indicator? 73 tml %r5,0x4 # is it the done indicator?
74 je .source_test #NO! Well, then it should be the source indicator... 74 je .source_test # NO! Well, then it should be the source indicator...
75 j .done #ok, lets finish it here... 75 j .done # ok, lets finish it here...
76 .source_test: 76 .source_test:
77 tml %r5,0x8 #it should be a source indicator... 77 tml %r5,0x8 # it should be a source indicator...
78 je .top #NO, ignore it... 78 je .top # NO, ignore it...
79 lr %r8,%r5 #r8 = r5 79 lr %r8,%r5 # r8 = r5
80 nr %r8,%r10 #masking 80 nr %r8,%r10 # masking
81 0: mvcle %r6,%r8,0x0 #copy PAGE_SIZE bytes from r8 to r6 - pad with 0 81 0: mvcle %r6,%r8,0x0 # copy PAGE_SIZE bytes from r8 to r6 - pad with 0
82 jo 0b 82 jo 0b
83 j .top 83 j .top
84 .done: 84 .done:
85 sr %r0,%r0 #clear register r0 85 sr %r0,%r0 # clear register r0
86 la %r4,load_psw-.base(%r13) #load psw-address into the register 86 la %r4,load_psw-.base(%r13) # load psw-address into the register
87 o %r3,4(%r4) #or load address into psw 87 o %r3,4(%r4) # or load address into psw
88 st %r3,4(%r4) 88 st %r3,4(%r4)
89 mvc 0(8,%r0),0(%r4) #copy psw to absolute address 0 89 mvc 0(8,%r0),0(%r4) # copy psw to absolute address 0
90 tm have_diag308-.base(%r13),0x01 90 tm have_diag308-.base(%r13),0x01
91 jno .no_diag308 91 jno .no_diag308
92 diag %r0,%r0,0x308 92 diag %r0,%r0,0x308
93 .no_diag308: 93 .no_diag308:
94 sr %r1,%r1 #clear %r1 94 sr %r1,%r1 # clear %r1
95 sr %r2,%r2 #clear %r2 95 sr %r2,%r2 # clear %r2
96 sigp %r1,%r2,0x12 #set cpuid to zero 96 sigp %r1,%r2,0x12 # set cpuid to zero
97 lpsw 0 #hopefully start new kernel... 97 lpsw 0 # hopefully start new kernel...
98 98
99 .align 8 99 .align 8
100 zero64: 100 zero64:
diff --git a/arch/s390/kernel/relocate_kernel64.S b/arch/s390/kernel/relocate_kernel64.S
index 8cdb86e8911f..4fb443042d9c 100644
--- a/arch/s390/kernel/relocate_kernel64.S
+++ b/arch/s390/kernel/relocate_kernel64.S
@@ -3,7 +3,7 @@
3 * 3 *
4 * (C) Copyright IBM Corp. 2005 4 * (C) Copyright IBM Corp. 2005
5 * 5 *
6 * Author(s): Rolf Adelsberger <adelsberger@de.ibm.com> 6 * Author(s): Rolf Adelsberger,
7 * Heiko Carstens <heiko.carstens@de.ibm.com> 7 * Heiko Carstens <heiko.carstens@de.ibm.com>
8 * 8 *
9 */ 9 */
@@ -25,10 +25,10 @@
25 .text 25 .text
26 .globl relocate_kernel 26 .globl relocate_kernel
27 relocate_kernel: 27 relocate_kernel:
28 basr %r13,0 #base address 28 basr %r13,0 # base address
29 .base: 29 .base:
30 stnsm sys_msk-.base(%r13),0xf8 #disable DAT and IRQs 30 stnsm sys_msk-.base(%r13),0xf8 # disable DAT and IRQs
31 spx zero64-.base(%r13) #absolute addressing mode 31 spx zero64-.base(%r13) # absolute addressing mode
32 stctg %c0,%c15,ctlregs-.base(%r13) 32 stctg %c0,%c15,ctlregs-.base(%r13)
33 stmg %r0,%r15,gprregs-.base(%r13) 33 stmg %r0,%r15,gprregs-.base(%r13)
34 lghi %r0,3 34 lghi %r0,3
@@ -37,16 +37,16 @@
37 la %r0,.back_pgm-.base(%r13) 37 la %r0,.back_pgm-.base(%r13)
38 stg %r0,0x1d8(%r0) 38 stg %r0,0x1d8(%r0)
39 la %r1,load_psw-.base(%r13) 39 la %r1,load_psw-.base(%r13)
40 mvc 0(8,%r0),0(%r1) 40 mvc 0(8,%r0),0(%r1)
41 la %r0,.back-.base(%r13) 41 la %r0,.back-.base(%r13)
42 st %r0,4(%r0) 42 st %r0,4(%r0)
43 oi 4(%r0),0x80 43 oi 4(%r0),0x80
44 lghi %r0,0 44 lghi %r0,0
45 diag %r0,%r0,0x308 45 diag %r0,%r0,0x308
46 .back: 46 .back:
47 lhi %r1,1 #mode 1 = esame 47 lhi %r1,1 # mode 1 = esame
48 sigp %r1,%r0,0x12 #switch to esame mode 48 sigp %r1,%r0,0x12 # switch to esame mode
49 sam64 #switch to 64 bit addressing mode 49 sam64 # switch to 64 bit addressing mode
50 basr %r13,0 50 basr %r13,0
51 .back_base: 51 .back_base:
52 oi have_diag308-.back_base(%r13),0x01 52 oi have_diag308-.back_base(%r13),0x01
@@ -56,50 +56,50 @@
56 .back_pgm: 56 .back_pgm:
57 lmg %r0,%r15,gprregs-.base(%r13) 57 lmg %r0,%r15,gprregs-.base(%r13)
58 .top: 58 .top:
59 lghi %r7,4096 #load PAGE_SIZE in r7 59 lghi %r7,4096 # load PAGE_SIZE in r7
60 lghi %r9,4096 #load PAGE_SIZE in r9 60 lghi %r9,4096 # load PAGE_SIZE in r9
61 lg %r5,0(%r2) #read another word for indirection page 61 lg %r5,0(%r2) # read another word for indirection page
62 aghi %r2,8 #increment pointer 62 aghi %r2,8 # increment pointer
63 tml %r5,0x1 #is it a destination page? 63 tml %r5,0x1 # is it a destination page?
64 je .indir_check #NO, goto "indir_check" 64 je .indir_check # NO, goto "indir_check"
65 lgr %r6,%r5 #r6 = r5 65 lgr %r6,%r5 # r6 = r5
66 nill %r6,0xf000 #mask it out and... 66 nill %r6,0xf000 # mask it out and...
67 j .top #...next iteration 67 j .top # ...next iteration
68 .indir_check: 68 .indir_check:
69 tml %r5,0x2 #is it a indirection page? 69 tml %r5,0x2 # is it a indirection page?
70 je .done_test #NO, goto "done_test" 70 je .done_test # NO, goto "done_test"
71 nill %r5,0xf000 #YES, mask out, 71 nill %r5,0xf000 # YES, mask out,
72 lgr %r2,%r5 #move it into the right register, 72 lgr %r2,%r5 # move it into the right register,
73 j .top #and read next... 73 j .top # and read next...
74 .done_test: 74 .done_test:
75 tml %r5,0x4 #is it the done indicator? 75 tml %r5,0x4 # is it the done indicator?
76 je .source_test #NO! Well, then it should be the source indicator... 76 je .source_test # NO! Well, then it should be the source indicator...
77 j .done #ok, lets finish it here... 77 j .done # ok, lets finish it here...
78 .source_test: 78 .source_test:
79 tml %r5,0x8 #it should be a source indicator... 79 tml %r5,0x8 # it should be a source indicator...
80 je .top #NO, ignore it... 80 je .top # NO, ignore it...
81 lgr %r8,%r5 #r8 = r5 81 lgr %r8,%r5 # r8 = r5
82 nill %r8,0xf000 #masking 82 nill %r8,0xf000 # masking
83 0: mvcle %r6,%r8,0x0 #copy PAGE_SIZE bytes from r8 to r6 - pad with 0 83 0: mvcle %r6,%r8,0x0 # copy PAGE_SIZE bytes from r8 to r6 - pad with 0
84 jo 0b 84 jo 0b
85 j .top 85 j .top
86 .done: 86 .done:
87 sgr %r0,%r0 #clear register r0 87 sgr %r0,%r0 # clear register r0
88 la %r4,load_psw-.base(%r13) #load psw-address into the register 88 la %r4,load_psw-.base(%r13) # load psw-address into the register
89 o %r3,4(%r4) #or load address into psw 89 o %r3,4(%r4) # or load address into psw
90 st %r3,4(%r4) 90 st %r3,4(%r4)
91 mvc 0(8,%r0),0(%r4) #copy psw to absolute address 0 91 mvc 0(8,%r0),0(%r4) # copy psw to absolute address 0
92 tm have_diag308-.base(%r13),0x01 92 tm have_diag308-.base(%r13),0x01
93 jno .no_diag308 93 jno .no_diag308
94 diag %r0,%r0,0x308 94 diag %r0,%r0,0x308
95 .no_diag308: 95 .no_diag308:
96 sam31 #31 bit mode 96 sam31 # 31 bit mode
97 sr %r1,%r1 #erase register r1 97 sr %r1,%r1 # erase register r1
98 sr %r2,%r2 #erase register r2 98 sr %r2,%r2 # erase register r2
99 sigp %r1,%r2,0x12 #set cpuid to zero 99 sigp %r1,%r2,0x12 # set cpuid to zero
100 lpsw 0 #hopefully start new kernel... 100 lpsw 0 # hopefully start new kernel...
101 101
102 .align 8 102 .align 8
103 zero64: 103 zero64:
104 .quad 0 104 .quad 0
105 load_psw: 105 load_psw: