blob: efde6e178f6c22733322ac6c5048cdfed8c7e28b [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Heiko Carstens54dfe5d2006-02-01 03:06:38 -08002 * arch/s390/kernel/entry64.S
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 * 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 + 8
33SP_R2 = STACK_FRAME_OVERHEAD + __PT_GPRS + 16
34SP_R3 = STACK_FRAME_OVERHEAD + __PT_GPRS + 24
35SP_R4 = STACK_FRAME_OVERHEAD + __PT_GPRS + 32
36SP_R5 = STACK_FRAME_OVERHEAD + __PT_GPRS + 40
37SP_R6 = STACK_FRAME_OVERHEAD + __PT_GPRS + 48
38SP_R7 = STACK_FRAME_OVERHEAD + __PT_GPRS + 56
39SP_R8 = STACK_FRAME_OVERHEAD + __PT_GPRS + 64
40SP_R9 = STACK_FRAME_OVERHEAD + __PT_GPRS + 72
41SP_R10 = STACK_FRAME_OVERHEAD + __PT_GPRS + 80
42SP_R11 = STACK_FRAME_OVERHEAD + __PT_GPRS + 88
43SP_R12 = STACK_FRAME_OVERHEAD + __PT_GPRS + 96
44SP_R13 = STACK_FRAME_OVERHEAD + __PT_GPRS + 104
45SP_R14 = STACK_FRAME_OVERHEAD + __PT_GPRS + 112
46SP_R15 = STACK_FRAME_OVERHEAD + __PT_GPRS + 120
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
52STACK_SHIFT = PAGE_SHIFT + THREAD_ORDER
53STACK_SIZE = 1 << STACK_SHIFT
54
Heiko Carstens54dfe5d2006-02-01 03:06:38 -080055_TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | _TIF_NEED_RESCHED | \
56 _TIF_MCCK_PENDING | _TIF_RESTART_SVC | _TIF_SINGLE_STEP )
57_TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | _TIF_NEED_RESCHED | \
58 _TIF_MCCK_PENDING)
Linus Torvalds1da177e2005-04-16 15:20:36 -070059
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 brasl %r14,trace_hardirqs_on
65 .endm
66
67 .macro TRACE_IRQS_OFF
68 brasl %r14,trace_hardirqs_off
69 .endm
Heiko Carstens523b44c2007-10-11 22:11:12 +020070
Heiko Carstens411788e2007-11-20 11:13:32 +010071 .macro TRACE_IRQS_CHECK
72 tm SP_PSW(%r15),0x03 # irqs enabled?
73 jz 0f
74 brasl %r14,trace_hardirqs_on
75 j 1f
760: brasl %r14,trace_hardirqs_off
771:
Heiko Carstens523b44c2007-10-11 22:11:12 +020078 .endm
Heiko Carstens1f194a42006-07-03 00:24:46 -070079#else
80#define TRACE_IRQS_ON
81#define TRACE_IRQS_OFF
Heiko Carstens411788e2007-11-20 11:13:32 +010082#define TRACE_IRQS_CHECK
83#endif
84
85#ifdef CONFIG_LOCKDEP
86 .macro LOCKDEP_SYS_EXIT
87 tm SP_PSW+1(%r15),0x01 # returning to user ?
88 jz 0f
89 brasl %r14,lockdep_sys_exit
900:
91 .endm
92#else
Heiko Carstens523b44c2007-10-11 22:11:12 +020093#define LOCKDEP_SYS_EXIT
Heiko Carstens1f194a42006-07-03 00:24:46 -070094#endif
95
Heiko Carstens25d83cb2006-09-28 16:56:37 +020096 .macro STORE_TIMER lc_offset
Linus Torvalds1da177e2005-04-16 15:20:36 -070097#ifdef CONFIG_VIRT_CPU_ACCOUNTING
98 stpt \lc_offset
99#endif
100 .endm
101
102#ifdef CONFIG_VIRT_CPU_ACCOUNTING
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200103 .macro UPDATE_VTIME lc_from,lc_to,lc_sum
Linus Torvalds1da177e2005-04-16 15:20:36 -0700104 lg %r10,\lc_from
105 slg %r10,\lc_to
106 alg %r10,\lc_sum
107 stg %r10,\lc_sum
108 .endm
109#endif
110
111/*
112 * Register usage in interrupt handlers:
113 * R9 - pointer to current task structure
114 * R13 - pointer to literal pool
115 * R14 - return register for function calls
116 * R15 - kernel stack pointer
117 */
118
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200119 .macro SAVE_ALL_BASE savearea
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120 stmg %r12,%r15,\savearea
121 larl %r13,system_call
122 .endm
123
Martin Schwidefsky987ad702007-07-10 11:24:18 +0200124 .macro SAVE_ALL_SVC psworg,savearea
125 la %r12,\psworg
126 lg %r15,__LC_KERNEL_STACK # problem state -> load ksp
127 .endm
128
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200129 .macro SAVE_ALL_SYNC psworg,savearea
Linus Torvalds1da177e2005-04-16 15:20:36 -0700130 la %r12,\psworg
Linus Torvalds1da177e2005-04-16 15:20:36 -0700131 tm \psworg+1,0x01 # test problem state bit
132 jz 2f # skip stack setup save
133 lg %r15,__LC_KERNEL_STACK # problem state -> load ksp
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200134#ifdef CONFIG_CHECK_STACK
135 j 3f
1362: tml %r15,STACK_SIZE - CONFIG_STACK_GUARD
137 jz stack_overflow
1383:
139#endif
1402:
141 .endm
142
143 .macro SAVE_ALL_ASYNC psworg,savearea
144 la %r12,\psworg
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145 tm \psworg+1,0x01 # test problem state bit
146 jnz 1f # from user -> load kernel stack
147 clc \psworg+8(8),BASED(.Lcritical_end)
148 jhe 0f
149 clc \psworg+8(8),BASED(.Lcritical_start)
150 jl 0f
151 brasl %r14,cleanup_critical
Peter Oberparleiter6add9f72005-09-16 19:27:42 -0700152 tm 1(%r12),0x01 # retest problem state after cleanup
Linus Torvalds1da177e2005-04-16 15:20:36 -0700153 jnz 1f
1540: lg %r14,__LC_ASYNC_STACK # are we already on the async. stack ?
155 slgr %r14,%r15
156 srag %r14,%r14,STACK_SHIFT
157 jz 2f
1581: lg %r15,__LC_ASYNC_STACK # load async stack
Linus Torvalds1da177e2005-04-16 15:20:36 -0700159#ifdef CONFIG_CHECK_STACK
160 j 3f
1612: tml %r15,STACK_SIZE - CONFIG_STACK_GUARD
162 jz stack_overflow
1633:
164#endif
Heiko Carstens77fa2242005-06-25 14:55:30 -07001652:
166 .endm
167
168 .macro CREATE_STACK_FRAME psworg,savearea
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200169 aghi %r15,-SP_SIZE # make room for registers & psw
170 mvc SP_PSW(16,%r15),0(%r12) # move user PSW to stack
Linus Torvalds1da177e2005-04-16 15:20:36 -0700171 la %r12,\psworg
172 stg %r2,SP_ORIG_R2(%r15) # store original content of gpr 2
173 icm %r12,12,__LC_SVC_ILC
174 stmg %r0,%r11,SP_R0(%r15) # store gprs %r0-%r11 to kernel stack
175 st %r12,SP_ILC(%r15)
176 mvc SP_R12(32,%r15),\savearea # move %r12-%r15 to stack
177 la %r12,0
178 stg %r12,__SF_BACKCHAIN(%r15)
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200179 .endm
Linus Torvalds1da177e2005-04-16 15:20:36 -0700180
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700181 .macro RESTORE_ALL psworg,sync
182 mvc \psworg(16),SP_PSW(%r15) # move user PSW to lowcore
Linus Torvalds1da177e2005-04-16 15:20:36 -0700183 .if !\sync
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700184 ni \psworg+1,0xfd # clear wait state bit
Linus Torvalds1da177e2005-04-16 15:20:36 -0700185 .endif
186 lmg %r0,%r15,SP_R0(%r15) # load gprs 0-15 of user
187 STORE_TIMER __LC_EXIT_TIMER
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700188 lpswe \psworg # back to caller
Linus Torvalds1da177e2005-04-16 15:20:36 -0700189 .endm
190
191/*
192 * Scheduler resume function, called by switch_to
193 * gpr2 = (task_struct *) prev
194 * gpr3 = (task_struct *) next
195 * Returns:
196 * gpr2 = prev
197 */
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200198 .globl __switch_to
Linus Torvalds1da177e2005-04-16 15:20:36 -0700199__switch_to:
200 tm __THREAD_per+4(%r3),0xe8 # is the new process using per ?
201 jz __switch_to_noper # if not we're fine
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200202 stctg %c9,%c11,__SF_EMPTY(%r15)# We are using per stuff
203 clc __THREAD_per(24,%r3),__SF_EMPTY(%r15)
204 je __switch_to_noper # we got away without bashing TLB's
205 lctlg %c9,%c11,__THREAD_per(%r3) # Nope we didn't
Linus Torvalds1da177e2005-04-16 15:20:36 -0700206__switch_to_noper:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200207 lg %r4,__THREAD_info(%r2) # get thread_info of prev
Heiko Carstens77fa2242005-06-25 14:55:30 -0700208 tm __TI_flags+7(%r4),_TIF_MCCK_PENDING # machine check pending?
209 jz __switch_to_no_mcck
210 ni __TI_flags+7(%r4),255-_TIF_MCCK_PENDING # clear flag in prev
211 lg %r4,__THREAD_info(%r3) # get thread_info of next
212 oi __TI_flags+7(%r4),_TIF_MCCK_PENDING # set it in next
213__switch_to_no_mcck:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200214 stmg %r6,%r15,__SF_GPRS(%r15)# store __switch_to registers of prev task
Linus Torvalds1da177e2005-04-16 15:20:36 -0700215 stg %r15,__THREAD_ksp(%r2) # store kernel stack to prev->tss.ksp
216 lg %r15,__THREAD_ksp(%r3) # load kernel stack from next->tss.ksp
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200217 lmg %r6,%r15,__SF_GPRS(%r15)# load __switch_to registers of next task
Linus Torvalds1da177e2005-04-16 15:20:36 -0700218 stg %r3,__LC_CURRENT # __LC_CURRENT = current task struct
219 lctl %c4,%c4,__TASK_pid(%r3) # load pid to control reg. 4
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200220 lg %r3,__THREAD_info(%r3) # load thread_info from task struct
Linus Torvalds1da177e2005-04-16 15:20:36 -0700221 stg %r3,__LC_THREAD_INFO
222 aghi %r3,STACK_SIZE
223 stg %r3,__LC_KERNEL_STACK # __LC_KERNEL_STACK = new kernel stack
224 br %r14
225
226__critical_start:
227/*
228 * SVC interrupt handler routine. System calls are synchronous events and
229 * are executed with interrupts enabled.
230 */
231
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200232 .globl system_call
Linus Torvalds1da177e2005-04-16 15:20:36 -0700233system_call:
234 STORE_TIMER __LC_SYNC_ENTER_TIMER
235sysc_saveall:
236 SAVE_ALL_BASE __LC_SAVE_AREA
Martin Schwidefsky987ad702007-07-10 11:24:18 +0200237 SAVE_ALL_SVC __LC_SVC_OLD_PSW,__LC_SAVE_AREA
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200238 CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA
239 llgh %r7,__LC_SVC_INT_CODE # get svc number from lowcore
Linus Torvalds1da177e2005-04-16 15:20:36 -0700240#ifdef CONFIG_VIRT_CPU_ACCOUNTING
241sysc_vtime:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700242 UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER
243sysc_stime:
244 UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
245sysc_update:
246 mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER
247#endif
248sysc_do_svc:
249 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200250 slag %r7,%r7,2 # *4 and test for svc 0
Linus Torvalds1da177e2005-04-16 15:20:36 -0700251 jnz sysc_nr_ok
252 # svc 0: system call number in %r1
253 cl %r1,BASED(.Lnr_syscalls)
254 jnl sysc_nr_ok
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200255 lgfr %r7,%r1 # clear high word in r1
256 slag %r7,%r7,2 # svc 0: system call number in %r1
Linus Torvalds1da177e2005-04-16 15:20:36 -0700257sysc_nr_ok:
258 mvc SP_ARGS(8,%r15),SP_R7(%r15)
259sysc_do_restart:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200260 larl %r10,sys_call_table
Martin Schwidefsky347a8dc2006-01-06 00:19:28 -0800261#ifdef CONFIG_COMPAT
Heiko Carstensc5630772005-09-03 15:58:04 -0700262 tm __TI_flags+5(%r9),(_TIF_31BIT>>16) # running in 31 bit mode ?
263 jno sysc_noemu
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200264 larl %r10,sys_call_table_emu # use 31 bit emulation system calls
Linus Torvalds1da177e2005-04-16 15:20:36 -0700265sysc_noemu:
266#endif
267 tm __TI_flags+7(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200268 lgf %r8,0(%r7,%r10) # load address of system call routine
269 jnz sysc_tracesys
270 basr %r14,%r8 # call sys_xxxx
271 stg %r2,SP_R2(%r15) # store return value (change R2 on stack)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700272
273sysc_return:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200274 tm SP_PSW+1(%r15),0x01 # returning to user ?
Heiko Carstens411788e2007-11-20 11:13:32 +0100275 jno sysc_restore
Linus Torvalds1da177e2005-04-16 15:20:36 -0700276 tm __TI_flags+7(%r9),_TIF_WORK_SVC
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200277 jnz sysc_work # there is work to do (signals etc.)
Heiko Carstens411788e2007-11-20 11:13:32 +0100278sysc_restore:
279#ifdef CONFIG_TRACE_IRQFLAGS
280 larl %r1,sysc_restore_trace_psw
281 lpswe 0(%r1)
282sysc_restore_trace:
283 TRACE_IRQS_CHECK
Heiko Carstens523b44c2007-10-11 22:11:12 +0200284 LOCKDEP_SYS_EXIT
Heiko Carstens411788e2007-11-20 11:13:32 +0100285#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700286sysc_leave:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200287 RESTORE_ALL __LC_RETURN_PSW,1
Heiko Carstens411788e2007-11-20 11:13:32 +0100288sysc_done:
289
290#ifdef CONFIG_TRACE_IRQFLAGS
291 .align 8
292 .globl sysc_restore_trace_psw
293sysc_restore_trace_psw:
294 .quad 0, sysc_restore_trace
295#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700296
297#
298# recheck if there is more work to do
299#
300sysc_work_loop:
301 tm __TI_flags+7(%r9),_TIF_WORK_SVC
Heiko Carstens411788e2007-11-20 11:13:32 +0100302 jz sysc_restore # there is no work to do
Linus Torvalds1da177e2005-04-16 15:20:36 -0700303#
304# One of the work bits is on. Find out which one.
305#
306sysc_work:
Heiko Carstens77fa2242005-06-25 14:55:30 -0700307 tm __TI_flags+7(%r9),_TIF_MCCK_PENDING
308 jo sysc_mcck_pending
Linus Torvalds1da177e2005-04-16 15:20:36 -0700309 tm __TI_flags+7(%r9),_TIF_NEED_RESCHED
310 jo sysc_reschedule
Heiko Carstens54dfe5d2006-02-01 03:06:38 -0800311 tm __TI_flags+7(%r9),(_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK)
312 jnz sysc_sigpending
Linus Torvalds1da177e2005-04-16 15:20:36 -0700313 tm __TI_flags+7(%r9),_TIF_RESTART_SVC
314 jo sysc_restart
315 tm __TI_flags+7(%r9),_TIF_SINGLE_STEP
316 jo sysc_singlestep
Heiko Carstens411788e2007-11-20 11:13:32 +0100317 j sysc_restore
318sysc_work_done:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700319
320#
321# _TIF_NEED_RESCHED is set, call schedule
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200322#
323sysc_reschedule:
324 larl %r14,sysc_work_loop
325 jg schedule # return point is sysc_return
Linus Torvalds1da177e2005-04-16 15:20:36 -0700326
327#
Heiko Carstens77fa2242005-06-25 14:55:30 -0700328# _TIF_MCCK_PENDING is set, call handler
329#
330sysc_mcck_pending:
331 larl %r14,sysc_work_loop
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200332 jg s390_handle_mcck # TIF bit will be cleared by handler
Heiko Carstens77fa2242005-06-25 14:55:30 -0700333
334#
Heiko Carstens54dfe5d2006-02-01 03:06:38 -0800335# _TIF_SIGPENDING or _TIF_RESTORE_SIGMASK is set, call do_signal
Linus Torvalds1da177e2005-04-16 15:20:36 -0700336#
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200337sysc_sigpending:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700338 ni __TI_flags+7(%r9),255-_TIF_SINGLE_STEP # clear TIF_SINGLE_STEP
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200339 la %r2,SP_PTREGS(%r15) # load pt_regs
340 brasl %r14,do_signal # call do_signal
Linus Torvalds1da177e2005-04-16 15:20:36 -0700341 tm __TI_flags+7(%r9),_TIF_RESTART_SVC
342 jo sysc_restart
343 tm __TI_flags+7(%r9),_TIF_SINGLE_STEP
344 jo sysc_singlestep
Heiko Carstense1c3ad92005-11-07 00:59:02 -0800345 j sysc_work_loop
Linus Torvalds1da177e2005-04-16 15:20:36 -0700346
347#
348# _TIF_RESTART_SVC is set, set up registers and restart svc
349#
350sysc_restart:
351 ni __TI_flags+7(%r9),255-_TIF_RESTART_SVC # clear TIF_RESTART_SVC
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200352 lg %r7,SP_R2(%r15) # load new svc number
353 slag %r7,%r7,2 # *4
Linus Torvalds1da177e2005-04-16 15:20:36 -0700354 mvc SP_R2(8,%r15),SP_ORIG_R2(%r15) # restore first argument
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200355 lmg %r2,%r6,SP_R2(%r15) # load svc arguments
356 j sysc_do_restart # restart svc
Linus Torvalds1da177e2005-04-16 15:20:36 -0700357
358#
359# _TIF_SINGLE_STEP is set, call do_single_step
360#
361sysc_singlestep:
362 ni __TI_flags+7(%r9),255-_TIF_SINGLE_STEP # clear TIF_SINGLE_STEP
363 lhi %r0,__LC_PGM_OLD_PSW
364 sth %r0,SP_TRAP(%r15) # set trap indication to pgm check
365 la %r2,SP_PTREGS(%r15) # address of register-save area
366 larl %r14,sysc_return # load adr. of system return
367 jg do_single_step # branch to do_sigtrap
368
Linus Torvalds1da177e2005-04-16 15:20:36 -0700369#
370# call syscall_trace before and after system call
371# special linkage: %r12 contains the return address for trace_svc
372#
373sysc_tracesys:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200374 la %r2,SP_PTREGS(%r15) # load pt_regs
Linus Torvalds1da177e2005-04-16 15:20:36 -0700375 la %r3,0
376 srl %r7,2
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200377 stg %r7,SP_R2(%r15)
378 brasl %r14,syscall_trace
Linus Torvalds1da177e2005-04-16 15:20:36 -0700379 lghi %r0,NR_syscalls
380 clg %r0,SP_R2(%r15)
381 jnh sysc_tracenogo
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200382 lg %r7,SP_R2(%r15) # strace might have changed the
383 sll %r7,2 # system call
Linus Torvalds1da177e2005-04-16 15:20:36 -0700384 lgf %r8,0(%r7,%r10)
385sysc_tracego:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200386 lmg %r3,%r6,SP_R3(%r15)
387 lg %r2,SP_ORIG_R2(%r15)
388 basr %r14,%r8 # call sys_xxx
389 stg %r2,SP_R2(%r15) # store return value
Linus Torvalds1da177e2005-04-16 15:20:36 -0700390sysc_tracenogo:
391 tm __TI_flags+7(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200392 jz sysc_return
393 la %r2,SP_PTREGS(%r15) # load pt_regs
Linus Torvalds1da177e2005-04-16 15:20:36 -0700394 la %r3,1
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200395 larl %r14,sysc_return # return point is sysc_return
Linus Torvalds1da177e2005-04-16 15:20:36 -0700396 jg syscall_trace
397
398#
399# a new process exits the kernel with ret_from_fork
400#
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200401 .globl ret_from_fork
Linus Torvalds1da177e2005-04-16 15:20:36 -0700402ret_from_fork:
403 lg %r13,__LC_SVC_NEW_PSW+8
404 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct
405 tm SP_PSW+1(%r15),0x01 # forking a kernel thread ?
406 jo 0f
407 stg %r15,SP_R15(%r15) # store stack pointer for new kthread
Heiko Carstens25d83cb2006-09-28 16:56:37 +02004080: brasl %r14,schedule_tail
Heiko Carstens1f194a42006-07-03 00:24:46 -0700409 TRACE_IRQS_ON
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200410 stosm 24(%r15),0x03 # reenable interrupts
Linus Torvalds1da177e2005-04-16 15:20:36 -0700411 j sysc_return
412
413#
Martin Schwidefsky03ff9a22007-04-27 16:01:40 +0200414# kernel_execve function needs to deal with pt_regs that is not
415# at the usual place
Linus Torvalds1da177e2005-04-16 15:20:36 -0700416#
Martin Schwidefsky03ff9a22007-04-27 16:01:40 +0200417 .globl kernel_execve
418kernel_execve:
419 stmg %r12,%r15,96(%r15)
420 lgr %r14,%r15
421 aghi %r15,-SP_SIZE
422 stg %r14,__SF_BACKCHAIN(%r15)
423 la %r12,SP_PTREGS(%r15)
424 xc 0(__PT_SIZE,%r12),0(%r12)
425 lgr %r5,%r12
426 brasl %r14,do_execve
427 ltgfr %r2,%r2
428 je 0f
429 aghi %r15,SP_SIZE
430 lmg %r12,%r15,96(%r15)
431 br %r14
432 # execve succeeded.
4330: stnsm __SF_EMPTY(%r15),0xfc # disable interrupts
434 lg %r15,__LC_KERNEL_STACK # load ksp
435 aghi %r15,-SP_SIZE # make room for registers & psw
436 lg %r13,__LC_SVC_NEW_PSW+8
437 lg %r9,__LC_THREAD_INFO
438 mvc SP_PTREGS(__PT_SIZE,%r15),0(%r12) # copy pt_regs
439 xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
440 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts
441 brasl %r14,execve_tail
442 j sysc_return
Linus Torvalds1da177e2005-04-16 15:20:36 -0700443
444/*
445 * Program check handler routine
446 */
447
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200448 .globl pgm_check_handler
Linus Torvalds1da177e2005-04-16 15:20:36 -0700449pgm_check_handler:
450/*
451 * First we need to check for a special case:
452 * Single stepping an instruction that disables the PER event mask will
453 * cause a PER event AFTER the mask has been set. Example: SVC or LPSW.
454 * For a single stepped SVC the program check handler gets control after
455 * the SVC new PSW has been loaded. But we want to execute the SVC first and
456 * then handle the PER event. Therefore we update the SVC old PSW to point
457 * to the pgm_check_handler and branch to the SVC handler after we checked
458 * if we have to load the kernel stack register.
459 * For every other possible cause for PER event without the PER mask set
460 * we just ignore the PER event (FIXME: is there anything we have to do
461 * for LPSW?).
462 */
463 STORE_TIMER __LC_SYNC_ENTER_TIMER
464 SAVE_ALL_BASE __LC_SAVE_AREA
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200465 tm __LC_PGM_INT_CODE+1,0x80 # check whether we got a per exception
466 jnz pgm_per # got per exception -> special case
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200467 SAVE_ALL_SYNC __LC_PGM_OLD_PSW,__LC_SAVE_AREA
Heiko Carstens77fa2242005-06-25 14:55:30 -0700468 CREATE_STACK_FRAME __LC_PGM_OLD_PSW,__LC_SAVE_AREA
Linus Torvalds1da177e2005-04-16 15:20:36 -0700469#ifdef CONFIG_VIRT_CPU_ACCOUNTING
470 tm SP_PSW+1(%r15),0x01 # interrupting from user ?
471 jz pgm_no_vtime
472 UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER
473 UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
474 mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER
475pgm_no_vtime:
476#endif
477 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct
Heiko Carstens411788e2007-11-20 11:13:32 +0100478 TRACE_IRQS_OFF
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200479 lgf %r3,__LC_PGM_ILC # load program interruption code
Linus Torvalds1da177e2005-04-16 15:20:36 -0700480 lghi %r8,0x7f
481 ngr %r8,%r3
482pgm_do_call:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200483 sll %r8,3
484 larl %r1,pgm_check_table
485 lg %r1,0(%r8,%r1) # load address of handler routine
486 la %r2,SP_PTREGS(%r15) # address of register-save area
Linus Torvalds1da177e2005-04-16 15:20:36 -0700487 larl %r14,sysc_return
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200488 br %r1 # branch to interrupt-handler
Linus Torvalds1da177e2005-04-16 15:20:36 -0700489
490#
491# handle per exception
492#
493pgm_per:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200494 tm __LC_PGM_OLD_PSW,0x40 # test if per event recording is on
495 jnz pgm_per_std # ok, normal per event from user space
Linus Torvalds1da177e2005-04-16 15:20:36 -0700496# ok its one of the special cases, now we need to find out which one
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200497 clc __LC_PGM_OLD_PSW(16),__LC_SVC_NEW_PSW
498 je pgm_svcper
Linus Torvalds1da177e2005-04-16 15:20:36 -0700499# no interesting special case, ignore PER event
500 lmg %r12,%r15,__LC_SAVE_AREA
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200501 lpswe __LC_PGM_OLD_PSW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700502
503#
504# Normal per exception
505#
506pgm_per_std:
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200507 SAVE_ALL_SYNC __LC_PGM_OLD_PSW,__LC_SAVE_AREA
Heiko Carstens77fa2242005-06-25 14:55:30 -0700508 CREATE_STACK_FRAME __LC_PGM_OLD_PSW,__LC_SAVE_AREA
Linus Torvalds1da177e2005-04-16 15:20:36 -0700509#ifdef CONFIG_VIRT_CPU_ACCOUNTING
510 tm SP_PSW+1(%r15),0x01 # interrupting from user ?
511 jz pgm_no_vtime2
512 UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER
513 UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
514 mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER
515pgm_no_vtime2:
516#endif
517 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct
Heiko Carstens411788e2007-11-20 11:13:32 +0100518 TRACE_IRQS_OFF
Linus Torvalds1da177e2005-04-16 15:20:36 -0700519 lg %r1,__TI_task(%r9)
Michael Grundy4ba069b2006-09-20 15:58:39 +0200520 tm SP_PSW+1(%r15),0x01 # kernel per event ?
521 jz kernel_per
Linus Torvalds1da177e2005-04-16 15:20:36 -0700522 mvc __THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID
523 mvc __THREAD_per+__PER_address(8,%r1),__LC_PER_ADDRESS
524 mvc __THREAD_per+__PER_access_id(1,%r1),__LC_PER_ACCESS_ID
525 oi __TI_flags+7(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200526 lgf %r3,__LC_PGM_ILC # load program interruption code
Linus Torvalds1da177e2005-04-16 15:20:36 -0700527 lghi %r8,0x7f
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200528 ngr %r8,%r3 # clear per-event-bit and ilc
Linus Torvalds1da177e2005-04-16 15:20:36 -0700529 je sysc_return
530 j pgm_do_call
531
532#
533# it was a single stepped SVC that is causing all the trouble
534#
535pgm_svcper:
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200536 SAVE_ALL_SYNC __LC_SVC_OLD_PSW,__LC_SAVE_AREA
Heiko Carstens77fa2242005-06-25 14:55:30 -0700537 CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA
Linus Torvalds1da177e2005-04-16 15:20:36 -0700538#ifdef CONFIG_VIRT_CPU_ACCOUNTING
Linus Torvalds1da177e2005-04-16 15:20:36 -0700539 UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER
540 UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
541 mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER
Linus Torvalds1da177e2005-04-16 15:20:36 -0700542#endif
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200543 llgh %r7,__LC_SVC_INT_CODE # get svc number from lowcore
Linus Torvalds1da177e2005-04-16 15:20:36 -0700544 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct
545 lg %r1,__TI_task(%r9)
546 mvc __THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID
547 mvc __THREAD_per+__PER_address(8,%r1),__LC_PER_ADDRESS
548 mvc __THREAD_per+__PER_access_id(1,%r1),__LC_PER_ACCESS_ID
549 oi __TI_flags+7(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP
Heiko Carstens1f194a42006-07-03 00:24:46 -0700550 TRACE_IRQS_ON
Linus Torvalds1da177e2005-04-16 15:20:36 -0700551 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts
552 j sysc_do_svc
553
Michael Grundy4ba069b2006-09-20 15:58:39 +0200554#
555# per was called from kernel, must be kprobes
556#
557kernel_per:
558 lhi %r0,__LC_PGM_OLD_PSW
559 sth %r0,SP_TRAP(%r15) # set trap indication to pgm check
560 la %r2,SP_PTREGS(%r15) # address of register-save area
Heiko Carstens411788e2007-11-20 11:13:32 +0100561 larl %r14,sysc_restore # load adr. of system ret, no work
Michael Grundy4ba069b2006-09-20 15:58:39 +0200562 jg do_single_step # branch to do_single_step
563
Linus Torvalds1da177e2005-04-16 15:20:36 -0700564/*
565 * IO interrupt handler routine
566 */
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200567 .globl io_int_handler
Linus Torvalds1da177e2005-04-16 15:20:36 -0700568io_int_handler:
569 STORE_TIMER __LC_ASYNC_ENTER_TIMER
570 stck __LC_INT_CLOCK
571 SAVE_ALL_BASE __LC_SAVE_AREA+32
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200572 SAVE_ALL_ASYNC __LC_IO_OLD_PSW,__LC_SAVE_AREA+32
Heiko Carstens77fa2242005-06-25 14:55:30 -0700573 CREATE_STACK_FRAME __LC_IO_OLD_PSW,__LC_SAVE_AREA+32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700574#ifdef CONFIG_VIRT_CPU_ACCOUNTING
575 tm SP_PSW+1(%r15),0x01 # interrupting from user ?
576 jz io_no_vtime
577 UPDATE_VTIME __LC_EXIT_TIMER,__LC_ASYNC_ENTER_TIMER,__LC_USER_TIMER
578 UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
579 mvc __LC_LAST_UPDATE_TIMER(8),__LC_ASYNC_ENTER_TIMER
580io_no_vtime:
581#endif
582 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct
Heiko Carstens1f194a42006-07-03 00:24:46 -0700583 TRACE_IRQS_OFF
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200584 la %r2,SP_PTREGS(%r15) # address of register-save area
585 brasl %r14,do_IRQ # call standard irq handler
Linus Torvalds1da177e2005-04-16 15:20:36 -0700586io_return:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200587 tm SP_PSW+1(%r15),0x01 # returning to user ?
Linus Torvalds1da177e2005-04-16 15:20:36 -0700588#ifdef CONFIG_PREEMPT
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200589 jno io_preempt # no -> check for preemptive scheduling
Linus Torvalds1da177e2005-04-16 15:20:36 -0700590#else
Heiko Carstens411788e2007-11-20 11:13:32 +0100591 jno io_restore # no-> skip resched & signal
Linus Torvalds1da177e2005-04-16 15:20:36 -0700592#endif
593 tm __TI_flags+7(%r9),_TIF_WORK_INT
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200594 jnz io_work # there is work to do (signals etc.)
Heiko Carstens411788e2007-11-20 11:13:32 +0100595io_restore:
596#ifdef CONFIG_TRACE_IRQFLAGS
597 larl %r1,io_restore_trace_psw
598 lpswe 0(%r1)
599io_restore_trace:
600 TRACE_IRQS_CHECK
Heiko Carstens523b44c2007-10-11 22:11:12 +0200601 LOCKDEP_SYS_EXIT
Heiko Carstens411788e2007-11-20 11:13:32 +0100602#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700603io_leave:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200604 RESTORE_ALL __LC_RETURN_PSW,0
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700605io_done:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700606
Heiko Carstens411788e2007-11-20 11:13:32 +0100607#ifdef CONFIG_TRACE_IRQFLAGS
608 .align 8
609 .globl io_restore_trace_psw
610io_restore_trace_psw:
611 .quad 0, io_restore_trace
612#endif
613
Linus Torvalds1da177e2005-04-16 15:20:36 -0700614#ifdef CONFIG_PREEMPT
615io_preempt:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200616 icm %r0,15,__TI_precount(%r9)
Heiko Carstens411788e2007-11-20 11:13:32 +0100617 jnz io_restore
Linus Torvalds1da177e2005-04-16 15:20:36 -0700618 # switch to kernel stack
619 lg %r1,SP_R15(%r15)
620 aghi %r1,-SP_SIZE
621 mvc SP_PTREGS(__PT_SIZE,%r1),SP_PTREGS(%r15)
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200622 xc __SF_BACKCHAIN(8,%r1),__SF_BACKCHAIN(%r1) # clear back chain
Linus Torvalds1da177e2005-04-16 15:20:36 -0700623 lgr %r15,%r1
624io_resume_loop:
625 tm __TI_flags+7(%r9),_TIF_NEED_RESCHED
Heiko Carstens411788e2007-11-20 11:13:32 +0100626 jno io_restore
Heiko Carstensb8e7a542007-11-20 11:13:35 +0100627 larl %r14,io_resume_loop
628 jg preempt_schedule_irq
Linus Torvalds1da177e2005-04-16 15:20:36 -0700629#endif
630
631#
632# switch to kernel stack, then check TIF bits
633#
634io_work:
635 lg %r1,__LC_KERNEL_STACK
636 aghi %r1,-SP_SIZE
637 mvc SP_PTREGS(__PT_SIZE,%r1),SP_PTREGS(%r15)
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200638 xc __SF_BACKCHAIN(8,%r1),__SF_BACKCHAIN(%r1) # clear back chain
Linus Torvalds1da177e2005-04-16 15:20:36 -0700639 lgr %r15,%r1
640#
641# One of the work bits is on. Find out which one.
Heiko Carstens54dfe5d2006-02-01 03:06:38 -0800642# Checked are: _TIF_SIGPENDING, _TIF_RESTORE_SIGPENDING, _TIF_NEED_RESCHED
643# and _TIF_MCCK_PENDING
Linus Torvalds1da177e2005-04-16 15:20:36 -0700644#
645io_work_loop:
Heiko Carstens77fa2242005-06-25 14:55:30 -0700646 tm __TI_flags+7(%r9),_TIF_MCCK_PENDING
647 jo io_mcck_pending
Linus Torvalds1da177e2005-04-16 15:20:36 -0700648 tm __TI_flags+7(%r9),_TIF_NEED_RESCHED
649 jo io_reschedule
Heiko Carstens54dfe5d2006-02-01 03:06:38 -0800650 tm __TI_flags+7(%r9),(_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK)
651 jnz io_sigpending
Heiko Carstens411788e2007-11-20 11:13:32 +0100652 j io_restore
653io_work_done:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700654
655#
Heiko Carstens77fa2242005-06-25 14:55:30 -0700656# _TIF_MCCK_PENDING is set, call handler
657#
658io_mcck_pending:
Heiko Carstensb771aea2007-07-27 12:29:18 +0200659 brasl %r14,s390_handle_mcck # TIF bit will be cleared by handler
Heiko Carstensb771aea2007-07-27 12:29:18 +0200660 j io_work_loop
Heiko Carstens77fa2242005-06-25 14:55:30 -0700661
662#
Linus Torvalds1da177e2005-04-16 15:20:36 -0700663# _TIF_NEED_RESCHED is set, call schedule
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200664#
665io_reschedule:
Heiko Carstens411788e2007-11-20 11:13:32 +0100666 TRACE_IRQS_ON
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200667 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts
668 brasl %r14,schedule # call scheduler
669 stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts
Heiko Carstens411788e2007-11-20 11:13:32 +0100670 TRACE_IRQS_OFF
Linus Torvalds1da177e2005-04-16 15:20:36 -0700671 tm __TI_flags+7(%r9),_TIF_WORK_INT
Heiko Carstens411788e2007-11-20 11:13:32 +0100672 jz io_restore # there is no work to do
Linus Torvalds1da177e2005-04-16 15:20:36 -0700673 j io_work_loop
674
675#
Heiko Carstens54dfe5d2006-02-01 03:06:38 -0800676# _TIF_SIGPENDING or _TIF_RESTORE_SIGMASK is set, call do_signal
Linus Torvalds1da177e2005-04-16 15:20:36 -0700677#
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200678io_sigpending:
Heiko Carstens411788e2007-11-20 11:13:32 +0100679 TRACE_IRQS_ON
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200680 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts
681 la %r2,SP_PTREGS(%r15) # load pt_regs
Linus Torvalds1da177e2005-04-16 15:20:36 -0700682 brasl %r14,do_signal # call do_signal
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200683 stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts
Heiko Carstens411788e2007-11-20 11:13:32 +0100684 TRACE_IRQS_OFF
Heiko Carstense1c3ad92005-11-07 00:59:02 -0800685 j io_work_loop
Linus Torvalds1da177e2005-04-16 15:20:36 -0700686
687/*
688 * External interrupt handler routine
689 */
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200690 .globl ext_int_handler
Linus Torvalds1da177e2005-04-16 15:20:36 -0700691ext_int_handler:
692 STORE_TIMER __LC_ASYNC_ENTER_TIMER
693 stck __LC_INT_CLOCK
694 SAVE_ALL_BASE __LC_SAVE_AREA+32
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200695 SAVE_ALL_ASYNC __LC_EXT_OLD_PSW,__LC_SAVE_AREA+32
Heiko Carstens77fa2242005-06-25 14:55:30 -0700696 CREATE_STACK_FRAME __LC_EXT_OLD_PSW,__LC_SAVE_AREA+32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700697#ifdef CONFIG_VIRT_CPU_ACCOUNTING
698 tm SP_PSW+1(%r15),0x01 # interrupting from user ?
699 jz ext_no_vtime
700 UPDATE_VTIME __LC_EXIT_TIMER,__LC_ASYNC_ENTER_TIMER,__LC_USER_TIMER
701 UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
702 mvc __LC_LAST_UPDATE_TIMER(8),__LC_ASYNC_ENTER_TIMER
703ext_no_vtime:
704#endif
705 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct
Heiko Carstens1f194a42006-07-03 00:24:46 -0700706 TRACE_IRQS_OFF
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200707 la %r2,SP_PTREGS(%r15) # address of register-save area
708 llgh %r3,__LC_EXT_INT_CODE # get interruption code
709 brasl %r14,do_extint
Linus Torvalds1da177e2005-04-16 15:20:36 -0700710 j io_return
711
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700712__critical_end:
713
Linus Torvalds1da177e2005-04-16 15:20:36 -0700714/*
715 * Machine check handler routines
716 */
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200717 .globl mcck_int_handler
Linus Torvalds1da177e2005-04-16 15:20:36 -0700718mcck_int_handler:
Heiko Carstens77fa2242005-06-25 14:55:30 -0700719 la %r1,4095 # revalidate r1
720 spt __LC_CPU_TIMER_SAVE_AREA-4095(%r1) # revalidate cpu timer
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200721 lmg %r0,%r15,__LC_GPREGS_SAVE_AREA-4095(%r1)# revalidate gprs
Linus Torvalds1da177e2005-04-16 15:20:36 -0700722 SAVE_ALL_BASE __LC_SAVE_AREA+64
Heiko Carstens77fa2242005-06-25 14:55:30 -0700723 la %r12,__LC_MCK_OLD_PSW
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200724 tm __LC_MCCK_CODE,0x80 # system damage?
Heiko Carstens77fa2242005-06-25 14:55:30 -0700725 jo mcck_int_main # yes -> rest of mcck code invalid
Linus Torvalds1da177e2005-04-16 15:20:36 -0700726#ifdef CONFIG_VIRT_CPU_ACCOUNTING
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200727 la %r14,4095
728 mvc __LC_SAVE_AREA+104(8),__LC_ASYNC_ENTER_TIMER
729 mvc __LC_ASYNC_ENTER_TIMER(8),__LC_CPU_TIMER_SAVE_AREA-4095(%r14)
730 tm __LC_MCCK_CODE+5,0x02 # stored cpu timer value valid?
731 jo 1f
732 la %r14,__LC_SYNC_ENTER_TIMER
733 clc 0(8,%r14),__LC_ASYNC_ENTER_TIMER
734 jl 0f
735 la %r14,__LC_ASYNC_ENTER_TIMER
7360: clc 0(8,%r14),__LC_EXIT_TIMER
737 jl 0f
738 la %r14,__LC_EXIT_TIMER
7390: clc 0(8,%r14),__LC_LAST_UPDATE_TIMER
740 jl 0f
741 la %r14,__LC_LAST_UPDATE_TIMER
7420: spt 0(%r14)
743 mvc __LC_ASYNC_ENTER_TIMER(8),0(%r14)
7441:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700745#endif
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200746 tm __LC_MCCK_CODE+2,0x09 # mwp + ia of old psw valid?
Heiko Carstens77fa2242005-06-25 14:55:30 -0700747 jno mcck_int_main # no -> skip cleanup critical
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200748 tm __LC_MCK_OLD_PSW+1,0x01 # test problem state bit
Heiko Carstens77fa2242005-06-25 14:55:30 -0700749 jnz mcck_int_main # from user -> load kernel stack
750 clc __LC_MCK_OLD_PSW+8(8),BASED(.Lcritical_end)
751 jhe mcck_int_main
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200752 clc __LC_MCK_OLD_PSW+8(8),BASED(.Lcritical_start)
Heiko Carstens77fa2242005-06-25 14:55:30 -0700753 jl mcck_int_main
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200754 brasl %r14,cleanup_critical
Heiko Carstens77fa2242005-06-25 14:55:30 -0700755mcck_int_main:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200756 lg %r14,__LC_PANIC_STACK # are we already on the panic stack?
Heiko Carstens77fa2242005-06-25 14:55:30 -0700757 slgr %r14,%r15
758 srag %r14,%r14,PAGE_SHIFT
759 jz 0f
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200760 lg %r15,__LC_PANIC_STACK # load panic stack
Heiko Carstens77fa2242005-06-25 14:55:30 -07007610: CREATE_STACK_FRAME __LC_MCK_OLD_PSW,__LC_SAVE_AREA+64
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700762#ifdef CONFIG_VIRT_CPU_ACCOUNTING
763 tm __LC_MCCK_CODE+2,0x08 # mwp of old psw valid?
764 jno mcck_no_vtime # no -> no timer update
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200765 tm SP_PSW+1(%r15),0x01 # interrupting from user ?
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700766 jz mcck_no_vtime
767 UPDATE_VTIME __LC_EXIT_TIMER,__LC_ASYNC_ENTER_TIMER,__LC_USER_TIMER
768 UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
769 mvc __LC_LAST_UPDATE_TIMER(8),__LC_ASYNC_ENTER_TIMER
770mcck_no_vtime:
771#endif
Heiko Carstens77fa2242005-06-25 14:55:30 -0700772 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct
773 la %r2,SP_PTREGS(%r15) # load pt_regs
774 brasl %r14,s390_do_machine_check
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200775 tm SP_PSW+1(%r15),0x01 # returning to user ?
Heiko Carstens77fa2242005-06-25 14:55:30 -0700776 jno mcck_return
777 lg %r1,__LC_KERNEL_STACK # switch to kernel stack
778 aghi %r1,-SP_SIZE
779 mvc SP_PTREGS(__PT_SIZE,%r1),SP_PTREGS(%r15)
780 xc __SF_BACKCHAIN(8,%r1),__SF_BACKCHAIN(%r1) # clear back chain
781 lgr %r15,%r1
782 stosm __SF_EMPTY(%r15),0x04 # turn dat on
783 tm __TI_flags+7(%r9),_TIF_MCCK_PENDING
784 jno mcck_return
Heiko Carstens1f194a42006-07-03 00:24:46 -0700785 TRACE_IRQS_OFF
Heiko Carstens77fa2242005-06-25 14:55:30 -0700786 brasl %r14,s390_handle_mcck
Heiko Carstens1f194a42006-07-03 00:24:46 -0700787 TRACE_IRQS_ON
Linus Torvalds1da177e2005-04-16 15:20:36 -0700788mcck_return:
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200789 mvc __LC_RETURN_MCCK_PSW(16),SP_PSW(%r15) # move return PSW
790 ni __LC_RETURN_MCCK_PSW+1,0xfd # clear wait state bit
791 lmg %r0,%r15,SP_R0(%r15) # load gprs 0-15
792#ifdef CONFIG_VIRT_CPU_ACCOUNTING
793 mvc __LC_ASYNC_ENTER_TIMER(8),__LC_SAVE_AREA+104
794 tm __LC_RETURN_MCCK_PSW+1,0x01 # returning to user ?
795 jno 0f
796 stpt __LC_EXIT_TIMER
7970:
798#endif
799 lpswe __LC_RETURN_MCCK_PSW # back to caller
Linus Torvalds1da177e2005-04-16 15:20:36 -0700800
Linus Torvalds1da177e2005-04-16 15:20:36 -0700801/*
802 * Restart interruption handler, kick starter for additional CPUs
803 */
Heiko Carstens84b36a82007-06-19 13:10:03 +0200804#ifdef CONFIG_SMP
Heiko Carstens2bc89b52008-02-05 16:50:40 +0100805 __CPUINIT
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200806 .globl restart_int_handler
Linus Torvalds1da177e2005-04-16 15:20:36 -0700807restart_int_handler:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200808 lg %r15,__LC_SAVE_AREA+120 # load ksp
809 lghi %r10,__LC_CREGS_SAVE_AREA
810 lctlg %c0,%c15,0(%r10) # get new ctl regs
811 lghi %r10,__LC_AREGS_SAVE_AREA
812 lam %a0,%a15,0(%r10)
813 lmg %r6,%r15,__SF_GPRS(%r15) # load registers from clone
814 stosm __SF_EMPTY(%r15),0x04 # now we can turn dat on
815 jg start_secondary
Heiko Carstens84b36a82007-06-19 13:10:03 +0200816 .previous
Linus Torvalds1da177e2005-04-16 15:20:36 -0700817#else
818/*
819 * If we do not run with SMP enabled, let the new CPU crash ...
820 */
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200821 .globl restart_int_handler
Linus Torvalds1da177e2005-04-16 15:20:36 -0700822restart_int_handler:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200823 basr %r1,0
Linus Torvalds1da177e2005-04-16 15:20:36 -0700824restart_base:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200825 lpswe restart_crash-restart_base(%r1)
826 .align 8
Linus Torvalds1da177e2005-04-16 15:20:36 -0700827restart_crash:
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200828 .long 0x000a0000,0x00000000,0x00000000,0x00000000
Linus Torvalds1da177e2005-04-16 15:20:36 -0700829restart_go:
830#endif
831
832#ifdef CONFIG_CHECK_STACK
833/*
834 * The synchronous or the asynchronous stack overflowed. We are dead.
835 * No need to properly save the registers, we are going to panic anyway.
836 * Setup a pt_regs so that show_trace can provide a good call trace.
837 */
838stack_overflow:
839 lg %r15,__LC_PANIC_STACK # change to panic stack
Heiko Carstens9514e232006-09-20 15:59:22 +0200840 aghi %r15,-SP_SIZE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700841 mvc SP_PSW(16,%r15),0(%r12) # move user PSW to stack
842 stmg %r0,%r11,SP_R0(%r15) # store gprs %r0-%r11 to kernel stack
843 la %r1,__LC_SAVE_AREA
844 chi %r12,__LC_SVC_OLD_PSW
845 je 0f
846 chi %r12,__LC_PGM_OLD_PSW
847 je 0f
Heiko Carstens9514e232006-09-20 15:59:22 +0200848 la %r1,__LC_SAVE_AREA+32
Heiko Carstens25d83cb2006-09-28 16:56:37 +02008490: mvc SP_R12(32,%r15),0(%r1) # move %r12-%r15 to stack
850 xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) # clear back chain
851 la %r2,SP_PTREGS(%r15) # load pt_regs
Linus Torvalds1da177e2005-04-16 15:20:36 -0700852 jg kernel_stack_overflow
853#endif
854
855cleanup_table_system_call:
856 .quad system_call, sysc_do_svc
857cleanup_table_sysc_return:
858 .quad sysc_return, sysc_leave
859cleanup_table_sysc_leave:
Heiko Carstens411788e2007-11-20 11:13:32 +0100860 .quad sysc_leave, sysc_done
Linus Torvalds1da177e2005-04-16 15:20:36 -0700861cleanup_table_sysc_work_loop:
Heiko Carstens411788e2007-11-20 11:13:32 +0100862 .quad sysc_work_loop, sysc_work_done
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200863cleanup_table_io_return:
864 .quad io_return, io_leave
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700865cleanup_table_io_leave:
866 .quad io_leave, io_done
867cleanup_table_io_work_loop:
Heiko Carstens411788e2007-11-20 11:13:32 +0100868 .quad io_work_loop, io_work_done
Linus Torvalds1da177e2005-04-16 15:20:36 -0700869
870cleanup_critical:
871 clc 8(8,%r12),BASED(cleanup_table_system_call)
872 jl 0f
873 clc 8(8,%r12),BASED(cleanup_table_system_call+8)
874 jl cleanup_system_call
8750:
876 clc 8(8,%r12),BASED(cleanup_table_sysc_return)
877 jl 0f
878 clc 8(8,%r12),BASED(cleanup_table_sysc_return+8)
879 jl cleanup_sysc_return
8800:
881 clc 8(8,%r12),BASED(cleanup_table_sysc_leave)
882 jl 0f
883 clc 8(8,%r12),BASED(cleanup_table_sysc_leave+8)
884 jl cleanup_sysc_leave
8850:
886 clc 8(8,%r12),BASED(cleanup_table_sysc_work_loop)
887 jl 0f
888 clc 8(8,%r12),BASED(cleanup_table_sysc_work_loop+8)
Heiko Carstens77fa2242005-06-25 14:55:30 -0700889 jl cleanup_sysc_return
Linus Torvalds1da177e2005-04-16 15:20:36 -07008900:
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200891 clc 8(8,%r12),BASED(cleanup_table_io_return)
892 jl 0f
893 clc 8(8,%r12),BASED(cleanup_table_io_return+8)
894 jl cleanup_io_return
8950:
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700896 clc 8(8,%r12),BASED(cleanup_table_io_leave)
897 jl 0f
898 clc 8(8,%r12),BASED(cleanup_table_io_leave+8)
899 jl cleanup_io_leave
9000:
901 clc 8(8,%r12),BASED(cleanup_table_io_work_loop)
902 jl 0f
903 clc 8(8,%r12),BASED(cleanup_table_io_work_loop+8)
904 jl cleanup_io_return
9050:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700906 br %r14
907
908cleanup_system_call:
909 mvc __LC_RETURN_PSW(16),0(%r12)
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700910 cghi %r12,__LC_MCK_OLD_PSW
911 je 0f
912 la %r12,__LC_SAVE_AREA+32
913 j 1f
9140: la %r12,__LC_SAVE_AREA+64
9151:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700916#ifdef CONFIG_VIRT_CPU_ACCOUNTING
917 clc __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn+8)
918 jh 0f
919 mvc __LC_SYNC_ENTER_TIMER(8),__LC_ASYNC_ENTER_TIMER
9200: clc __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn+16)
921 jhe cleanup_vtime
922#endif
923 clc __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn)
924 jh 0f
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700925 mvc __LC_SAVE_AREA(32),0(%r12)
9260: stg %r13,8(%r12)
927 stg %r12,__LC_SAVE_AREA+96 # argh
Martin Schwidefsky63b12242006-06-29 14:58:05 +0200928 SAVE_ALL_SYNC __LC_SVC_OLD_PSW,__LC_SAVE_AREA
Heiko Carstens77fa2242005-06-25 14:55:30 -0700929 CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700930 lg %r12,__LC_SAVE_AREA+96 # argh
931 stg %r15,24(%r12)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700932 llgh %r7,__LC_SVC_INT_CODE
933#ifdef CONFIG_VIRT_CPU_ACCOUNTING
934cleanup_vtime:
935 clc __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn+24)
936 jhe cleanup_stime
Linus Torvalds1da177e2005-04-16 15:20:36 -0700937 UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER
938cleanup_stime:
939 clc __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn+32)
940 jh cleanup_update
941 UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
942cleanup_update:
943 mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER
Linus Torvalds1da177e2005-04-16 15:20:36 -0700944#endif
945 mvc __LC_RETURN_PSW+8(8),BASED(cleanup_table_system_call+8)
946 la %r12,__LC_RETURN_PSW
947 br %r14
948cleanup_system_call_insn:
949 .quad sysc_saveall
950#ifdef CONFIG_VIRT_CPU_ACCOUNTING
Heiko Carstens25d83cb2006-09-28 16:56:37 +0200951 .quad system_call
952 .quad sysc_vtime
953 .quad sysc_stime
954 .quad sysc_update
Linus Torvalds1da177e2005-04-16 15:20:36 -0700955#endif
956
957cleanup_sysc_return:
958 mvc __LC_RETURN_PSW(8),0(%r12)
959 mvc __LC_RETURN_PSW+8(8),BASED(cleanup_table_sysc_return)
960 la %r12,__LC_RETURN_PSW
961 br %r14
962
963cleanup_sysc_leave:
964 clc 8(8,%r12),BASED(cleanup_sysc_leave_insn)
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700965 je 2f
Linus Torvalds1da177e2005-04-16 15:20:36 -0700966#ifdef CONFIG_VIRT_CPU_ACCOUNTING
967 mvc __LC_EXIT_TIMER(8),__LC_ASYNC_ENTER_TIMER
968 clc 8(8,%r12),BASED(cleanup_sysc_leave_insn+8)
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700969 je 2f
Linus Torvalds1da177e2005-04-16 15:20:36 -0700970#endif
971 mvc __LC_RETURN_PSW(16),SP_PSW(%r15)
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700972 cghi %r12,__LC_MCK_OLD_PSW
973 jne 0f
974 mvc __LC_SAVE_AREA+64(32),SP_R12(%r15)
975 j 1f
9760: mvc __LC_SAVE_AREA+32(32),SP_R12(%r15)
9771: lmg %r0,%r11,SP_R0(%r15)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700978 lg %r15,SP_R15(%r15)
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -07009792: la %r12,__LC_RETURN_PSW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700980 br %r14
981cleanup_sysc_leave_insn:
Heiko Carstens411788e2007-11-20 11:13:32 +0100982 .quad sysc_done - 4
Linus Torvalds1da177e2005-04-16 15:20:36 -0700983#ifdef CONFIG_VIRT_CPU_ACCOUNTING
Heiko Carstens411788e2007-11-20 11:13:32 +0100984 .quad sysc_done - 8
Linus Torvalds1da177e2005-04-16 15:20:36 -0700985#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700986
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -0700987cleanup_io_return:
988 mvc __LC_RETURN_PSW(8),0(%r12)
989 mvc __LC_RETURN_PSW+8(8),BASED(cleanup_table_io_work_loop)
990 la %r12,__LC_RETURN_PSW
991 br %r14
992
993cleanup_io_leave:
994 clc 8(8,%r12),BASED(cleanup_io_leave_insn)
995 je 2f
996#ifdef CONFIG_VIRT_CPU_ACCOUNTING
997 mvc __LC_EXIT_TIMER(8),__LC_ASYNC_ENTER_TIMER
998 clc 8(8,%r12),BASED(cleanup_io_leave_insn+8)
999 je 2f
1000#endif
1001 mvc __LC_RETURN_PSW(16),SP_PSW(%r15)
1002 cghi %r12,__LC_MCK_OLD_PSW
1003 jne 0f
1004 mvc __LC_SAVE_AREA+64(32),SP_R12(%r15)
1005 j 1f
10060: mvc __LC_SAVE_AREA+32(32),SP_R12(%r15)
10071: lmg %r0,%r11,SP_R0(%r15)
1008 lg %r15,SP_R15(%r15)
10092: la %r12,__LC_RETURN_PSW
1010 br %r14
1011cleanup_io_leave_insn:
Heiko Carstens411788e2007-11-20 11:13:32 +01001012 .quad io_done - 4
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -07001013#ifdef CONFIG_VIRT_CPU_ACCOUNTING
Heiko Carstens411788e2007-11-20 11:13:32 +01001014 .quad io_done - 8
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -07001015#endif
Martin Schwidefskyae6aa2e2005-09-03 15:57:56 -07001016
Linus Torvalds1da177e2005-04-16 15:20:36 -07001017/*
1018 * Integer constants
1019 */
Heiko Carstens25d83cb2006-09-28 16:56:37 +02001020 .align 4
Linus Torvalds1da177e2005-04-16 15:20:36 -07001021.Lconst:
Heiko Carstens25d83cb2006-09-28 16:56:37 +02001022.Lnr_syscalls: .long NR_syscalls
1023.L0x0130: .short 0x130
1024.L0x0140: .short 0x140
1025.L0x0150: .short 0x150
1026.L0x0160: .short 0x160
1027.L0x0170: .short 0x170
Linus Torvalds1da177e2005-04-16 15:20:36 -07001028.Lcritical_start:
Heiko Carstens25d83cb2006-09-28 16:56:37 +02001029 .quad __critical_start
Linus Torvalds1da177e2005-04-16 15:20:36 -07001030.Lcritical_end:
Heiko Carstens25d83cb2006-09-28 16:56:37 +02001031 .quad __critical_end
Linus Torvalds1da177e2005-04-16 15:20:36 -07001032
Heiko Carstens25d83cb2006-09-28 16:56:37 +02001033 .section .rodata, "a"
Linus Torvalds1da177e2005-04-16 15:20:36 -07001034#define SYSCALL(esa,esame,emu) .long esame
Linus Torvalds1da177e2005-04-16 15:20:36 -07001035sys_call_table:
1036#include "syscalls.S"
1037#undef SYSCALL
1038
Martin Schwidefsky347a8dc2006-01-06 00:19:28 -08001039#ifdef CONFIG_COMPAT
Linus Torvalds1da177e2005-04-16 15:20:36 -07001040
1041#define SYSCALL(esa,esame,emu) .long emu
Linus Torvalds1da177e2005-04-16 15:20:36 -07001042sys_call_table_emu:
1043#include "syscalls.S"
1044#undef SYSCALL
1045#endif