blob: 708cf9cf9a355e175d5b1cf4fbdc2b96732e7084 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * arch/s390/kernel/entry.S
3 * S390 low-level entry points.
4 *
Heiko Carstens54dfe5d2006-02-01 03:06:38 -08005 * Copyright (C) IBM Corp. 1999,2006
Linus Torvalds1da177e2005-04-16 15:20:36 -07006 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
Heiko Carstens25d83cb2006-09-28 16:56:37 +02007 * Hartmut Penner (hp@de.ibm.com),
8 * Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com),
Heiko Carstens77fa2242005-06-25 14:55:30 -07009 * Heiko Carstens <heiko.carstens@de.ibm.com>
Linus Torvalds1da177e2005-04-16 15:20:36 -070010 */
11
12#include <linux/sys.h>
13#include <linux/linkage.h>
Heiko Carstens2bc89b52008-02-05 16:50:40 +010014#include <linux/init.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070015#include <asm/cache.h>
16#include <asm/lowcore.h>
17#include <asm/errno.h>
18#include <asm/ptrace.h>
19#include <asm/thread_info.h>
Sam Ravnborg0013a852005-09-09 20:57:26 +020020#include <asm/asm-offsets.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070021#include <asm/unistd.h>
22#include <asm/page.h>
23
24/*
25 * Stack layout for the system_call stack entry.
26 * The first few entries are identical to the user_regs_struct.
27 */
Heiko Carstens25d83cb2006-09-28 16:56:37 +020028SP_PTREGS = STACK_FRAME_OVERHEAD
29SP_ARGS = STACK_FRAME_OVERHEAD + __PT_ARGS
30SP_PSW = STACK_FRAME_OVERHEAD + __PT_PSW
31SP_R0 = STACK_FRAME_OVERHEAD + __PT_GPRS
32SP_R1 = STACK_FRAME_OVERHEAD + __PT_GPRS + 4
33SP_R2 = STACK_FRAME_OVERHEAD + __PT_GPRS + 8
34SP_R3 = STACK_FRAME_OVERHEAD + __PT_GPRS + 12
35SP_R4 = STACK_FRAME_OVERHEAD + __PT_GPRS + 16
36SP_R5 = STACK_FRAME_OVERHEAD + __PT_GPRS + 20
37SP_R6 = STACK_FRAME_OVERHEAD + __PT_GPRS + 24
38SP_R7 = STACK_FRAME_OVERHEAD + __PT_GPRS + 28
39SP_R8 = STACK_FRAME_OVERHEAD + __PT_GPRS + 32
40SP_R9 = STACK_FRAME_OVERHEAD + __PT_GPRS + 36
41SP_R10 = STACK_FRAME_OVERHEAD + __PT_GPRS + 40
42SP_R11 = STACK_FRAME_OVERHEAD + __PT_GPRS + 44
43SP_R12 = STACK_FRAME_OVERHEAD + __PT_GPRS + 48
44SP_R13 = STACK_FRAME_OVERHEAD + __PT_GPRS + 52
45SP_R14 = STACK_FRAME_OVERHEAD + __PT_GPRS + 56
46SP_R15 = STACK_FRAME_OVERHEAD + __PT_GPRS + 60
47SP_ORIG_R2 = STACK_FRAME_OVERHEAD + __PT_ORIG_GPR2
48SP_ILC = STACK_FRAME_OVERHEAD + __PT_ILC
49SP_TRAP = STACK_FRAME_OVERHEAD + __PT_TRAP
50SP_SIZE = STACK_FRAME_OVERHEAD + __PT_SIZE
Linus Torvalds1da177e2005-04-16 15:20:36 -070051
Roland McGrath02a029b2008-04-30 00:53:08 -070052_TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \
Heiko Carstens54dfe5d2006-02-01 03:06:38 -080053 _TIF_MCCK_PENDING | _TIF_RESTART_SVC | _TIF_SINGLE_STEP )
Roland McGrath02a029b2008-04-30 00:53:08 -070054_TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \
Heiko Carstens54dfe5d2006-02-01 03:06:38 -080055 _TIF_MCCK_PENDING)
Linus Torvalds1da177e2005-04-16 15:20:36 -070056
57STACK_SHIFT = PAGE_SHIFT + THREAD_ORDER
58STACK_SIZE = 1 << STACK_SHIFT
59
60#define BASED(name) name-system_call(%r13)
61
Heiko Carstens1f194a42006-07-03 00:24:46 -070062#ifdef CONFIG_TRACE_IRQFLAGS
63 .macro TRACE_IRQS_ON
64 l %r1,BASED(.Ltrace_irq_on)
65 basr %r14,%r1
66 .endm
67
68 .macro TRACE_IRQS_OFF
69 l %r1,BASED(.Ltrace_irq_off)
70 basr %r14,%r1
71 .endm
Heiko Carstens523b44c2007-10-11 22:11:12 +020072
Heiko Carstens411788e2007-11-20 11:13:32 +010073 .macro TRACE_IRQS_CHECK
74 tm SP_PSW(%r15),0x03 # irqs enabled?
75 jz 0f
76 l %r1,BASED(.Ltrace_irq_on)
Heiko Carstens523b44c2007-10-11 22:11:12 +020077 basr %r14,%r1
Heiko Carstens411788e2007-11-20 11:13:32 +010078 j 1f
790: l %r1,BASED(.Ltrace_irq_off)
80 basr %r14,%r1
811:
Heiko Carstens523b44c2007-10-11 22:11:12 +020082 .endm
Heiko Carstens1f194a42006-07-03 00:24:46 -070083#else
84#define TRACE_IRQS_ON
85#define TRACE_IRQS_OFF
Heiko Carstens411788e2007-11-20 11:13:32 +010086#define TRACE_IRQS_CHECK
87#endif
88
89#ifdef CONFIG_LOCKDEP
90 .macro LOCKDEP_SYS_EXIT
91 tm SP_PSW+1(%r15),0x01 # returning to user ?
92 jz 0f
93 l %r1,BASED(.Llockdep_sys_exit)
94 basr %r14,%r1
950:
96 .endm
97#else
Heiko Carstens523b44c2007-10-11 22:11:12 +020098#define LOCKDEP_SYS_EXIT
Heiko Carstens1f194a42006-07-03 00:24:46 -070099#endif
100
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101/*
102 * Register usage in interrupt handlers:
103 * R9 - pointer to current task structure
104 * R13 - pointer to literal pool
105 * R14 - return register for function calls
106 * R15 - kernel stack pointer
107 */
108
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200109 .macro STORE_TIMER lc_offset
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110#ifdef CONFIG_VIRT_CPU_ACCOUNTING
111 stpt \lc_offset
112#endif
113 .endm
114
115#ifdef CONFIG_VIRT_CPU_ACCOUNTING
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200116 .macro UPDATE_VTIME lc_from,lc_to,lc_sum
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117 lm %r10,%r11,\lc_from
118 sl %r10,\lc_to
119 sl %r11,\lc_to+4
120 bc 3,BASED(0f)
121 sl %r10,BASED(.Lc_1)
1220: al %r10,\lc_sum
123 al %r11,\lc_sum+4
124 bc 12,BASED(1f)
125 al %r10,BASED(.Lc_1)
1261: stm %r10,%r11,\lc_sum
127 .endm
128#endif
129
130 .macro SAVE_ALL_BASE savearea
131 stm %r12,%r15,\savearea
132 l %r13,__LC_SVC_NEW_PSW+4 # load &system_call to %r13
133 .endm
134
Martin Schwidefsky987ad702007-07-10 11:24:18 +0200135 .macro SAVE_ALL_SVC psworg,savearea
136 la %r12,\psworg
137 l %r15,__LC_KERNEL_STACK # problem state -> load ksp
138 .endm
139
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200140 .macro SAVE_ALL_SYNC psworg,savearea
Linus Torvalds1da177e2005-04-16 15:20:36 -0700141 la %r12,\psworg
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142 tm \psworg+1,0x01 # test problem state bit
143 bz BASED(2f) # skip stack setup save
144 l %r15,__LC_KERNEL_STACK # problem state -> load ksp
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200145#ifdef CONFIG_CHECK_STACK
146 b BASED(3f)
1472: tml %r15,STACK_SIZE - CONFIG_STACK_GUARD
148 bz BASED(stack_overflow)
1493:
150#endif
1512:
152 .endm
153
154 .macro SAVE_ALL_ASYNC psworg,savearea
155 la %r12,\psworg
Linus Torvalds1da177e2005-04-16 15:20:36 -0700156 tm \psworg+1,0x01 # test problem state bit
157 bnz BASED(1f) # from user -> load async stack
158 clc \psworg+4(4),BASED(.Lcritical_end)
159 bhe BASED(0f)
160 clc \psworg+4(4),BASED(.Lcritical_start)
161 bl BASED(0f)
162 l %r14,BASED(.Lcleanup_critical)
163 basr %r14,%r14
Peter Oberparleiter6add9f72005-09-16 19:27:42 -0700164 tm 1(%r12),0x01 # retest problem state after cleanup
Linus Torvalds1da177e2005-04-16 15:20:36 -0700165 bnz BASED(1f)
1660: l %r14,__LC_ASYNC_STACK # are we already on the async stack ?
167 slr %r14,%r15
168 sra %r14,STACK_SHIFT
169 be BASED(2f)
1701: l %r15,__LC_ASYNC_STACK
Linus Torvalds1da177e2005-04-16 15:20:36 -0700171#ifdef CONFIG_CHECK_STACK
172 b BASED(3f)
1732: tml %r15,STACK_SIZE - CONFIG_STACK_GUARD
174 bz BASED(stack_overflow)
1753:
176#endif
Heiko Carstens77fa2242005-06-25 14:55:30 -07001772:
178 .endm
179
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200180 .macro CREATE_STACK_FRAME psworg,savearea
Heiko Carstens77fa2242005-06-25 14:55:30 -0700181 s %r15,BASED(.Lc_spsize) # make room for registers & psw
Linus Torvalds1da177e2005-04-16 15:20:36 -0700182 mvc SP_PSW(8,%r15),0(%r12) # move user PSW to stack
183 la %r12,\psworg
184 st %r2,SP_ORIG_R2(%r15) # store original content of gpr 2
185 icm %r12,12,__LC_SVC_ILC
186 stm %r0,%r11,SP_R0(%r15) # store gprs %r0-%r11 to kernel stack
187 st %r12,SP_ILC(%r15)
188 mvc SP_R12(16,%r15),\savearea # move %r12-%r15 to stack
189 la %r12,0
190 st %r12,__SF_BACKCHAIN(%r15) # clear back chain
191 .endm
192
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200193 .macro RESTORE_ALL psworg,sync
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700194 mvc \psworg(8),SP_PSW(%r15) # move user PSW to lowcore
Linus Torvalds1da177e2005-04-16 15:20:36 -0700195 .if !\sync
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700196 ni \psworg+1,0xfd # clear wait state bit
Linus Torvalds1da177e2005-04-16 15:20:36 -0700197 .endif
198 lm %r0,%r15,SP_R0(%r15) # load gprs 0-15 of user
199 STORE_TIMER __LC_EXIT_TIMER
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700200 lpsw \psworg # back to caller
Linus Torvalds1da177e2005-04-16 15:20:36 -0700201 .endm
202
203/*
204 * Scheduler resume function, called by switch_to
205 * gpr2 = (task_struct *) prev
206 * gpr3 = (task_struct *) next
207 * Returns:
208 * gpr2 = prev
209 */
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200210 .globl __switch_to
Linus Torvalds1da177e2005-04-16 15:20:36 -0700211__switch_to:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200212 basr %r1,0
Linus Torvalds1da177e2005-04-16 15:20:36 -0700213__switch_to_base:
214 tm __THREAD_per(%r3),0xe8 # new process is using per ?
215 bz __switch_to_noper-__switch_to_base(%r1) # if not we're fine
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200216 stctl %c9,%c11,__SF_EMPTY(%r15) # We are using per stuff
217 clc __THREAD_per(12,%r3),__SF_EMPTY(%r15)
218 be __switch_to_noper-__switch_to_base(%r1) # we got away w/o bashing TLB's
219 lctl %c9,%c11,__THREAD_per(%r3) # Nope we didn't
Linus Torvalds1da177e2005-04-16 15:20:36 -0700220__switch_to_noper:
Heiko Carstens77fa2242005-06-25 14:55:30 -0700221 l %r4,__THREAD_info(%r2) # get thread_info of prev
222 tm __TI_flags+3(%r4),_TIF_MCCK_PENDING # machine check pending?
223 bz __switch_to_no_mcck-__switch_to_base(%r1)
224 ni __TI_flags+3(%r4),255-_TIF_MCCK_PENDING # clear flag in prev
225 l %r4,__THREAD_info(%r3) # get thread_info of next
226 oi __TI_flags+3(%r4),_TIF_MCCK_PENDING # set it in next
227__switch_to_no_mcck:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200228 stm %r6,%r15,__SF_GPRS(%r15)# store __switch_to registers of prev task
Linus Torvalds1da177e2005-04-16 15:20:36 -0700229 st %r15,__THREAD_ksp(%r2) # store kernel stack to prev->tss.ksp
230 l %r15,__THREAD_ksp(%r3) # load kernel stack from next->tss.ksp
231 lm %r6,%r15,__SF_GPRS(%r15)# load __switch_to registers of next task
232 st %r3,__LC_CURRENT # __LC_CURRENT = current task struct
233 lctl %c4,%c4,__TASK_pid(%r3) # load pid to control reg. 4
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200234 l %r3,__THREAD_info(%r3) # load thread_info from task struct
Linus Torvalds1da177e2005-04-16 15:20:36 -0700235 st %r3,__LC_THREAD_INFO
236 ahi %r3,STACK_SIZE
237 st %r3,__LC_KERNEL_STACK # __LC_KERNEL_STACK = new kernel stack
238 br %r14
239
240__critical_start:
241/*
242 * SVC interrupt handler routine. System calls are synchronous events and
243 * are executed with interrupts enabled.
244 */
245
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200246 .globl system_call
Linus Torvalds1da177e2005-04-16 15:20:36 -0700247system_call:
248 STORE_TIMER __LC_SYNC_ENTER_TIMER
249sysc_saveall:
250 SAVE_ALL_BASE __LC_SAVE_AREA
Martin Schwidefsky987ad702007-07-10 11:24:18 +0200251 SAVE_ALL_SVC __LC_SVC_OLD_PSW,__LC_SAVE_AREA
Heiko Carstens77fa2242005-06-25 14:55:30 -0700252 CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA
Linus Torvalds1da177e2005-04-16 15:20:36 -0700253 lh %r7,0x8a # get svc number from lowcore
254#ifdef CONFIG_VIRT_CPU_ACCOUNTING
255sysc_vtime:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700256 UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER
257sysc_stime:
258 UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
259sysc_update:
260 mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER
261#endif
262sysc_do_svc:
263 l %r9,__LC_THREAD_INFO # load pointer to thread_info struct
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200264 sla %r7,2 # *4 and test for svc 0
265 bnz BASED(sysc_nr_ok) # svc number > 0
Linus Torvalds1da177e2005-04-16 15:20:36 -0700266 # svc 0: system call number in %r1
267 cl %r1,BASED(.Lnr_syscalls)
268 bnl BASED(sysc_nr_ok)
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200269 lr %r7,%r1 # copy svc number to %r7
270 sla %r7,2 # *4
Linus Torvalds1da177e2005-04-16 15:20:36 -0700271sysc_nr_ok:
272 mvc SP_ARGS(4,%r15),SP_R7(%r15)
273sysc_do_restart:
Heiko Carstensd882b172006-07-01 04:36:31 -0700274 l %r8,BASED(.Lsysc_table)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700275 tm __TI_flags+3(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
Heiko Carstensd882b172006-07-01 04:36:31 -0700276 l %r8,0(%r7,%r8) # get system call addr.
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200277 bnz BASED(sysc_tracesys)
278 basr %r14,%r8 # call sys_xxxx
279 st %r2,SP_R2(%r15) # store return value (change R2 on stack)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700280
281sysc_return:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700282 tm __TI_flags+3(%r9),_TIF_WORK_SVC
283 bnz BASED(sysc_work) # there is work to do (signals etc.)
Heiko Carstens411788e2007-11-20 11:13:32 +0100284sysc_restore:
285#ifdef CONFIG_TRACE_IRQFLAGS
286 la %r1,BASED(sysc_restore_trace_psw)
287 lpsw 0(%r1)
288sysc_restore_trace:
289 TRACE_IRQS_CHECK
Heiko Carstens523b44c2007-10-11 22:11:12 +0200290 LOCKDEP_SYS_EXIT
Heiko Carstens411788e2007-11-20 11:13:32 +0100291#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700292sysc_leave:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200293 RESTORE_ALL __LC_RETURN_PSW,1
Heiko Carstens411788e2007-11-20 11:13:32 +0100294sysc_done:
295
296#ifdef CONFIG_TRACE_IRQFLAGS
297 .align 8
298 .globl sysc_restore_trace_psw
299sysc_restore_trace_psw:
300 .long 0, sysc_restore_trace + 0x80000000
301#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700302
303#
304# recheck if there is more work to do
305#
306sysc_work_loop:
307 tm __TI_flags+3(%r9),_TIF_WORK_SVC
Heiko Carstens411788e2007-11-20 11:13:32 +0100308 bz BASED(sysc_restore) # there is no work to do
Linus Torvalds1da177e2005-04-16 15:20:36 -0700309#
310# One of the work bits is on. Find out which one.
311#
312sysc_work:
Martin Schwidefsky26889052008-05-07 09:22:52 +0200313 tm SP_PSW+1(%r15),0x01 # returning to user ?
314 bno BASED(sysc_restore)
Heiko Carstens77fa2242005-06-25 14:55:30 -0700315 tm __TI_flags+3(%r9),_TIF_MCCK_PENDING
316 bo BASED(sysc_mcck_pending)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700317 tm __TI_flags+3(%r9),_TIF_NEED_RESCHED
318 bo BASED(sysc_reschedule)
Roland McGrath02a029b2008-04-30 00:53:08 -0700319 tm __TI_flags+3(%r9),_TIF_SIGPENDING
Heiko Carstens54dfe5d2006-02-01 03:06:38 -0800320 bnz BASED(sysc_sigpending)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700321 tm __TI_flags+3(%r9),_TIF_RESTART_SVC
322 bo BASED(sysc_restart)
323 tm __TI_flags+3(%r9),_TIF_SINGLE_STEP
324 bo BASED(sysc_singlestep)
Heiko Carstens411788e2007-11-20 11:13:32 +0100325 b BASED(sysc_restore)
326sysc_work_done:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700327
328#
329# _TIF_NEED_RESCHED is set, call schedule
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200330#
331sysc_reschedule:
332 l %r1,BASED(.Lschedule)
333 la %r14,BASED(sysc_work_loop)
334 br %r1 # call scheduler
Linus Torvalds1da177e2005-04-16 15:20:36 -0700335
336#
Heiko Carstens77fa2242005-06-25 14:55:30 -0700337# _TIF_MCCK_PENDING is set, call handler
338#
339sysc_mcck_pending:
340 l %r1,BASED(.Ls390_handle_mcck)
341 la %r14,BASED(sysc_work_loop)
342 br %r1 # TIF bit will be cleared by handler
343
344#
Roland McGrath02a029b2008-04-30 00:53:08 -0700345# _TIF_SIGPENDING is set, call do_signal
Linus Torvalds1da177e2005-04-16 15:20:36 -0700346#
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200347sysc_sigpending:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700348 ni __TI_flags+3(%r9),255-_TIF_SINGLE_STEP # clear TIF_SINGLE_STEP
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200349 la %r2,SP_PTREGS(%r15) # load pt_regs
350 l %r1,BASED(.Ldo_signal)
351 basr %r14,%r1 # call do_signal
Linus Torvalds1da177e2005-04-16 15:20:36 -0700352 tm __TI_flags+3(%r9),_TIF_RESTART_SVC
353 bo BASED(sysc_restart)
354 tm __TI_flags+3(%r9),_TIF_SINGLE_STEP
355 bo BASED(sysc_singlestep)
Heiko Carstense1c3ad92005-11-07 00:59:02 -0800356 b BASED(sysc_work_loop)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700357
358#
359# _TIF_RESTART_SVC is set, set up registers and restart svc
360#
361sysc_restart:
362 ni __TI_flags+3(%r9),255-_TIF_RESTART_SVC # clear TIF_RESTART_SVC
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200363 l %r7,SP_R2(%r15) # load new svc number
Linus Torvalds1da177e2005-04-16 15:20:36 -0700364 sla %r7,2
365 mvc SP_R2(4,%r15),SP_ORIG_R2(%r15) # restore first argument
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200366 lm %r2,%r6,SP_R2(%r15) # load svc arguments
367 b BASED(sysc_do_restart) # restart svc
Linus Torvalds1da177e2005-04-16 15:20:36 -0700368
369#
370# _TIF_SINGLE_STEP is set, call do_single_step
371#
372sysc_singlestep:
373 ni __TI_flags+3(%r9),255-_TIF_SINGLE_STEP # clear TIF_SINGLE_STEP
374 mvi SP_TRAP+1(%r15),0x28 # set trap indication to pgm check
375 la %r2,SP_PTREGS(%r15) # address of register-save area
376 l %r1,BASED(.Lhandle_per) # load adr. of per handler
377 la %r14,BASED(sysc_return) # load adr. of system return
378 br %r1 # branch to do_single_step
379
Linus Torvalds1da177e2005-04-16 15:20:36 -0700380#
381# call trace before and after sys_call
382#
383sysc_tracesys:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200384 l %r1,BASED(.Ltrace)
385 la %r2,SP_PTREGS(%r15) # load pt_regs
Linus Torvalds1da177e2005-04-16 15:20:36 -0700386 la %r3,0
387 srl %r7,2
388 st %r7,SP_R2(%r15)
389 basr %r14,%r1
390 clc SP_R2(4,%r15),BASED(.Lnr_syscalls)
391 bnl BASED(sysc_tracenogo)
Heiko Carstensd882b172006-07-01 04:36:31 -0700392 l %r8,BASED(.Lsysc_table)
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200393 l %r7,SP_R2(%r15) # strace might have changed the
394 sll %r7,2 # system call
Heiko Carstensd882b172006-07-01 04:36:31 -0700395 l %r8,0(%r7,%r8)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700396sysc_tracego:
397 lm %r3,%r6,SP_R3(%r15)
398 l %r2,SP_ORIG_R2(%r15)
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200399 basr %r14,%r8 # call sys_xxx
400 st %r2,SP_R2(%r15) # store return value
Linus Torvalds1da177e2005-04-16 15:20:36 -0700401sysc_tracenogo:
402 tm __TI_flags+3(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200403 bz BASED(sysc_return)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700404 l %r1,BASED(.Ltrace)
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200405 la %r2,SP_PTREGS(%r15) # load pt_regs
Linus Torvalds1da177e2005-04-16 15:20:36 -0700406 la %r3,1
407 la %r14,BASED(sysc_return)
408 br %r1
409
410#
411# a new process exits the kernel with ret_from_fork
412#
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200413 .globl ret_from_fork
Linus Torvalds1da177e2005-04-16 15:20:36 -0700414ret_from_fork:
415 l %r13,__LC_SVC_NEW_PSW+4
416 l %r9,__LC_THREAD_INFO # load pointer to thread_info struct
417 tm SP_PSW+1(%r15),0x01 # forking a kernel thread ?
418 bo BASED(0f)
419 st %r15,SP_R15(%r15) # store stack pointer for new kthread
Heiko Carstens25d83cb2006-09-28 16:56:37 +02004200: l %r1,BASED(.Lschedtail)
421 basr %r14,%r1
Heiko Carstens1f194a42006-07-03 00:24:46 -0700422 TRACE_IRQS_ON
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200423 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts
Linus Torvalds1da177e2005-04-16 15:20:36 -0700424 b BASED(sysc_return)
425
426#
Martin Schwidefsky03ff9a22007-04-27 16:01:40 +0200427# kernel_execve function needs to deal with pt_regs that is not
428# at the usual place
Linus Torvalds1da177e2005-04-16 15:20:36 -0700429#
Martin Schwidefsky03ff9a22007-04-27 16:01:40 +0200430 .globl kernel_execve
431kernel_execve:
432 stm %r12,%r15,48(%r15)
433 lr %r14,%r15
434 l %r13,__LC_SVC_NEW_PSW+4
435 s %r15,BASED(.Lc_spsize)
436 st %r14,__SF_BACKCHAIN(%r15)
437 la %r12,SP_PTREGS(%r15)
438 xc 0(__PT_SIZE,%r12),0(%r12)
439 l %r1,BASED(.Ldo_execve)
440 lr %r5,%r12
441 basr %r14,%r1
442 ltr %r2,%r2
443 be BASED(0f)
444 a %r15,BASED(.Lc_spsize)
445 lm %r12,%r15,48(%r15)
446 br %r14
447 # execve succeeded.
4480: stnsm __SF_EMPTY(%r15),0xfc # disable interrupts
449 l %r15,__LC_KERNEL_STACK # load ksp
450 s %r15,BASED(.Lc_spsize) # make room for registers & psw
451 l %r9,__LC_THREAD_INFO
452 mvc SP_PTREGS(__PT_SIZE,%r15),0(%r12) # copy pt_regs
453 xc __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15)
454 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts
455 l %r1,BASED(.Lexecve_tail)
456 basr %r14,%r1
457 b BASED(sysc_return)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700458
459/*
460 * Program check handler routine
461 */
462
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200463 .globl pgm_check_handler
Linus Torvalds1da177e2005-04-16 15:20:36 -0700464pgm_check_handler:
465/*
466 * First we need to check for a special case:
467 * Single stepping an instruction that disables the PER event mask will
468 * cause a PER event AFTER the mask has been set. Example: SVC or LPSW.
469 * For a single stepped SVC the program check handler gets control after
470 * the SVC new PSW has been loaded. But we want to execute the SVC first and
471 * then handle the PER event. Therefore we update the SVC old PSW to point
472 * to the pgm_check_handler and branch to the SVC handler after we checked
473 * if we have to load the kernel stack register.
474 * For every other possible cause for PER event without the PER mask set
475 * we just ignore the PER event (FIXME: is there anything we have to do
476 * for LPSW?).
477 */
478 STORE_TIMER __LC_SYNC_ENTER_TIMER
479 SAVE_ALL_BASE __LC_SAVE_AREA
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200480 tm __LC_PGM_INT_CODE+1,0x80 # check whether we got a per exception
481 bnz BASED(pgm_per) # got per exception -> special case
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200482 SAVE_ALL_SYNC __LC_PGM_OLD_PSW,__LC_SAVE_AREA
Heiko Carstens77fa2242005-06-25 14:55:30 -0700483 CREATE_STACK_FRAME __LC_PGM_OLD_PSW,__LC_SAVE_AREA
Linus Torvalds1da177e2005-04-16 15:20:36 -0700484#ifdef CONFIG_VIRT_CPU_ACCOUNTING
485 tm SP_PSW+1(%r15),0x01 # interrupting from user ?
486 bz BASED(pgm_no_vtime)
487 UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER
488 UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
489 mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER
490pgm_no_vtime:
491#endif
492 l %r9,__LC_THREAD_INFO # load pointer to thread_info struct
Heiko Carstens411788e2007-11-20 11:13:32 +0100493 TRACE_IRQS_OFF
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200494 l %r3,__LC_PGM_ILC # load program interruption code
Linus Torvalds1da177e2005-04-16 15:20:36 -0700495 la %r8,0x7f
496 nr %r8,%r3
497pgm_do_call:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200498 l %r7,BASED(.Ljump_table)
499 sll %r8,2
500 l %r7,0(%r8,%r7) # load address of handler routine
501 la %r2,SP_PTREGS(%r15) # address of register-save area
502 la %r14,BASED(sysc_return)
503 br %r7 # branch to interrupt-handler
Linus Torvalds1da177e2005-04-16 15:20:36 -0700504
505#
506# handle per exception
507#
508pgm_per:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200509 tm __LC_PGM_OLD_PSW,0x40 # test if per event recording is on
510 bnz BASED(pgm_per_std) # ok, normal per event from user space
Linus Torvalds1da177e2005-04-16 15:20:36 -0700511# ok its one of the special cases, now we need to find out which one
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200512 clc __LC_PGM_OLD_PSW(8),__LC_SVC_NEW_PSW
513 be BASED(pgm_svcper)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700514# no interesting special case, ignore PER event
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200515 lm %r12,%r15,__LC_SAVE_AREA
516 lpsw 0x28
Linus Torvalds1da177e2005-04-16 15:20:36 -0700517
518#
519# Normal per exception
520#
521pgm_per_std:
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200522 SAVE_ALL_SYNC __LC_PGM_OLD_PSW,__LC_SAVE_AREA
Heiko Carstens77fa2242005-06-25 14:55:30 -0700523 CREATE_STACK_FRAME __LC_PGM_OLD_PSW,__LC_SAVE_AREA
Linus Torvalds1da177e2005-04-16 15:20:36 -0700524#ifdef CONFIG_VIRT_CPU_ACCOUNTING
525 tm SP_PSW+1(%r15),0x01 # interrupting from user ?
526 bz BASED(pgm_no_vtime2)
527 UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER
528 UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
529 mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER
530pgm_no_vtime2:
531#endif
532 l %r9,__LC_THREAD_INFO # load pointer to thread_info struct
Heiko Carstens411788e2007-11-20 11:13:32 +0100533 TRACE_IRQS_OFF
Linus Torvalds1da177e2005-04-16 15:20:36 -0700534 l %r1,__TI_task(%r9)
535 mvc __THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID
536 mvc __THREAD_per+__PER_address(4,%r1),__LC_PER_ADDRESS
537 mvc __THREAD_per+__PER_access_id(1,%r1),__LC_PER_ACCESS_ID
538 oi __TI_flags+3(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP
Michael Grundy4ba069b2006-09-20 15:58:39 +0200539 tm SP_PSW+1(%r15),0x01 # kernel per event ?
540 bz BASED(kernel_per)
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200541 l %r3,__LC_PGM_ILC # load program interruption code
Linus Torvalds1da177e2005-04-16 15:20:36 -0700542 la %r8,0x7f
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200543 nr %r8,%r3 # clear per-event-bit and ilc
544 be BASED(sysc_return) # only per or per+check ?
Linus Torvalds1da177e2005-04-16 15:20:36 -0700545 b BASED(pgm_do_call)
546
547#
548# it was a single stepped SVC that is causing all the trouble
549#
550pgm_svcper:
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200551 SAVE_ALL_SYNC __LC_SVC_OLD_PSW,__LC_SAVE_AREA
Heiko Carstens77fa2242005-06-25 14:55:30 -0700552 CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA
Linus Torvalds1da177e2005-04-16 15:20:36 -0700553#ifdef CONFIG_VIRT_CPU_ACCOUNTING
Linus Torvalds1da177e2005-04-16 15:20:36 -0700554 UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER
555 UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
556 mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER
Linus Torvalds1da177e2005-04-16 15:20:36 -0700557#endif
558 lh %r7,0x8a # get svc number from lowcore
559 l %r9,__LC_THREAD_INFO # load pointer to thread_info struct
Heiko Carstens411788e2007-11-20 11:13:32 +0100560 TRACE_IRQS_OFF
Linus Torvalds1da177e2005-04-16 15:20:36 -0700561 l %r1,__TI_task(%r9)
562 mvc __THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID
563 mvc __THREAD_per+__PER_address(4,%r1),__LC_PER_ADDRESS
564 mvc __THREAD_per+__PER_access_id(1,%r1),__LC_PER_ACCESS_ID
565 oi __TI_flags+3(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP
Heiko Carstens1f194a42006-07-03 00:24:46 -0700566 TRACE_IRQS_ON
Linus Torvalds1da177e2005-04-16 15:20:36 -0700567 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts
568 b BASED(sysc_do_svc)
569
Michael Grundy4ba069b2006-09-20 15:58:39 +0200570#
571# per was called from kernel, must be kprobes
572#
573kernel_per:
574 mvi SP_TRAP+1(%r15),0x28 # set trap indication to pgm check
575 la %r2,SP_PTREGS(%r15) # address of register-save area
576 l %r1,BASED(.Lhandle_per) # load adr. of per handler
Heiko Carstens411788e2007-11-20 11:13:32 +0100577 la %r14,BASED(sysc_restore)# load adr. of system return
Michael Grundy4ba069b2006-09-20 15:58:39 +0200578 br %r1 # branch to do_single_step
579
Linus Torvalds1da177e2005-04-16 15:20:36 -0700580/*
581 * IO interrupt handler routine
582 */
583
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200584 .globl io_int_handler
Linus Torvalds1da177e2005-04-16 15:20:36 -0700585io_int_handler:
586 STORE_TIMER __LC_ASYNC_ENTER_TIMER
587 stck __LC_INT_CLOCK
588 SAVE_ALL_BASE __LC_SAVE_AREA+16
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200589 SAVE_ALL_ASYNC __LC_IO_OLD_PSW,__LC_SAVE_AREA+16
Heiko Carstens77fa2242005-06-25 14:55:30 -0700590 CREATE_STACK_FRAME __LC_IO_OLD_PSW,__LC_SAVE_AREA+16
Linus Torvalds1da177e2005-04-16 15:20:36 -0700591#ifdef CONFIG_VIRT_CPU_ACCOUNTING
592 tm SP_PSW+1(%r15),0x01 # interrupting from user ?
593 bz BASED(io_no_vtime)
594 UPDATE_VTIME __LC_EXIT_TIMER,__LC_ASYNC_ENTER_TIMER,__LC_USER_TIMER
595 UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
596 mvc __LC_LAST_UPDATE_TIMER(8),__LC_ASYNC_ENTER_TIMER
597io_no_vtime:
598#endif
599 l %r9,__LC_THREAD_INFO # load pointer to thread_info struct
Heiko Carstens1f194a42006-07-03 00:24:46 -0700600 TRACE_IRQS_OFF
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200601 l %r1,BASED(.Ldo_IRQ) # load address of do_IRQ
602 la %r2,SP_PTREGS(%r15) # address of register-save area
603 basr %r14,%r1 # branch to standard irq handler
Linus Torvalds1da177e2005-04-16 15:20:36 -0700604io_return:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700605 tm __TI_flags+3(%r9),_TIF_WORK_INT
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200606 bnz BASED(io_work) # there is work to do (signals etc.)
Heiko Carstens411788e2007-11-20 11:13:32 +0100607io_restore:
608#ifdef CONFIG_TRACE_IRQFLAGS
609 la %r1,BASED(io_restore_trace_psw)
610 lpsw 0(%r1)
611io_restore_trace:
612 TRACE_IRQS_CHECK
Heiko Carstens523b44c2007-10-11 22:11:12 +0200613 LOCKDEP_SYS_EXIT
Heiko Carstens411788e2007-11-20 11:13:32 +0100614#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700615io_leave:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200616 RESTORE_ALL __LC_RETURN_PSW,0
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700617io_done:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700618
Heiko Carstens411788e2007-11-20 11:13:32 +0100619#ifdef CONFIG_TRACE_IRQFLAGS
620 .align 8
621 .globl io_restore_trace_psw
622io_restore_trace_psw:
623 .long 0, io_restore_trace + 0x80000000
624#endif
625
Martin Schwidefsky26889052008-05-07 09:22:52 +0200626#
627# switch to kernel stack, then check the TIF bits
628#
629io_work:
630 tm SP_PSW+1(%r15),0x01 # returning to user ?
631#ifndef CONFIG_PREEMPT
632 bno BASED(io_restore) # no-> skip resched & signal
633#else
634 bnz BASED(io_work_user) # no -> check for preemptive scheduling
635 # check for preemptive scheduling
Linus Torvalds1da177e2005-04-16 15:20:36 -0700636 icm %r0,15,__TI_precount(%r9)
Martin Schwidefsky26889052008-05-07 09:22:52 +0200637 bnz BASED(io_restore) # preemption disabled
Linus Torvalds1da177e2005-04-16 15:20:36 -0700638 l %r1,SP_R15(%r15)
639 s %r1,BASED(.Lc_spsize)
640 mvc SP_PTREGS(__PT_SIZE,%r1),SP_PTREGS(%r15)
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200641 xc __SF_BACKCHAIN(4,%r1),__SF_BACKCHAIN(%r1) # clear back chain
Linus Torvalds1da177e2005-04-16 15:20:36 -0700642 lr %r15,%r1
643io_resume_loop:
644 tm __TI_flags+3(%r9),_TIF_NEED_RESCHED
Heiko Carstens411788e2007-11-20 11:13:32 +0100645 bno BASED(io_restore)
Heiko Carstensb8e7a542007-11-20 11:13:35 +0100646 l %r1,BASED(.Lpreempt_schedule_irq)
647 la %r14,BASED(io_resume_loop)
648 br %r1 # call schedule
Linus Torvalds1da177e2005-04-16 15:20:36 -0700649#endif
650
Martin Schwidefsky26889052008-05-07 09:22:52 +0200651io_work_user:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700652 l %r1,__LC_KERNEL_STACK
653 s %r1,BASED(.Lc_spsize)
654 mvc SP_PTREGS(__PT_SIZE,%r1),SP_PTREGS(%r15)
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200655 xc __SF_BACKCHAIN(4,%r1),__SF_BACKCHAIN(%r1) # clear back chain
Linus Torvalds1da177e2005-04-16 15:20:36 -0700656 lr %r15,%r1
657#
658# One of the work bits is on. Find out which one.
Roland McGrath02a029b2008-04-30 00:53:08 -0700659# Checked are: _TIF_SIGPENDING, _TIF_NEED_RESCHED
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200660# and _TIF_MCCK_PENDING
Linus Torvalds1da177e2005-04-16 15:20:36 -0700661#
662io_work_loop:
Heiko Carstens77fa2242005-06-25 14:55:30 -0700663 tm __TI_flags+3(%r9),_TIF_MCCK_PENDING
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200664 bo BASED(io_mcck_pending)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700665 tm __TI_flags+3(%r9),_TIF_NEED_RESCHED
666 bo BASED(io_reschedule)
Roland McGrath02a029b2008-04-30 00:53:08 -0700667 tm __TI_flags+3(%r9),_TIF_SIGPENDING
Heiko Carstens54dfe5d2006-02-01 03:06:38 -0800668 bnz BASED(io_sigpending)
Heiko Carstens411788e2007-11-20 11:13:32 +0100669 b BASED(io_restore)
670io_work_done:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700671
672#
Heiko Carstens77fa2242005-06-25 14:55:30 -0700673# _TIF_MCCK_PENDING is set, call handler
674#
675io_mcck_pending:
676 l %r1,BASED(.Ls390_handle_mcck)
Heiko Carstensb771aea2007-07-27 12:29:18 +0200677 basr %r14,%r1 # TIF bit will be cleared by handler
Heiko Carstensb771aea2007-07-27 12:29:18 +0200678 b BASED(io_work_loop)
Heiko Carstens77fa2242005-06-25 14:55:30 -0700679
680#
Linus Torvalds1da177e2005-04-16 15:20:36 -0700681# _TIF_NEED_RESCHED is set, call schedule
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200682#
683io_reschedule:
Heiko Carstens411788e2007-11-20 11:13:32 +0100684 TRACE_IRQS_ON
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200685 l %r1,BASED(.Lschedule)
686 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts
687 basr %r14,%r1 # call scheduler
688 stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts
Heiko Carstens411788e2007-11-20 11:13:32 +0100689 TRACE_IRQS_OFF
Linus Torvalds1da177e2005-04-16 15:20:36 -0700690 tm __TI_flags+3(%r9),_TIF_WORK_INT
Heiko Carstens411788e2007-11-20 11:13:32 +0100691 bz BASED(io_restore) # there is no work to do
Linus Torvalds1da177e2005-04-16 15:20:36 -0700692 b BASED(io_work_loop)
693
694#
Roland McGrath02a029b2008-04-30 00:53:08 -0700695# _TIF_SIGPENDING is set, call do_signal
Linus Torvalds1da177e2005-04-16 15:20:36 -0700696#
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200697io_sigpending:
Heiko Carstens411788e2007-11-20 11:13:32 +0100698 TRACE_IRQS_ON
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200699 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts
700 la %r2,SP_PTREGS(%r15) # load pt_regs
701 l %r1,BASED(.Ldo_signal)
702 basr %r14,%r1 # call do_signal
703 stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts
Heiko Carstens411788e2007-11-20 11:13:32 +0100704 TRACE_IRQS_OFF
Heiko Carstense1c3ad92005-11-07 00:59:02 -0800705 b BASED(io_work_loop)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700706
707/*
708 * External interrupt handler routine
709 */
710
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200711 .globl ext_int_handler
Linus Torvalds1da177e2005-04-16 15:20:36 -0700712ext_int_handler:
713 STORE_TIMER __LC_ASYNC_ENTER_TIMER
714 stck __LC_INT_CLOCK
715 SAVE_ALL_BASE __LC_SAVE_AREA+16
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200716 SAVE_ALL_ASYNC __LC_EXT_OLD_PSW,__LC_SAVE_AREA+16
Heiko Carstens77fa2242005-06-25 14:55:30 -0700717 CREATE_STACK_FRAME __LC_EXT_OLD_PSW,__LC_SAVE_AREA+16
Linus Torvalds1da177e2005-04-16 15:20:36 -0700718#ifdef CONFIG_VIRT_CPU_ACCOUNTING
719 tm SP_PSW+1(%r15),0x01 # interrupting from user ?
720 bz BASED(ext_no_vtime)
721 UPDATE_VTIME __LC_EXIT_TIMER,__LC_ASYNC_ENTER_TIMER,__LC_USER_TIMER
722 UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
723 mvc __LC_LAST_UPDATE_TIMER(8),__LC_ASYNC_ENTER_TIMER
724ext_no_vtime:
725#endif
726 l %r9,__LC_THREAD_INFO # load pointer to thread_info struct
Heiko Carstens1f194a42006-07-03 00:24:46 -0700727 TRACE_IRQS_OFF
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200728 la %r2,SP_PTREGS(%r15) # address of register-save area
729 lh %r3,__LC_EXT_INT_CODE # get interruption code
Linus Torvalds1da177e2005-04-16 15:20:36 -0700730 l %r1,BASED(.Ldo_extint)
731 basr %r14,%r1
732 b BASED(io_return)
733
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700734__critical_end:
735
Linus Torvalds1da177e2005-04-16 15:20:36 -0700736/*
737 * Machine check handler routines
738 */
739
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200740 .globl mcck_int_handler
Linus Torvalds1da177e2005-04-16 15:20:36 -0700741mcck_int_handler:
Heiko Carstens77fa2242005-06-25 14:55:30 -0700742 spt __LC_CPU_TIMER_SAVE_AREA # revalidate cpu timer
743 lm %r0,%r15,__LC_GPREGS_SAVE_AREA # revalidate gprs
Linus Torvalds1da177e2005-04-16 15:20:36 -0700744 SAVE_ALL_BASE __LC_SAVE_AREA+32
Heiko Carstens77fa2242005-06-25 14:55:30 -0700745 la %r12,__LC_MCK_OLD_PSW
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200746 tm __LC_MCCK_CODE,0x80 # system damage?
Heiko Carstens77fa2242005-06-25 14:55:30 -0700747 bo BASED(mcck_int_main) # yes -> rest of mcck code invalid
Linus Torvalds1da177e2005-04-16 15:20:36 -0700748#ifdef CONFIG_VIRT_CPU_ACCOUNTING
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200749 mvc __LC_SAVE_AREA+52(8),__LC_ASYNC_ENTER_TIMER
750 mvc __LC_ASYNC_ENTER_TIMER(8),__LC_CPU_TIMER_SAVE_AREA
751 tm __LC_MCCK_CODE+5,0x02 # stored cpu timer value valid?
752 bo BASED(1f)
753 la %r14,__LC_SYNC_ENTER_TIMER
754 clc 0(8,%r14),__LC_ASYNC_ENTER_TIMER
755 bl BASED(0f)
756 la %r14,__LC_ASYNC_ENTER_TIMER
7570: clc 0(8,%r14),__LC_EXIT_TIMER
758 bl BASED(0f)
759 la %r14,__LC_EXIT_TIMER
7600: clc 0(8,%r14),__LC_LAST_UPDATE_TIMER
761 bl BASED(0f)
762 la %r14,__LC_LAST_UPDATE_TIMER
7630: spt 0(%r14)
764 mvc __LC_ASYNC_ENTER_TIMER(8),0(%r14)
7651:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700766#endif
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200767 tm __LC_MCCK_CODE+2,0x09 # mwp + ia of old psw valid?
Heiko Carstens77fa2242005-06-25 14:55:30 -0700768 bno BASED(mcck_int_main) # no -> skip cleanup critical
769 tm __LC_MCK_OLD_PSW+1,0x01 # test problem state bit
770 bnz BASED(mcck_int_main) # from user -> load async stack
771 clc __LC_MCK_OLD_PSW+4(4),BASED(.Lcritical_end)
772 bhe BASED(mcck_int_main)
773 clc __LC_MCK_OLD_PSW+4(4),BASED(.Lcritical_start)
774 bl BASED(mcck_int_main)
775 l %r14,BASED(.Lcleanup_critical)
776 basr %r14,%r14
777mcck_int_main:
778 l %r14,__LC_PANIC_STACK # are we already on the panic stack?
779 slr %r14,%r15
780 sra %r14,PAGE_SHIFT
781 be BASED(0f)
782 l %r15,__LC_PANIC_STACK # load panic stack
7830: CREATE_STACK_FRAME __LC_MCK_OLD_PSW,__LC_SAVE_AREA+32
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700784#ifdef CONFIG_VIRT_CPU_ACCOUNTING
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200785 tm __LC_MCCK_CODE+2,0x08 # mwp of old psw valid?
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700786 bno BASED(mcck_no_vtime) # no -> skip cleanup critical
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200787 tm SP_PSW+1(%r15),0x01 # interrupting from user ?
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700788 bz BASED(mcck_no_vtime)
789 UPDATE_VTIME __LC_EXIT_TIMER,__LC_ASYNC_ENTER_TIMER,__LC_USER_TIMER
790 UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
791 mvc __LC_LAST_UPDATE_TIMER(8),__LC_ASYNC_ENTER_TIMER
792mcck_no_vtime:
793#endif
Heiko Carstens77fa2242005-06-25 14:55:30 -0700794 l %r9,__LC_THREAD_INFO # load pointer to thread_info struct
795 la %r2,SP_PTREGS(%r15) # load pt_regs
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200796 l %r1,BASED(.Ls390_mcck)
797 basr %r14,%r1 # call machine check handler
798 tm SP_PSW+1(%r15),0x01 # returning to user ?
Heiko Carstens77fa2242005-06-25 14:55:30 -0700799 bno BASED(mcck_return)
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200800 l %r1,__LC_KERNEL_STACK # switch to kernel stack
Heiko Carstens77fa2242005-06-25 14:55:30 -0700801 s %r1,BASED(.Lc_spsize)
802 mvc SP_PTREGS(__PT_SIZE,%r1),SP_PTREGS(%r15)
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200803 xc __SF_BACKCHAIN(4,%r1),__SF_BACKCHAIN(%r1) # clear back chain
Heiko Carstens77fa2242005-06-25 14:55:30 -0700804 lr %r15,%r1
805 stosm __SF_EMPTY(%r15),0x04 # turn dat on
806 tm __TI_flags+3(%r9),_TIF_MCCK_PENDING
807 bno BASED(mcck_return)
Heiko Carstens1f194a42006-07-03 00:24:46 -0700808 TRACE_IRQS_OFF
Heiko Carstens77fa2242005-06-25 14:55:30 -0700809 l %r1,BASED(.Ls390_handle_mcck)
810 basr %r14,%r1 # call machine check handler
Heiko Carstens1f194a42006-07-03 00:24:46 -0700811 TRACE_IRQS_ON
Linus Torvalds1da177e2005-04-16 15:20:36 -0700812mcck_return:
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200813 mvc __LC_RETURN_MCCK_PSW(8),SP_PSW(%r15) # move return PSW
814 ni __LC_RETURN_MCCK_PSW+1,0xfd # clear wait state bit
815#ifdef CONFIG_VIRT_CPU_ACCOUNTING
816 mvc __LC_ASYNC_ENTER_TIMER(8),__LC_SAVE_AREA+52
817 tm __LC_RETURN_MCCK_PSW+1,0x01 # returning to user ?
818 bno BASED(0f)
819 lm %r0,%r15,SP_R0(%r15) # load gprs 0-15
820 stpt __LC_EXIT_TIMER
821 lpsw __LC_RETURN_MCCK_PSW # back to caller
8220:
823#endif
824 lm %r0,%r15,SP_R0(%r15) # load gprs 0-15
825 lpsw __LC_RETURN_MCCK_PSW # back to caller
826
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200827 RESTORE_ALL __LC_RETURN_MCCK_PSW,0
Linus Torvalds1da177e2005-04-16 15:20:36 -0700828
Linus Torvalds1da177e2005-04-16 15:20:36 -0700829/*
830 * Restart interruption handler, kick starter for additional CPUs
831 */
Heiko Carstens84b36a82007-06-19 13:10:03 +0200832#ifdef CONFIG_SMP
Heiko Carstens2bc89b52008-02-05 16:50:40 +0100833 __CPUINIT
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200834 .globl restart_int_handler
Linus Torvalds1da177e2005-04-16 15:20:36 -0700835restart_int_handler:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200836 l %r15,__LC_SAVE_AREA+60 # load ksp
837 lctl %c0,%c15,__LC_CREGS_SAVE_AREA # get new ctl regs
838 lam %a0,%a15,__LC_AREGS_SAVE_AREA
839 lm %r6,%r15,__SF_GPRS(%r15) # load registers from clone
840 stosm __SF_EMPTY(%r15),0x04 # now we can turn dat on
841 basr %r14,0
842 l %r14,restart_addr-.(%r14)
843 br %r14 # branch to start_secondary
Linus Torvalds1da177e2005-04-16 15:20:36 -0700844restart_addr:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200845 .long start_secondary
Heiko Carstens84b36a82007-06-19 13:10:03 +0200846 .previous
Linus Torvalds1da177e2005-04-16 15:20:36 -0700847#else
848/*
849 * If we do not run with SMP enabled, let the new CPU crash ...
850 */
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200851 .globl restart_int_handler
Linus Torvalds1da177e2005-04-16 15:20:36 -0700852restart_int_handler:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200853 basr %r1,0
Linus Torvalds1da177e2005-04-16 15:20:36 -0700854restart_base:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200855 lpsw restart_crash-restart_base(%r1)
856 .align 8
Linus Torvalds1da177e2005-04-16 15:20:36 -0700857restart_crash:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200858 .long 0x000a0000,0x00000000
Linus Torvalds1da177e2005-04-16 15:20:36 -0700859restart_go:
860#endif
861
862#ifdef CONFIG_CHECK_STACK
863/*
864 * The synchronous or the asynchronous stack overflowed. We are dead.
865 * No need to properly save the registers, we are going to panic anyway.
866 * Setup a pt_regs so that show_trace can provide a good call trace.
867 */
868stack_overflow:
869 l %r15,__LC_PANIC_STACK # change to panic stack
870 sl %r15,BASED(.Lc_spsize)
871 mvc SP_PSW(8,%r15),0(%r12) # move user PSW to stack
872 stm %r0,%r11,SP_R0(%r15) # store gprs %r0-%r11 to kernel stack
873 la %r1,__LC_SAVE_AREA
874 ch %r12,BASED(.L0x020) # old psw addr == __LC_SVC_OLD_PSW ?
875 be BASED(0f)
876 ch %r12,BASED(.L0x028) # old psw addr == __LC_PGM_OLD_PSW ?
877 be BASED(0f)
878 la %r1,__LC_SAVE_AREA+16
8790: mvc SP_R12(16,%r15),0(%r1) # move %r12-%r15 to stack
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200880 xc __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15) # clear back chain
Linus Torvalds1da177e2005-04-16 15:20:36 -0700881 l %r1,BASED(1f) # branch to kernel_stack_overflow
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200882 la %r2,SP_PTREGS(%r15) # load pt_regs
Linus Torvalds1da177e2005-04-16 15:20:36 -0700883 br %r1
Heiko Carstens25d83cb2006-09-28 16:56:37 +02008841: .long kernel_stack_overflow
Linus Torvalds1da177e2005-04-16 15:20:36 -0700885#endif
886
887cleanup_table_system_call:
888 .long system_call + 0x80000000, sysc_do_svc + 0x80000000
889cleanup_table_sysc_return:
890 .long sysc_return + 0x80000000, sysc_leave + 0x80000000
891cleanup_table_sysc_leave:
Heiko Carstens411788e2007-11-20 11:13:32 +0100892 .long sysc_leave + 0x80000000, sysc_done + 0x80000000
Linus Torvalds1da177e2005-04-16 15:20:36 -0700893cleanup_table_sysc_work_loop:
Heiko Carstens411788e2007-11-20 11:13:32 +0100894 .long sysc_work_loop + 0x80000000, sysc_work_done + 0x80000000
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200895cleanup_table_io_return:
896 .long io_return + 0x80000000, io_leave + 0x80000000
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700897cleanup_table_io_leave:
898 .long io_leave + 0x80000000, io_done + 0x80000000
899cleanup_table_io_work_loop:
Heiko Carstens411788e2007-11-20 11:13:32 +0100900 .long io_work_loop + 0x80000000, io_work_done + 0x80000000
Linus Torvalds1da177e2005-04-16 15:20:36 -0700901
902cleanup_critical:
903 clc 4(4,%r12),BASED(cleanup_table_system_call)
904 bl BASED(0f)
905 clc 4(4,%r12),BASED(cleanup_table_system_call+4)
906 bl BASED(cleanup_system_call)
9070:
908 clc 4(4,%r12),BASED(cleanup_table_sysc_return)
909 bl BASED(0f)
910 clc 4(4,%r12),BASED(cleanup_table_sysc_return+4)
911 bl BASED(cleanup_sysc_return)
9120:
913 clc 4(4,%r12),BASED(cleanup_table_sysc_leave)
914 bl BASED(0f)
915 clc 4(4,%r12),BASED(cleanup_table_sysc_leave+4)
916 bl BASED(cleanup_sysc_leave)
9170:
918 clc 4(4,%r12),BASED(cleanup_table_sysc_work_loop)
919 bl BASED(0f)
920 clc 4(4,%r12),BASED(cleanup_table_sysc_work_loop+4)
Heiko Carstens77fa2242005-06-25 14:55:30 -0700921 bl BASED(cleanup_sysc_return)
Linus Torvalds1da177e2005-04-16 15:20:36 -07009220:
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200923 clc 4(4,%r12),BASED(cleanup_table_io_return)
924 bl BASED(0f)
925 clc 4(4,%r12),BASED(cleanup_table_io_return+4)
926 bl BASED(cleanup_io_return)
9270:
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700928 clc 4(4,%r12),BASED(cleanup_table_io_leave)
929 bl BASED(0f)
930 clc 4(4,%r12),BASED(cleanup_table_io_leave+4)
931 bl BASED(cleanup_io_leave)
9320:
933 clc 4(4,%r12),BASED(cleanup_table_io_work_loop)
934 bl BASED(0f)
935 clc 4(4,%r12),BASED(cleanup_table_io_work_loop+4)
936 bl BASED(cleanup_io_return)
9370:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700938 br %r14
939
940cleanup_system_call:
941 mvc __LC_RETURN_PSW(8),0(%r12)
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700942 c %r12,BASED(.Lmck_old_psw)
943 be BASED(0f)
944 la %r12,__LC_SAVE_AREA+16
945 b BASED(1f)
9460: la %r12,__LC_SAVE_AREA+32
9471:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700948#ifdef CONFIG_VIRT_CPU_ACCOUNTING
949 clc __LC_RETURN_PSW+4(4),BASED(cleanup_system_call_insn+4)
950 bh BASED(0f)
951 mvc __LC_SYNC_ENTER_TIMER(8),__LC_ASYNC_ENTER_TIMER
9520: clc __LC_RETURN_PSW+4(4),BASED(cleanup_system_call_insn+8)
953 bhe BASED(cleanup_vtime)
954#endif
955 clc __LC_RETURN_PSW+4(4),BASED(cleanup_system_call_insn)
956 bh BASED(0f)
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700957 mvc __LC_SAVE_AREA(16),0(%r12)
9580: st %r13,4(%r12)
959 st %r12,__LC_SAVE_AREA+48 # argh
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200960 SAVE_ALL_SYNC __LC_SVC_OLD_PSW,__LC_SAVE_AREA
Heiko Carstens77fa2242005-06-25 14:55:30 -0700961 CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700962 l %r12,__LC_SAVE_AREA+48 # argh
963 st %r15,12(%r12)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700964 lh %r7,0x8a
965#ifdef CONFIG_VIRT_CPU_ACCOUNTING
966cleanup_vtime:
967 clc __LC_RETURN_PSW+4(4),BASED(cleanup_system_call_insn+12)
968 bhe BASED(cleanup_stime)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700969 UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER
970cleanup_stime:
971 clc __LC_RETURN_PSW+4(4),BASED(cleanup_system_call_insn+16)
972 bh BASED(cleanup_update)
973 UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
974cleanup_update:
975 mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER
Linus Torvalds1da177e2005-04-16 15:20:36 -0700976#endif
977 mvc __LC_RETURN_PSW+4(4),BASED(cleanup_table_system_call+4)
978 la %r12,__LC_RETURN_PSW
979 br %r14
980cleanup_system_call_insn:
981 .long sysc_saveall + 0x80000000
982#ifdef CONFIG_VIRT_CPU_ACCOUNTING
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200983 .long system_call + 0x80000000
984 .long sysc_vtime + 0x80000000
985 .long sysc_stime + 0x80000000
986 .long sysc_update + 0x80000000
Linus Torvalds1da177e2005-04-16 15:20:36 -0700987#endif
988
989cleanup_sysc_return:
990 mvc __LC_RETURN_PSW(4),0(%r12)
991 mvc __LC_RETURN_PSW+4(4),BASED(cleanup_table_sysc_return)
992 la %r12,__LC_RETURN_PSW
993 br %r14
994
995cleanup_sysc_leave:
996 clc 4(4,%r12),BASED(cleanup_sysc_leave_insn)
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700997 be BASED(2f)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700998#ifdef CONFIG_VIRT_CPU_ACCOUNTING
999 mvc __LC_EXIT_TIMER(8),__LC_ASYNC_ENTER_TIMER
1000 clc 4(4,%r12),BASED(cleanup_sysc_leave_insn+4)
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -07001001 be BASED(2f)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001002#endif
1003 mvc __LC_RETURN_PSW(8),SP_PSW(%r15)
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -07001004 c %r12,BASED(.Lmck_old_psw)
1005 bne BASED(0f)
1006 mvc __LC_SAVE_AREA+32(16),SP_R12(%r15)
1007 b BASED(1f)
10080: mvc __LC_SAVE_AREA+16(16),SP_R12(%r15)
10091: lm %r0,%r11,SP_R0(%r15)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001010 l %r15,SP_R15(%r15)
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -070010112: la %r12,__LC_RETURN_PSW
Linus Torvalds1da177e2005-04-16 15:20:36 -07001012 br %r14
1013cleanup_sysc_leave_insn:
Heiko Carstens411788e2007-11-20 11:13:32 +01001014 .long sysc_done - 4 + 0x80000000
Linus Torvalds1da177e2005-04-16 15:20:36 -07001015#ifdef CONFIG_VIRT_CPU_ACCOUNTING
Heiko Carstens411788e2007-11-20 11:13:32 +01001016 .long sysc_done - 8 + 0x80000000
Linus Torvalds1da177e2005-04-16 15:20:36 -07001017#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07001018
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -07001019cleanup_io_return:
1020 mvc __LC_RETURN_PSW(4),0(%r12)
1021 mvc __LC_RETURN_PSW+4(4),BASED(cleanup_table_io_work_loop)
1022 la %r12,__LC_RETURN_PSW
1023 br %r14
1024
1025cleanup_io_leave:
1026 clc 4(4,%r12),BASED(cleanup_io_leave_insn)
1027 be BASED(2f)
1028#ifdef CONFIG_VIRT_CPU_ACCOUNTING
1029 mvc __LC_EXIT_TIMER(8),__LC_ASYNC_ENTER_TIMER
1030 clc 4(4,%r12),BASED(cleanup_io_leave_insn+4)
1031 be BASED(2f)
1032#endif
1033 mvc __LC_RETURN_PSW(8),SP_PSW(%r15)
1034 c %r12,BASED(.Lmck_old_psw)
1035 bne BASED(0f)
1036 mvc __LC_SAVE_AREA+32(16),SP_R12(%r15)
1037 b BASED(1f)
10380: mvc __LC_SAVE_AREA+16(16),SP_R12(%r15)
10391: lm %r0,%r11,SP_R0(%r15)
1040 l %r15,SP_R15(%r15)
10412: la %r12,__LC_RETURN_PSW
1042 br %r14
1043cleanup_io_leave_insn:
Heiko Carstens411788e2007-11-20 11:13:32 +01001044 .long io_done - 4 + 0x80000000
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -07001045#ifdef CONFIG_VIRT_CPU_ACCOUNTING
Heiko Carstens411788e2007-11-20 11:13:32 +01001046 .long io_done - 8 + 0x80000000
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -07001047#endif
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -07001048
Linus Torvalds1da177e2005-04-16 15:20:36 -07001049/*
1050 * Integer constants
1051 */
Heiko Carstens25d83cb2006-09-28 16:56:37 +02001052 .align 4
1053.Lc_spsize: .long SP_SIZE
1054.Lc_overhead: .long STACK_FRAME_OVERHEAD
Heiko Carstens25d83cb2006-09-28 16:56:37 +02001055.Lnr_syscalls: .long NR_syscalls
1056.L0x018: .short 0x018
1057.L0x020: .short 0x020
1058.L0x028: .short 0x028
1059.L0x030: .short 0x030
1060.L0x038: .short 0x038
1061.Lc_1: .long 1
Linus Torvalds1da177e2005-04-16 15:20:36 -07001062
1063/*
1064 * Symbol constants
1065 */
Heiko Carstens25d83cb2006-09-28 16:56:37 +02001066.Ls390_mcck: .long s390_do_machine_check
Heiko Carstens77fa2242005-06-25 14:55:30 -07001067.Ls390_handle_mcck:
Heiko Carstens25d83cb2006-09-28 16:56:37 +02001068 .long s390_handle_mcck
1069.Lmck_old_psw: .long __LC_MCK_OLD_PSW
1070.Ldo_IRQ: .long do_IRQ
1071.Ldo_extint: .long do_extint
1072.Ldo_signal: .long do_signal
1073.Lhandle_per: .long do_single_step
Martin Schwidefsky03ff9a22007-04-27 16:01:40 +02001074.Ldo_execve: .long do_execve
1075.Lexecve_tail: .long execve_tail
Heiko Carstens25d83cb2006-09-28 16:56:37 +02001076.Ljump_table: .long pgm_check_table
1077.Lschedule: .long schedule
Christian Borntraegerab1809b2007-12-04 16:09:04 +01001078#ifdef CONFIG_PREEMPT
Heiko Carstensb8e7a542007-11-20 11:13:35 +01001079.Lpreempt_schedule_irq:
1080 .long preempt_schedule_irq
Christian Borntraegerab1809b2007-12-04 16:09:04 +01001081#endif
Heiko Carstens25d83cb2006-09-28 16:56:37 +02001082.Ltrace: .long syscall_trace
Heiko Carstens25d83cb2006-09-28 16:56:37 +02001083.Lschedtail: .long schedule_tail
1084.Lsysc_table: .long sys_call_table
Heiko Carstens1f194a42006-07-03 00:24:46 -07001085#ifdef CONFIG_TRACE_IRQFLAGS
Heiko Carstens25d83cb2006-09-28 16:56:37 +02001086.Ltrace_irq_on: .long trace_hardirqs_on
Heiko Carstens1f194a42006-07-03 00:24:46 -07001087.Ltrace_irq_off:
Heiko Carstens25d83cb2006-09-28 16:56:37 +02001088 .long trace_hardirqs_off
Heiko Carstens523b44c2007-10-11 22:11:12 +02001089.Llockdep_sys_exit:
1090 .long lockdep_sys_exit
Heiko Carstens1f194a42006-07-03 00:24:46 -07001091#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07001092.Lcritical_start:
Heiko Carstens25d83cb2006-09-28 16:56:37 +02001093 .long __critical_start + 0x80000000
Linus Torvalds1da177e2005-04-16 15:20:36 -07001094.Lcritical_end:
Heiko Carstens25d83cb2006-09-28 16:56:37 +02001095 .long __critical_end + 0x80000000
Linus Torvalds1da177e2005-04-16 15:20:36 -07001096.Lcleanup_critical:
Heiko Carstens25d83cb2006-09-28 16:56:37 +02001097 .long cleanup_critical
Linus Torvalds1da177e2005-04-16 15:20:36 -07001098
Heiko Carstens25d83cb2006-09-28 16:56:37 +02001099 .section .rodata, "a"
Linus Torvalds1da177e2005-04-16 15:20:36 -07001100#define SYSCALL(esa,esame,emu) .long esa
Linus Torvalds1da177e2005-04-16 15:20:36 -07001101sys_call_table:
1102#include "syscalls.S"
1103#undef SYSCALL