Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Heiko Carstens | 54dfe5d | 2006-02-01 03:06:38 -0800 | [diff] [blame] | 2 | * arch/s390/kernel/entry64.S |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * S390 low-level entry points. |
| 4 | * |
Carsten Otte | cd3b70f | 2010-05-17 10:00:04 +0200 | [diff] [blame] | 5 | * Copyright (C) IBM Corp. 1999,2010 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com), |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 7 | * Hartmut Penner (hp@de.ibm.com), |
| 8 | * Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com), |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 9 | * Heiko Carstens <heiko.carstens@de.ibm.com> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | */ |
| 11 | |
Heiko Carstens | 2bc89b5 | 2008-02-05 16:50:40 +0100 | [diff] [blame] | 12 | #include <linux/init.h> |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 13 | #include <linux/linkage.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | #include <asm/cache.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | #include <asm/errno.h> |
| 16 | #include <asm/ptrace.h> |
| 17 | #include <asm/thread_info.h> |
Sam Ravnborg | 0013a85 | 2005-09-09 20:57:26 +0200 | [diff] [blame] | 18 | #include <asm/asm-offsets.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | #include <asm/unistd.h> |
| 20 | #include <asm/page.h> |
| 21 | |
| 22 | /* |
| 23 | * Stack layout for the system_call stack entry. |
| 24 | * The first few entries are identical to the user_regs_struct. |
| 25 | */ |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 26 | SP_PTREGS = STACK_FRAME_OVERHEAD |
| 27 | SP_ARGS = STACK_FRAME_OVERHEAD + __PT_ARGS |
| 28 | SP_PSW = STACK_FRAME_OVERHEAD + __PT_PSW |
| 29 | SP_R0 = STACK_FRAME_OVERHEAD + __PT_GPRS |
| 30 | SP_R1 = STACK_FRAME_OVERHEAD + __PT_GPRS + 8 |
| 31 | SP_R2 = STACK_FRAME_OVERHEAD + __PT_GPRS + 16 |
| 32 | SP_R3 = STACK_FRAME_OVERHEAD + __PT_GPRS + 24 |
| 33 | SP_R4 = STACK_FRAME_OVERHEAD + __PT_GPRS + 32 |
| 34 | SP_R5 = STACK_FRAME_OVERHEAD + __PT_GPRS + 40 |
| 35 | SP_R6 = STACK_FRAME_OVERHEAD + __PT_GPRS + 48 |
| 36 | SP_R7 = STACK_FRAME_OVERHEAD + __PT_GPRS + 56 |
| 37 | SP_R8 = STACK_FRAME_OVERHEAD + __PT_GPRS + 64 |
| 38 | SP_R9 = STACK_FRAME_OVERHEAD + __PT_GPRS + 72 |
| 39 | SP_R10 = STACK_FRAME_OVERHEAD + __PT_GPRS + 80 |
| 40 | SP_R11 = STACK_FRAME_OVERHEAD + __PT_GPRS + 88 |
| 41 | SP_R12 = STACK_FRAME_OVERHEAD + __PT_GPRS + 96 |
| 42 | SP_R13 = STACK_FRAME_OVERHEAD + __PT_GPRS + 104 |
| 43 | SP_R14 = STACK_FRAME_OVERHEAD + __PT_GPRS + 112 |
| 44 | SP_R15 = STACK_FRAME_OVERHEAD + __PT_GPRS + 120 |
| 45 | SP_ORIG_R2 = STACK_FRAME_OVERHEAD + __PT_ORIG_GPR2 |
Martin Schwidefsky | 20b40a7 | 2011-10-30 15:16:47 +0100 | [diff] [blame] | 46 | SP_SVC_CODE = STACK_FRAME_OVERHEAD + __PT_SVC_CODE |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 47 | SP_SIZE = STACK_FRAME_OVERHEAD + __PT_SIZE |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | |
| 49 | STACK_SHIFT = PAGE_SHIFT + THREAD_ORDER |
| 50 | STACK_SIZE = 1 << STACK_SHIFT |
| 51 | |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 52 | _TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \ |
Martin Schwidefsky | b6ef5bb | 2011-10-30 15:16:49 +0100 | [diff] [blame] | 53 | _TIF_MCCK_PENDING | _TIF_PER_TRAP ) |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 54 | _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \ |
Heiko Carstens | 54dfe5d | 2006-02-01 03:06:38 -0800 | [diff] [blame] | 55 | _TIF_MCCK_PENDING) |
Martin Schwidefsky | b6ef5bb | 2011-10-30 15:16:49 +0100 | [diff] [blame] | 56 | _TIF_TRACE = (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SECCOMP | \ |
| 57 | _TIF_SYSCALL_TRACEPOINT) |
Martin Schwidefsky | 603d1a5 | 2011-07-24 10:48:18 +0200 | [diff] [blame] | 58 | _TIF_EXIT_SIE = (_TIF_SIGPENDING | _TIF_NEED_RESCHED | _TIF_MCCK_PENDING) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | |
| 60 | #define BASED(name) name-system_call(%r13) |
| 61 | |
Martin Schwidefsky | 603d1a5 | 2011-07-24 10:48:18 +0200 | [diff] [blame] | 62 | .macro SPP newpp |
| 63 | #if defined(CONFIG_KVM) || defined(CONFIG_KVM_MODULE) |
| 64 | tm __LC_MACHINE_FLAGS+6,0x20 # MACHINE_FLAG_SPP |
| 65 | jz .+8 |
| 66 | .insn s,0xb2800000,\newpp |
| 67 | #endif |
| 68 | .endm |
| 69 | |
Carsten Otte | cd3b70f | 2010-05-17 10:00:04 +0200 | [diff] [blame] | 70 | .macro HANDLE_SIE_INTERCEPT |
| 71 | #if defined(CONFIG_KVM) || defined(CONFIG_KVM_MODULE) |
Martin Schwidefsky | 603d1a5 | 2011-07-24 10:48:18 +0200 | [diff] [blame] | 72 | tm __TI_flags+6(%r12),_TIF_SIE>>8 |
Carsten Otte | cd3b70f | 2010-05-17 10:00:04 +0200 | [diff] [blame] | 73 | jz 0f |
Martin Schwidefsky | ddd6f95 | 2011-12-27 11:27:13 +0100 | [diff] [blame^] | 74 | SPP BASED(.Lhost_id) # set host id |
Martin Schwidefsky | 603d1a5 | 2011-07-24 10:48:18 +0200 | [diff] [blame] | 75 | clc SP_PSW+8(8,%r15),BASED(.Lsie_loop) |
| 76 | jl 0f |
| 77 | clc SP_PSW+8(8,%r15),BASED(.Lsie_done) |
| 78 | jhe 0f |
| 79 | mvc SP_PSW+8(8,%r15),BASED(.Lsie_loop) |
Heiko Carstens | 2ffbb3f | 2010-05-26 23:26:21 +0200 | [diff] [blame] | 80 | 0: |
Carsten Otte | cd3b70f | 2010-05-17 10:00:04 +0200 | [diff] [blame] | 81 | #endif |
| 82 | .endm |
| 83 | |
Heiko Carstens | 1f194a4 | 2006-07-03 00:24:46 -0700 | [diff] [blame] | 84 | #ifdef CONFIG_TRACE_IRQFLAGS |
| 85 | .macro TRACE_IRQS_ON |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 86 | basr %r2,%r0 |
| 87 | brasl %r14,trace_hardirqs_on_caller |
Heiko Carstens | 1f194a4 | 2006-07-03 00:24:46 -0700 | [diff] [blame] | 88 | .endm |
| 89 | |
| 90 | .macro TRACE_IRQS_OFF |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 91 | basr %r2,%r0 |
| 92 | brasl %r14,trace_hardirqs_off_caller |
Heiko Carstens | 1f194a4 | 2006-07-03 00:24:46 -0700 | [diff] [blame] | 93 | .endm |
| 94 | #else |
| 95 | #define TRACE_IRQS_ON |
| 96 | #define TRACE_IRQS_OFF |
Heiko Carstens | 411788e | 2007-11-20 11:13:32 +0100 | [diff] [blame] | 97 | #endif |
| 98 | |
| 99 | #ifdef CONFIG_LOCKDEP |
| 100 | .macro LOCKDEP_SYS_EXIT |
| 101 | tm SP_PSW+1(%r15),0x01 # returning to user ? |
| 102 | jz 0f |
| 103 | brasl %r14,lockdep_sys_exit |
| 104 | 0: |
| 105 | .endm |
| 106 | #else |
Heiko Carstens | 523b44c | 2007-10-11 22:11:12 +0200 | [diff] [blame] | 107 | #define LOCKDEP_SYS_EXIT |
Heiko Carstens | 1f194a4 | 2006-07-03 00:24:46 -0700 | [diff] [blame] | 108 | #endif |
| 109 | |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 110 | .macro UPDATE_VTIME lc_from,lc_to,lc_sum |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 111 | lg %r10,\lc_from |
| 112 | slg %r10,\lc_to |
| 113 | alg %r10,\lc_sum |
| 114 | stg %r10,\lc_sum |
| 115 | .endm |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 116 | |
| 117 | /* |
| 118 | * Register usage in interrupt handlers: |
| 119 | * R9 - pointer to current task structure |
| 120 | * R13 - pointer to literal pool |
| 121 | * R14 - return register for function calls |
| 122 | * R15 - kernel stack pointer |
| 123 | */ |
| 124 | |
Martin Schwidefsky | 987ad70 | 2007-07-10 11:24:18 +0200 | [diff] [blame] | 125 | .macro SAVE_ALL_SVC psworg,savearea |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 126 | stmg %r11,%r15,\savearea |
Martin Schwidefsky | 987ad70 | 2007-07-10 11:24:18 +0200 | [diff] [blame] | 127 | lg %r15,__LC_KERNEL_STACK # problem state -> load ksp |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 128 | aghi %r15,-SP_SIZE # make room for registers & psw |
| 129 | lg %r11,__LC_LAST_BREAK |
Martin Schwidefsky | 987ad70 | 2007-07-10 11:24:18 +0200 | [diff] [blame] | 130 | .endm |
| 131 | |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 132 | .macro SAVE_ALL_PGM psworg,savearea |
| 133 | stmg %r11,%r15,\savearea |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 134 | tm \psworg+1,0x01 # test problem state bit |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 135 | #ifdef CONFIG_CHECK_STACK |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 136 | jnz 1f |
| 137 | tml %r15,STACK_SIZE - CONFIG_STACK_GUARD |
| 138 | jnz 2f |
| 139 | la %r12,\psworg |
| 140 | j stack_overflow |
| 141 | #else |
| 142 | jz 2f |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 143 | #endif |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 144 | 1: lg %r15,__LC_KERNEL_STACK # problem state -> load ksp |
| 145 | 2: aghi %r15,-SP_SIZE # make room for registers & psw |
| 146 | larl %r13,system_call |
| 147 | lg %r11,__LC_LAST_BREAK |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 148 | .endm |
| 149 | |
| 150 | .macro SAVE_ALL_ASYNC psworg,savearea |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 151 | stmg %r11,%r15,\savearea |
| 152 | larl %r13,system_call |
| 153 | lg %r11,__LC_LAST_BREAK |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 154 | la %r12,\psworg |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 155 | tm \psworg+1,0x01 # test problem state bit |
| 156 | jnz 1f # from user -> load kernel stack |
| 157 | clc \psworg+8(8),BASED(.Lcritical_end) |
| 158 | jhe 0f |
| 159 | clc \psworg+8(8),BASED(.Lcritical_start) |
| 160 | jl 0f |
| 161 | brasl %r14,cleanup_critical |
Peter Oberparleiter | 6add9f7 | 2005-09-16 19:27:42 -0700 | [diff] [blame] | 162 | tm 1(%r12),0x01 # retest problem state after cleanup |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 163 | jnz 1f |
| 164 | 0: lg %r14,__LC_ASYNC_STACK # are we already on the async. stack ? |
| 165 | slgr %r14,%r15 |
| 166 | srag %r14,%r14,STACK_SHIFT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 167 | #ifdef CONFIG_CHECK_STACK |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 168 | jnz 1f |
| 169 | tml %r15,STACK_SIZE - CONFIG_STACK_GUARD |
| 170 | jnz 2f |
| 171 | j stack_overflow |
| 172 | #else |
| 173 | jz 2f |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 174 | #endif |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 175 | 1: lg %r15,__LC_ASYNC_STACK # load async stack |
| 176 | 2: aghi %r15,-SP_SIZE # make room for registers & psw |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 177 | .endm |
| 178 | |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 179 | .macro CREATE_STACK_FRAME savearea |
| 180 | xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 181 | stg %r2,SP_ORIG_R2(%r15) # store original content of gpr 2 |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 182 | mvc SP_R11(40,%r15),\savearea # move %r11-%r15 to stack |
| 183 | stmg %r0,%r10,SP_R0(%r15) # store gprs %r0-%r10 to kernel stack |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 184 | .endm |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 185 | |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 186 | .macro RESTORE_ALL psworg,sync |
| 187 | mvc \psworg(16),SP_PSW(%r15) # move user PSW to lowcore |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 188 | .if !\sync |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 189 | ni \psworg+1,0xfd # clear wait state bit |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 190 | .endif |
Martin Schwidefsky | c742b31 | 2008-12-31 15:11:42 +0100 | [diff] [blame] | 191 | lg %r14,__LC_VDSO_PER_CPU |
| 192 | lmg %r0,%r13,SP_R0(%r15) # load gprs 0-13 of user |
Martin Schwidefsky | c185b78 | 2008-12-25 13:39:25 +0100 | [diff] [blame] | 193 | stpt __LC_EXIT_TIMER |
Martin Schwidefsky | c742b31 | 2008-12-31 15:11:42 +0100 | [diff] [blame] | 194 | mvc __VDSO_ECTG_BASE(16,%r14),__LC_EXIT_TIMER |
| 195 | lmg %r14,%r15,SP_R14(%r15) # load grps 14-15 of user |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 196 | lpswe \psworg # back to caller |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 197 | .endm |
| 198 | |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 199 | .macro LAST_BREAK |
| 200 | srag %r10,%r11,23 |
| 201 | jz 0f |
| 202 | stg %r11,__TI_last_break(%r12) |
| 203 | 0: |
| 204 | .endm |
| 205 | |
Martin Schwidefsky | 1e54622 | 2010-10-25 16:10:37 +0200 | [diff] [blame] | 206 | .macro REENABLE_IRQS |
| 207 | mvc __SF_EMPTY(1,%r15),SP_PSW(%r15) |
| 208 | ni __SF_EMPTY(%r15),0xbf |
| 209 | ssm __SF_EMPTY(%r15) |
| 210 | .endm |
| 211 | |
Martin Schwidefsky | 860dba4 | 2011-01-05 12:47:25 +0100 | [diff] [blame] | 212 | .section .kprobes.text, "ax" |
| 213 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 214 | /* |
| 215 | * Scheduler resume function, called by switch_to |
| 216 | * gpr2 = (task_struct *) prev |
| 217 | * gpr3 = (task_struct *) next |
| 218 | * Returns: |
| 219 | * gpr2 = prev |
| 220 | */ |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 221 | ENTRY(__switch_to) |
Martin Schwidefsky | 5e9a269 | 2011-01-05 12:48:10 +0100 | [diff] [blame] | 222 | lg %r4,__THREAD_info(%r2) # get thread_info of prev |
| 223 | lg %r5,__THREAD_info(%r3) # get thread_info of next |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 224 | tm __TI_flags+7(%r4),_TIF_MCCK_PENDING # machine check pending? |
Martin Schwidefsky | 5e9a269 | 2011-01-05 12:48:10 +0100 | [diff] [blame] | 225 | jz 0f |
| 226 | ni __TI_flags+7(%r4),255-_TIF_MCCK_PENDING # clear flag in prev |
| 227 | oi __TI_flags+7(%r5),_TIF_MCCK_PENDING # set it in next |
| 228 | 0: stmg %r6,%r15,__SF_GPRS(%r15) # store gprs of prev task |
| 229 | stg %r15,__THREAD_ksp(%r2) # store kernel stack of prev |
| 230 | lg %r15,__THREAD_ksp(%r3) # load kernel stack of next |
| 231 | lctl %c4,%c4,__TASK_pid(%r3) # load pid to control reg. 4 |
| 232 | lmg %r6,%r15,__SF_GPRS(%r15) # load gprs of next task |
| 233 | stg %r3,__LC_CURRENT # store task struct of next |
Heiko Carstens | f2db2e6 | 2011-05-23 10:24:34 +0200 | [diff] [blame] | 234 | mvc __LC_CURRENT_PID+4(4,%r0),__TASK_pid(%r3) # store pid of next |
Martin Schwidefsky | 5e9a269 | 2011-01-05 12:48:10 +0100 | [diff] [blame] | 235 | stg %r5,__LC_THREAD_INFO # store thread info of next |
| 236 | aghi %r5,STACK_SIZE # end of kernel stack of next |
| 237 | stg %r5,__LC_KERNEL_STACK # store end of kernel stack |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 246 | ENTRY(system_call) |
Martin Schwidefsky | c185b78 | 2008-12-25 13:39:25 +0100 | [diff] [blame] | 247 | stpt __LC_SYNC_ENTER_TIMER |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 248 | sysc_saveall: |
Martin Schwidefsky | 987ad70 | 2007-07-10 11:24:18 +0200 | [diff] [blame] | 249 | SAVE_ALL_SVC __LC_SVC_OLD_PSW,__LC_SAVE_AREA |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 250 | CREATE_STACK_FRAME __LC_SAVE_AREA |
Martin Schwidefsky | b6ef5bb | 2011-10-30 15:16:49 +0100 | [diff] [blame] | 251 | lg %r12,__LC_THREAD_INFO # load pointer to thread_info struct |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 252 | mvc SP_PSW(16,%r15),__LC_SVC_OLD_PSW |
Martin Schwidefsky | 20b40a7 | 2011-10-30 15:16:47 +0100 | [diff] [blame] | 253 | mvc SP_SVC_CODE(4,%r15),__LC_SVC_ILC |
Martin Schwidefsky | b6ef5bb | 2011-10-30 15:16:49 +0100 | [diff] [blame] | 254 | oi __TI_flags+7(%r12),_TIF_SYSCALL |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 255 | sysc_vtime: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 256 | UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER |
| 257 | sysc_stime: |
| 258 | UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER |
| 259 | sysc_update: |
| 260 | mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 261 | LAST_BREAK |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 262 | sysc_do_svc: |
Martin Schwidefsky | 20b40a7 | 2011-10-30 15:16:47 +0100 | [diff] [blame] | 263 | llgh %r7,SP_SVC_CODE+2(%r15) |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 264 | slag %r7,%r7,2 # shift and test for svc 0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 265 | jnz sysc_nr_ok |
| 266 | # svc 0: system call number in %r1 |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 267 | llgfr %r1,%r1 # clear high word in r1 |
| 268 | cghi %r1,NR_syscalls |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 269 | jnl sysc_nr_ok |
Martin Schwidefsky | 20b40a7 | 2011-10-30 15:16:47 +0100 | [diff] [blame] | 270 | sth %r1,SP_SVC_CODE+2(%r15) |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 271 | slag %r7,%r1,2 # shift and test for svc 0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 272 | sysc_nr_ok: |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 273 | larl %r10,sys_call_table |
Martin Schwidefsky | 347a8dc | 2006-01-06 00:19:28 -0800 | [diff] [blame] | 274 | #ifdef CONFIG_COMPAT |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 275 | tm __TI_flags+5(%r12),(_TIF_31BIT>>16) # running in 31 bit mode ? |
Heiko Carstens | c563077 | 2005-09-03 15:58:04 -0700 | [diff] [blame] | 276 | jno sysc_noemu |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 277 | larl %r10,sys_call_table_emu # use 31 bit emulation system calls |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 278 | sysc_noemu: |
| 279 | #endif |
Martin Schwidefsky | b6ef5bb | 2011-10-30 15:16:49 +0100 | [diff] [blame] | 280 | tm __TI_flags+6(%r12),_TIF_TRACE >> 8 |
Martin Schwidefsky | baa0715 | 2010-10-25 16:10:40 +0200 | [diff] [blame] | 281 | mvc SP_ARGS(8,%r15),SP_R7(%r15) |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 282 | lgf %r8,0(%r7,%r10) # load address of system call routine |
| 283 | jnz sysc_tracesys |
| 284 | basr %r14,%r8 # call sys_xxxx |
| 285 | stg %r2,SP_R2(%r15) # store return value (change R2 on stack) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 286 | |
| 287 | sysc_return: |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 288 | LOCKDEP_SYS_EXIT |
| 289 | sysc_tif: |
Martin Schwidefsky | b6ef5bb | 2011-10-30 15:16:49 +0100 | [diff] [blame] | 290 | tm SP_PSW+1(%r15),0x01 # returning to user ? |
| 291 | jno sysc_restore |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 292 | tm __TI_flags+7(%r12),_TIF_WORK_SVC |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 293 | jnz sysc_work # there is work to do (signals etc.) |
Martin Schwidefsky | b6ef5bb | 2011-10-30 15:16:49 +0100 | [diff] [blame] | 294 | ni __TI_flags+7(%r12),255-_TIF_SYSCALL |
Heiko Carstens | 411788e | 2007-11-20 11:13:32 +0100 | [diff] [blame] | 295 | sysc_restore: |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 296 | RESTORE_ALL __LC_RETURN_PSW,1 |
Heiko Carstens | 411788e | 2007-11-20 11:13:32 +0100 | [diff] [blame] | 297 | sysc_done: |
| 298 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 299 | # |
Martin Schwidefsky | 43d399d | 2010-05-17 10:00:01 +0200 | [diff] [blame] | 300 | # One of the work bits is on. Find out which one. |
| 301 | # |
Martin Schwidefsky | b6ef5bb | 2011-10-30 15:16:49 +0100 | [diff] [blame] | 302 | sysc_work: |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 303 | tm __TI_flags+7(%r12),_TIF_MCCK_PENDING |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 304 | jo sysc_mcck_pending |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 305 | tm __TI_flags+7(%r12),_TIF_NEED_RESCHED |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 306 | jo sysc_reschedule |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 307 | tm __TI_flags+7(%r12),_TIF_SIGPENDING |
Martin Schwidefsky | 43d399d | 2010-05-17 10:00:01 +0200 | [diff] [blame] | 308 | jo sysc_sigpending |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 309 | tm __TI_flags+7(%r12),_TIF_NOTIFY_RESUME |
Martin Schwidefsky | 43d399d | 2010-05-17 10:00:01 +0200 | [diff] [blame] | 310 | jo sysc_notify_resume |
Martin Schwidefsky | 5e9a269 | 2011-01-05 12:48:10 +0100 | [diff] [blame] | 311 | tm __TI_flags+7(%r12),_TIF_PER_TRAP |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 312 | jo sysc_singlestep |
Martin Schwidefsky | 43d399d | 2010-05-17 10:00:01 +0200 | [diff] [blame] | 313 | j sysc_return # beware of critical section cleanup |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 314 | |
| 315 | # |
| 316 | # _TIF_NEED_RESCHED is set, call schedule |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 317 | # |
| 318 | sysc_reschedule: |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 319 | larl %r14,sysc_return |
| 320 | jg schedule # return point is sysc_return |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 321 | |
| 322 | # |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 323 | # _TIF_MCCK_PENDING is set, call handler |
| 324 | # |
| 325 | sysc_mcck_pending: |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 326 | larl %r14,sysc_return |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 327 | jg s390_handle_mcck # TIF bit will be cleared by handler |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 328 | |
| 329 | # |
Roland McGrath | 02a029b | 2008-04-30 00:53:08 -0700 | [diff] [blame] | 330 | # _TIF_SIGPENDING is set, call do_signal |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 331 | # |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 332 | sysc_sigpending: |
Martin Schwidefsky | 5e9a269 | 2011-01-05 12:48:10 +0100 | [diff] [blame] | 333 | ni __TI_flags+7(%r12),255-_TIF_PER_TRAP # clear TIF_PER_TRAP |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 334 | la %r2,SP_PTREGS(%r15) # load pt_regs |
| 335 | brasl %r14,do_signal # call do_signal |
Martin Schwidefsky | b6ef5bb | 2011-10-30 15:16:49 +0100 | [diff] [blame] | 336 | tm __TI_flags+7(%r12),_TIF_SYSCALL |
| 337 | jno sysc_return |
| 338 | lmg %r2,%r6,SP_R2(%r15) # load svc arguments |
| 339 | lghi %r7,0 # svc 0 returns -ENOSYS |
| 340 | lh %r1,SP_SVC_CODE+2(%r15) # load new svc number |
| 341 | cghi %r1,NR_syscalls |
| 342 | jnl sysc_nr_ok # invalid svc number -> do svc 0 |
| 343 | slag %r7,%r1,2 |
| 344 | j sysc_nr_ok # restart svc |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 345 | |
| 346 | # |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 347 | # _TIF_NOTIFY_RESUME is set, call do_notify_resume |
| 348 | # |
| 349 | sysc_notify_resume: |
| 350 | la %r2,SP_PTREGS(%r15) # load pt_regs |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 351 | larl %r14,sysc_return |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 352 | jg do_notify_resume # call do_notify_resume |
| 353 | |
| 354 | # |
Martin Schwidefsky | 5e9a269 | 2011-01-05 12:48:10 +0100 | [diff] [blame] | 355 | # _TIF_PER_TRAP is set, call do_per_trap |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 356 | # |
| 357 | sysc_singlestep: |
Martin Schwidefsky | b6ef5bb | 2011-10-30 15:16:49 +0100 | [diff] [blame] | 358 | ni __TI_flags+7(%r12),255-(_TIF_SYSCALL | _TIF_PER_TRAP) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 359 | la %r2,SP_PTREGS(%r15) # address of register-save area |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 360 | larl %r14,sysc_return # load adr. of system return |
Martin Schwidefsky | 5e9a269 | 2011-01-05 12:48:10 +0100 | [diff] [blame] | 361 | jg do_per_trap |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 362 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 363 | # |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 364 | # call tracehook_report_syscall_entry/tracehook_report_syscall_exit before |
| 365 | # and after the system call |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 366 | # |
| 367 | sysc_tracesys: |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 368 | la %r2,SP_PTREGS(%r15) # load pt_regs |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 369 | la %r3,0 |
Martin Schwidefsky | 20b40a7 | 2011-10-30 15:16:47 +0100 | [diff] [blame] | 370 | llgh %r0,SP_SVC_CODE+2(%r15) |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 371 | stg %r0,SP_R2(%r15) |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 372 | brasl %r14,do_syscall_trace_enter |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 373 | lghi %r0,NR_syscalls |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 374 | clgr %r0,%r2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 375 | jnh sysc_tracenogo |
Martin Schwidefsky | 59da213 | 2008-11-27 11:05:55 +0100 | [diff] [blame] | 376 | sllg %r7,%r2,2 # svc number *4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 377 | lgf %r8,0(%r7,%r10) |
| 378 | sysc_tracego: |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 379 | lmg %r3,%r6,SP_R3(%r15) |
Martin Schwidefsky | baa0715 | 2010-10-25 16:10:40 +0200 | [diff] [blame] | 380 | mvc SP_ARGS(8,%r15),SP_R7(%r15) |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 381 | lg %r2,SP_ORIG_R2(%r15) |
| 382 | basr %r14,%r8 # call sys_xxx |
| 383 | stg %r2,SP_R2(%r15) # store return value |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 384 | sysc_tracenogo: |
Martin Schwidefsky | b6ef5bb | 2011-10-30 15:16:49 +0100 | [diff] [blame] | 385 | tm __TI_flags+6(%r12),_TIF_TRACE >> 8 |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 386 | jz sysc_return |
| 387 | la %r2,SP_PTREGS(%r15) # load pt_regs |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 388 | larl %r14,sysc_return # return point is sysc_return |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 389 | jg do_syscall_trace_exit |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 390 | |
| 391 | # |
| 392 | # a new process exits the kernel with ret_from_fork |
| 393 | # |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 394 | ENTRY(ret_from_fork) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 395 | lg %r13,__LC_SVC_NEW_PSW+8 |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 396 | lg %r12,__LC_THREAD_INFO # load pointer to thread_info struct |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 397 | tm SP_PSW+1(%r15),0x01 # forking a kernel thread ? |
| 398 | jo 0f |
| 399 | stg %r15,SP_R15(%r15) # store stack pointer for new kthread |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 400 | 0: brasl %r14,schedule_tail |
Heiko Carstens | 1f194a4 | 2006-07-03 00:24:46 -0700 | [diff] [blame] | 401 | TRACE_IRQS_ON |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 402 | stosm 24(%r15),0x03 # reenable interrupts |
Al Viro | 8f2961c | 2008-12-25 13:37:58 +0100 | [diff] [blame] | 403 | j sysc_tracenogo |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 404 | |
| 405 | # |
Martin Schwidefsky | 03ff9a2 | 2007-04-27 16:01:40 +0200 | [diff] [blame] | 406 | # kernel_execve function needs to deal with pt_regs that is not |
| 407 | # at the usual place |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 408 | # |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 409 | ENTRY(kernel_execve) |
Martin Schwidefsky | 03ff9a2 | 2007-04-27 16:01:40 +0200 | [diff] [blame] | 410 | stmg %r12,%r15,96(%r15) |
| 411 | lgr %r14,%r15 |
| 412 | aghi %r15,-SP_SIZE |
| 413 | stg %r14,__SF_BACKCHAIN(%r15) |
| 414 | la %r12,SP_PTREGS(%r15) |
| 415 | xc 0(__PT_SIZE,%r12),0(%r12) |
| 416 | lgr %r5,%r12 |
| 417 | brasl %r14,do_execve |
| 418 | ltgfr %r2,%r2 |
| 419 | je 0f |
| 420 | aghi %r15,SP_SIZE |
| 421 | lmg %r12,%r15,96(%r15) |
| 422 | br %r14 |
| 423 | # execve succeeded. |
| 424 | 0: stnsm __SF_EMPTY(%r15),0xfc # disable interrupts |
| 425 | lg %r15,__LC_KERNEL_STACK # load ksp |
| 426 | aghi %r15,-SP_SIZE # make room for registers & psw |
| 427 | lg %r13,__LC_SVC_NEW_PSW+8 |
Martin Schwidefsky | 03ff9a2 | 2007-04-27 16:01:40 +0200 | [diff] [blame] | 428 | mvc SP_PTREGS(__PT_SIZE,%r15),0(%r12) # copy pt_regs |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 429 | lg %r12,__LC_THREAD_INFO |
Martin Schwidefsky | 03ff9a2 | 2007-04-27 16:01:40 +0200 | [diff] [blame] | 430 | xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) |
| 431 | stosm __SF_EMPTY(%r15),0x03 # reenable interrupts |
| 432 | brasl %r14,execve_tail |
| 433 | j sysc_return |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 434 | |
| 435 | /* |
| 436 | * Program check handler routine |
| 437 | */ |
| 438 | |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 439 | ENTRY(pgm_check_handler) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 440 | /* |
| 441 | * First we need to check for a special case: |
| 442 | * Single stepping an instruction that disables the PER event mask will |
| 443 | * cause a PER event AFTER the mask has been set. Example: SVC or LPSW. |
| 444 | * For a single stepped SVC the program check handler gets control after |
| 445 | * the SVC new PSW has been loaded. But we want to execute the SVC first and |
| 446 | * then handle the PER event. Therefore we update the SVC old PSW to point |
| 447 | * to the pgm_check_handler and branch to the SVC handler after we checked |
| 448 | * if we have to load the kernel stack register. |
| 449 | * For every other possible cause for PER event without the PER mask set |
| 450 | * we just ignore the PER event (FIXME: is there anything we have to do |
| 451 | * for LPSW?). |
| 452 | */ |
Martin Schwidefsky | c185b78 | 2008-12-25 13:39:25 +0100 | [diff] [blame] | 453 | stpt __LC_SYNC_ENTER_TIMER |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 454 | tm __LC_PGM_INT_CODE+1,0x80 # check whether we got a per exception |
| 455 | jnz pgm_per # got per exception -> special case |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 456 | SAVE_ALL_PGM __LC_PGM_OLD_PSW,__LC_SAVE_AREA |
| 457 | CREATE_STACK_FRAME __LC_SAVE_AREA |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 458 | mvc SP_PSW(16,%r15),__LC_PGM_OLD_PSW |
| 459 | lg %r12,__LC_THREAD_INFO # load pointer to thread_info struct |
Martin Schwidefsky | 603d1a5 | 2011-07-24 10:48:18 +0200 | [diff] [blame] | 460 | HANDLE_SIE_INTERCEPT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 461 | tm SP_PSW+1(%r15),0x01 # interrupting from user ? |
| 462 | jz pgm_no_vtime |
| 463 | UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER |
| 464 | UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER |
| 465 | mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 466 | LAST_BREAK |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 467 | pgm_no_vtime: |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 468 | stg %r11,SP_ARGS(%r15) |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 469 | lgf %r3,__LC_PGM_ILC # load program interruption code |
Martin Schwidefsky | 1e54622 | 2010-10-25 16:10:37 +0200 | [diff] [blame] | 470 | lg %r4,__LC_TRANS_EXC_CODE |
| 471 | REENABLE_IRQS |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 472 | lghi %r8,0x7f |
| 473 | ngr %r8,%r3 |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 474 | sll %r8,3 |
| 475 | larl %r1,pgm_check_table |
| 476 | lg %r1,0(%r8,%r1) # load address of handler routine |
| 477 | la %r2,SP_PTREGS(%r15) # address of register-save area |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 478 | basr %r14,%r1 # branch to interrupt-handler |
| 479 | pgm_exit: |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 480 | j sysc_return |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 481 | |
| 482 | # |
| 483 | # handle per exception |
| 484 | # |
| 485 | pgm_per: |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 486 | tm __LC_PGM_OLD_PSW,0x40 # test if per event recording is on |
| 487 | jnz pgm_per_std # ok, normal per event from user space |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 488 | # ok its one of the special cases, now we need to find out which one |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 489 | clc __LC_PGM_OLD_PSW(16),__LC_SVC_NEW_PSW |
| 490 | je pgm_svcper |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 491 | # no interesting special case, ignore PER event |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 492 | lpswe __LC_PGM_OLD_PSW |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 493 | |
| 494 | # |
| 495 | # Normal per exception |
| 496 | # |
| 497 | pgm_per_std: |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 498 | SAVE_ALL_PGM __LC_PGM_OLD_PSW,__LC_SAVE_AREA |
| 499 | CREATE_STACK_FRAME __LC_SAVE_AREA |
| 500 | mvc SP_PSW(16,%r15),__LC_PGM_OLD_PSW |
| 501 | lg %r12,__LC_THREAD_INFO # load pointer to thread_info struct |
Martin Schwidefsky | 603d1a5 | 2011-07-24 10:48:18 +0200 | [diff] [blame] | 502 | HANDLE_SIE_INTERCEPT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 503 | tm SP_PSW+1(%r15),0x01 # interrupting from user ? |
| 504 | jz pgm_no_vtime2 |
| 505 | UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER |
| 506 | UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER |
| 507 | mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 508 | LAST_BREAK |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 509 | pgm_no_vtime2: |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 510 | lg %r1,__TI_task(%r12) |
Michael Grundy | 4ba069b | 2006-09-20 15:58:39 +0200 | [diff] [blame] | 511 | tm SP_PSW+1(%r15),0x01 # kernel per event ? |
| 512 | jz kernel_per |
Martin Schwidefsky | 5e9a269 | 2011-01-05 12:48:10 +0100 | [diff] [blame] | 513 | mvc __THREAD_per_cause(2,%r1),__LC_PER_CAUSE |
| 514 | mvc __THREAD_per_address(8,%r1),__LC_PER_ADDRESS |
| 515 | mvc __THREAD_per_paid(1,%r1),__LC_PER_PAID |
| 516 | oi __TI_flags+7(%r12),_TIF_PER_TRAP # set TIF_PER_TRAP |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 517 | lgf %r3,__LC_PGM_ILC # load program interruption code |
Martin Schwidefsky | 1e54622 | 2010-10-25 16:10:37 +0200 | [diff] [blame] | 518 | lg %r4,__LC_TRANS_EXC_CODE |
| 519 | REENABLE_IRQS |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 520 | lghi %r8,0x7f |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 521 | ngr %r8,%r3 # clear per-event-bit and ilc |
Heiko Carstens | f5cdac2 | 2010-07-27 19:29:37 +0200 | [diff] [blame] | 522 | je pgm_exit2 |
| 523 | sll %r8,3 |
| 524 | larl %r1,pgm_check_table |
| 525 | lg %r1,0(%r8,%r1) # load address of handler routine |
| 526 | la %r2,SP_PTREGS(%r15) # address of register-save area |
| 527 | basr %r14,%r1 # branch to interrupt-handler |
| 528 | pgm_exit2: |
Heiko Carstens | f5cdac2 | 2010-07-27 19:29:37 +0200 | [diff] [blame] | 529 | j sysc_return |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 530 | |
| 531 | # |
| 532 | # it was a single stepped SVC that is causing all the trouble |
| 533 | # |
| 534 | pgm_svcper: |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 535 | SAVE_ALL_PGM __LC_SVC_OLD_PSW,__LC_SAVE_AREA |
| 536 | CREATE_STACK_FRAME __LC_SAVE_AREA |
Martin Schwidefsky | b6ef5bb | 2011-10-30 15:16:49 +0100 | [diff] [blame] | 537 | lg %r12,__LC_THREAD_INFO # load pointer to thread_info struct |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 538 | mvc SP_PSW(16,%r15),__LC_SVC_OLD_PSW |
Martin Schwidefsky | 20b40a7 | 2011-10-30 15:16:47 +0100 | [diff] [blame] | 539 | mvc SP_SVC_CODE(4,%r15),__LC_SVC_ILC |
Martin Schwidefsky | b6ef5bb | 2011-10-30 15:16:49 +0100 | [diff] [blame] | 540 | oi __TI_flags+7(%r12),(_TIF_SYSCALL | _TIF_PER_TRAP) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 541 | UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER |
| 542 | UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER |
| 543 | mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 544 | LAST_BREAK |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 545 | lg %r8,__TI_task(%r12) |
Martin Schwidefsky | 5e9a269 | 2011-01-05 12:48:10 +0100 | [diff] [blame] | 546 | mvc __THREAD_per_cause(2,%r8),__LC_PER_CAUSE |
| 547 | mvc __THREAD_per_address(8,%r8),__LC_PER_ADDRESS |
| 548 | mvc __THREAD_per_paid(1,%r8),__LC_PER_PAID |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 549 | stosm __SF_EMPTY(%r15),0x03 # reenable interrupts |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 550 | lmg %r2,%r6,SP_R2(%r15) # load svc arguments |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 551 | j sysc_do_svc |
| 552 | |
Michael Grundy | 4ba069b | 2006-09-20 15:58:39 +0200 | [diff] [blame] | 553 | # |
| 554 | # per was called from kernel, must be kprobes |
| 555 | # |
| 556 | kernel_per: |
Martin Schwidefsky | 9ec2708 | 2010-10-29 16:50:45 +0200 | [diff] [blame] | 557 | REENABLE_IRQS |
Michael Grundy | 4ba069b | 2006-09-20 15:58:39 +0200 | [diff] [blame] | 558 | la %r2,SP_PTREGS(%r15) # address of register-save area |
Martin Schwidefsky | 5e9a269 | 2011-01-05 12:48:10 +0100 | [diff] [blame] | 559 | brasl %r14,do_per_trap |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 560 | j pgm_exit |
Michael Grundy | 4ba069b | 2006-09-20 15:58:39 +0200 | [diff] [blame] | 561 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 562 | /* |
| 563 | * IO interrupt handler routine |
| 564 | */ |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 565 | ENTRY(io_int_handler) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 566 | stck __LC_INT_CLOCK |
Martin Schwidefsky | 9cfb9b3 | 2008-12-31 15:11:41 +0100 | [diff] [blame] | 567 | stpt __LC_ASYNC_ENTER_TIMER |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 568 | SAVE_ALL_ASYNC __LC_IO_OLD_PSW,__LC_SAVE_AREA+40 |
| 569 | CREATE_STACK_FRAME __LC_SAVE_AREA+40 |
| 570 | mvc SP_PSW(16,%r15),0(%r12) # move user PSW to stack |
| 571 | lg %r12,__LC_THREAD_INFO # load pointer to thread_info struct |
Martin Schwidefsky | 603d1a5 | 2011-07-24 10:48:18 +0200 | [diff] [blame] | 572 | HANDLE_SIE_INTERCEPT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 573 | tm SP_PSW+1(%r15),0x01 # interrupting from user ? |
| 574 | jz io_no_vtime |
| 575 | UPDATE_VTIME __LC_EXIT_TIMER,__LC_ASYNC_ENTER_TIMER,__LC_USER_TIMER |
| 576 | UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER |
| 577 | mvc __LC_LAST_UPDATE_TIMER(8),__LC_ASYNC_ENTER_TIMER |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 578 | LAST_BREAK |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 579 | io_no_vtime: |
Heiko Carstens | 1f194a4 | 2006-07-03 00:24:46 -0700 | [diff] [blame] | 580 | TRACE_IRQS_OFF |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 581 | la %r2,SP_PTREGS(%r15) # address of register-save area |
| 582 | brasl %r14,do_IRQ # call standard irq handler |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 583 | io_return: |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 584 | LOCKDEP_SYS_EXIT |
| 585 | TRACE_IRQS_ON |
| 586 | io_tif: |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 587 | tm __TI_flags+7(%r12),_TIF_WORK_INT |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 588 | jnz io_work # there is work to do (signals etc.) |
Heiko Carstens | 411788e | 2007-11-20 11:13:32 +0100 | [diff] [blame] | 589 | io_restore: |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 590 | RESTORE_ALL __LC_RETURN_PSW,0 |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 591 | io_done: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 592 | |
Martin Schwidefsky | 2688905 | 2008-05-07 09:22:52 +0200 | [diff] [blame] | 593 | # |
Martin Schwidefsky | 43d399d | 2010-05-17 10:00:01 +0200 | [diff] [blame] | 594 | # There is work todo, find out in which context we have been interrupted: |
| 595 | # 1) if we return to user space we can do all _TIF_WORK_INT work |
| 596 | # 2) if we return to kernel code and kvm is enabled check if we need to |
| 597 | # modify the psw to leave SIE |
| 598 | # 3) if we return to kernel code and preemptive scheduling is enabled check |
| 599 | # the preemption counter and if it is zero call preempt_schedule_irq |
| 600 | # Before any work can be done, a switch to the kernel stack is required. |
Martin Schwidefsky | 2688905 | 2008-05-07 09:22:52 +0200 | [diff] [blame] | 601 | # |
| 602 | io_work: |
| 603 | tm SP_PSW+1(%r15),0x01 # returning to user ? |
Martin Schwidefsky | 43d399d | 2010-05-17 10:00:01 +0200 | [diff] [blame] | 604 | jo io_work_user # yes -> do resched & signal |
Martin Schwidefsky | 43d399d | 2010-05-17 10:00:01 +0200 | [diff] [blame] | 605 | #ifdef CONFIG_PREEMPT |
Martin Schwidefsky | 2688905 | 2008-05-07 09:22:52 +0200 | [diff] [blame] | 606 | # check for preemptive scheduling |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 607 | icm %r0,15,__TI_precount(%r12) |
Martin Schwidefsky | 2688905 | 2008-05-07 09:22:52 +0200 | [diff] [blame] | 608 | jnz io_restore # preemption is disabled |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 609 | tm __TI_flags+7(%r12),_TIF_NEED_RESCHED |
| 610 | jno io_restore |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 611 | # switch to kernel stack |
| 612 | lg %r1,SP_R15(%r15) |
| 613 | aghi %r1,-SP_SIZE |
| 614 | mvc SP_PTREGS(__PT_SIZE,%r1),SP_PTREGS(%r15) |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 615 | xc __SF_BACKCHAIN(8,%r1),__SF_BACKCHAIN(%r1) # clear back chain |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 616 | lgr %r15,%r1 |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 617 | # TRACE_IRQS_ON already done at io_return, call |
| 618 | # TRACE_IRQS_OFF to keep things symmetrical |
| 619 | TRACE_IRQS_OFF |
| 620 | brasl %r14,preempt_schedule_irq |
| 621 | j io_return |
| 622 | #else |
Martin Schwidefsky | 43d399d | 2010-05-17 10:00:01 +0200 | [diff] [blame] | 623 | j io_restore |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 624 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 625 | |
Martin Schwidefsky | 43d399d | 2010-05-17 10:00:01 +0200 | [diff] [blame] | 626 | # |
| 627 | # Need to do work before returning to userspace, switch to kernel stack |
| 628 | # |
Martin Schwidefsky | 2688905 | 2008-05-07 09:22:52 +0200 | [diff] [blame] | 629 | io_work_user: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 630 | lg %r1,__LC_KERNEL_STACK |
| 631 | aghi %r1,-SP_SIZE |
| 632 | mvc SP_PTREGS(__PT_SIZE,%r1),SP_PTREGS(%r15) |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 633 | xc __SF_BACKCHAIN(8,%r1),__SF_BACKCHAIN(%r1) # clear back chain |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 634 | lgr %r15,%r1 |
Martin Schwidefsky | 43d399d | 2010-05-17 10:00:01 +0200 | [diff] [blame] | 635 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 636 | # |
| 637 | # One of the work bits is on. Find out which one. |
Martin Schwidefsky | 43d399d | 2010-05-17 10:00:01 +0200 | [diff] [blame] | 638 | # Checked are: _TIF_SIGPENDING, _TIF_NOTIFY_RESUME, _TIF_NEED_RESCHED |
Heiko Carstens | 54dfe5d | 2006-02-01 03:06:38 -0800 | [diff] [blame] | 639 | # and _TIF_MCCK_PENDING |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 640 | # |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 641 | io_work_tif: |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 642 | tm __TI_flags+7(%r12),_TIF_MCCK_PENDING |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 643 | jo io_mcck_pending |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 644 | tm __TI_flags+7(%r12),_TIF_NEED_RESCHED |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 645 | jo io_reschedule |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 646 | tm __TI_flags+7(%r12),_TIF_SIGPENDING |
Martin Schwidefsky | 43d399d | 2010-05-17 10:00:01 +0200 | [diff] [blame] | 647 | jo io_sigpending |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 648 | tm __TI_flags+7(%r12),_TIF_NOTIFY_RESUME |
Martin Schwidefsky | 43d399d | 2010-05-17 10:00:01 +0200 | [diff] [blame] | 649 | jo io_notify_resume |
| 650 | j io_return # beware of critical section cleanup |
Christian Borntraeger | 0eaeafa | 2008-05-07 09:22:53 +0200 | [diff] [blame] | 651 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 652 | # |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 653 | # _TIF_MCCK_PENDING is set, call handler |
| 654 | # |
| 655 | io_mcck_pending: |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 656 | # TRACE_IRQS_ON already done at io_return |
Heiko Carstens | b771aea | 2007-07-27 12:29:18 +0200 | [diff] [blame] | 657 | brasl %r14,s390_handle_mcck # TIF bit will be cleared by handler |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 658 | TRACE_IRQS_OFF |
| 659 | j io_return |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 660 | |
| 661 | # |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 662 | # _TIF_NEED_RESCHED is set, call schedule |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 663 | # |
| 664 | io_reschedule: |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 665 | # TRACE_IRQS_ON already done at io_return |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 666 | stosm __SF_EMPTY(%r15),0x03 # reenable interrupts |
| 667 | brasl %r14,schedule # call scheduler |
| 668 | stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts |
Heiko Carstens | 411788e | 2007-11-20 11:13:32 +0100 | [diff] [blame] | 669 | TRACE_IRQS_OFF |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 670 | j io_return |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 671 | |
| 672 | # |
Roland McGrath | 02a029b | 2008-04-30 00:53:08 -0700 | [diff] [blame] | 673 | # _TIF_SIGPENDING or is set, call do_signal |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 674 | # |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 675 | io_sigpending: |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 676 | # TRACE_IRQS_ON already done at io_return |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 677 | stosm __SF_EMPTY(%r15),0x03 # reenable interrupts |
| 678 | la %r2,SP_PTREGS(%r15) # load pt_regs |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 679 | brasl %r14,do_signal # call do_signal |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 680 | stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts |
Heiko Carstens | 411788e | 2007-11-20 11:13:32 +0100 | [diff] [blame] | 681 | TRACE_IRQS_OFF |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 682 | j io_return |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 683 | |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 684 | # |
| 685 | # _TIF_NOTIFY_RESUME or is set, call do_notify_resume |
| 686 | # |
| 687 | io_notify_resume: |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 688 | # TRACE_IRQS_ON already done at io_return |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 689 | stosm __SF_EMPTY(%r15),0x03 # reenable interrupts |
| 690 | la %r2,SP_PTREGS(%r15) # load pt_regs |
| 691 | brasl %r14,do_notify_resume # call do_notify_resume |
| 692 | stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts |
| 693 | TRACE_IRQS_OFF |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 694 | j io_return |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 695 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 696 | /* |
| 697 | * External interrupt handler routine |
| 698 | */ |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 699 | ENTRY(ext_int_handler) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 700 | stck __LC_INT_CLOCK |
Martin Schwidefsky | 9cfb9b3 | 2008-12-31 15:11:41 +0100 | [diff] [blame] | 701 | stpt __LC_ASYNC_ENTER_TIMER |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 702 | SAVE_ALL_ASYNC __LC_EXT_OLD_PSW,__LC_SAVE_AREA+40 |
| 703 | CREATE_STACK_FRAME __LC_SAVE_AREA+40 |
| 704 | mvc SP_PSW(16,%r15),0(%r12) # move user PSW to stack |
| 705 | lg %r12,__LC_THREAD_INFO # load pointer to thread_info struct |
Martin Schwidefsky | 603d1a5 | 2011-07-24 10:48:18 +0200 | [diff] [blame] | 706 | HANDLE_SIE_INTERCEPT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 707 | tm SP_PSW+1(%r15),0x01 # interrupting from user ? |
| 708 | jz ext_no_vtime |
| 709 | UPDATE_VTIME __LC_EXIT_TIMER,__LC_ASYNC_ENTER_TIMER,__LC_USER_TIMER |
| 710 | UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER |
| 711 | mvc __LC_LAST_UPDATE_TIMER(8),__LC_ASYNC_ENTER_TIMER |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 712 | LAST_BREAK |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 713 | ext_no_vtime: |
Heiko Carstens | 1f194a4 | 2006-07-03 00:24:46 -0700 | [diff] [blame] | 714 | TRACE_IRQS_OFF |
Martin Schwidefsky | f6649a7 | 2010-10-25 16:10:38 +0200 | [diff] [blame] | 715 | lghi %r1,4096 |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 716 | la %r2,SP_PTREGS(%r15) # address of register-save area |
Martin Schwidefsky | f6649a7 | 2010-10-25 16:10:38 +0200 | [diff] [blame] | 717 | llgf %r3,__LC_CPU_ADDRESS # get cpu address + interruption code |
| 718 | llgf %r4,__LC_EXT_PARAMS # get external parameter |
| 719 | lg %r5,__LC_EXT_PARAMS2-4096(%r1) # get 64 bit external parameter |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 720 | brasl %r14,do_extint |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 721 | j io_return |
| 722 | |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 723 | __critical_end: |
| 724 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 725 | /* |
| 726 | * Machine check handler routines |
| 727 | */ |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 728 | ENTRY(mcck_int_handler) |
Martin Schwidefsky | 6377981 | 2010-05-17 10:00:03 +0200 | [diff] [blame] | 729 | stck __LC_MCCK_CLOCK |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 730 | la %r1,4095 # revalidate r1 |
| 731 | spt __LC_CPU_TIMER_SAVE_AREA-4095(%r1) # revalidate cpu timer |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 732 | lmg %r0,%r15,__LC_GPREGS_SAVE_AREA-4095(%r1)# revalidate gprs |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 733 | stmg %r11,%r15,__LC_SAVE_AREA+80 |
| 734 | larl %r13,system_call |
| 735 | lg %r11,__LC_LAST_BREAK |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 736 | la %r12,__LC_MCK_OLD_PSW |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 737 | tm __LC_MCCK_CODE,0x80 # system damage? |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 738 | jo mcck_int_main # yes -> rest of mcck code invalid |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 739 | la %r14,4095 |
Martin Schwidefsky | 6377981 | 2010-05-17 10:00:03 +0200 | [diff] [blame] | 740 | mvc __LC_MCCK_ENTER_TIMER(8),__LC_CPU_TIMER_SAVE_AREA-4095(%r14) |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 741 | tm __LC_MCCK_CODE+5,0x02 # stored cpu timer value valid? |
| 742 | jo 1f |
| 743 | la %r14,__LC_SYNC_ENTER_TIMER |
| 744 | clc 0(8,%r14),__LC_ASYNC_ENTER_TIMER |
| 745 | jl 0f |
| 746 | la %r14,__LC_ASYNC_ENTER_TIMER |
| 747 | 0: clc 0(8,%r14),__LC_EXIT_TIMER |
| 748 | jl 0f |
| 749 | la %r14,__LC_EXIT_TIMER |
| 750 | 0: clc 0(8,%r14),__LC_LAST_UPDATE_TIMER |
| 751 | jl 0f |
| 752 | la %r14,__LC_LAST_UPDATE_TIMER |
| 753 | 0: spt 0(%r14) |
Martin Schwidefsky | 6377981 | 2010-05-17 10:00:03 +0200 | [diff] [blame] | 754 | mvc __LC_MCCK_ENTER_TIMER(8),0(%r14) |
Martin Schwidefsky | c185b78 | 2008-12-25 13:39:25 +0100 | [diff] [blame] | 755 | 1: tm __LC_MCCK_CODE+2,0x09 # mwp + ia of old psw valid? |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 756 | jno mcck_int_main # no -> skip cleanup critical |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 757 | tm __LC_MCK_OLD_PSW+1,0x01 # test problem state bit |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 758 | jnz mcck_int_main # from user -> load kernel stack |
| 759 | clc __LC_MCK_OLD_PSW+8(8),BASED(.Lcritical_end) |
| 760 | jhe mcck_int_main |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 761 | clc __LC_MCK_OLD_PSW+8(8),BASED(.Lcritical_start) |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 762 | jl mcck_int_main |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 763 | brasl %r14,cleanup_critical |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 764 | mcck_int_main: |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 765 | lg %r14,__LC_PANIC_STACK # are we already on the panic stack? |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 766 | slgr %r14,%r15 |
| 767 | srag %r14,%r14,PAGE_SHIFT |
| 768 | jz 0f |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 769 | lg %r15,__LC_PANIC_STACK # load panic stack |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 770 | 0: aghi %r15,-SP_SIZE # make room for registers & psw |
| 771 | CREATE_STACK_FRAME __LC_SAVE_AREA+80 |
| 772 | mvc SP_PSW(16,%r15),0(%r12) |
| 773 | lg %r12,__LC_THREAD_INFO # load pointer to thread_info struct |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 774 | tm __LC_MCCK_CODE+2,0x08 # mwp of old psw valid? |
| 775 | jno mcck_no_vtime # no -> no timer update |
Martin Schwidefsky | 603d1a5 | 2011-07-24 10:48:18 +0200 | [diff] [blame] | 776 | HANDLE_SIE_INTERCEPT |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 777 | tm SP_PSW+1(%r15),0x01 # interrupting from user ? |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 778 | jz mcck_no_vtime |
Martin Schwidefsky | 6377981 | 2010-05-17 10:00:03 +0200 | [diff] [blame] | 779 | UPDATE_VTIME __LC_EXIT_TIMER,__LC_MCCK_ENTER_TIMER,__LC_USER_TIMER |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 780 | UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER |
Martin Schwidefsky | 6377981 | 2010-05-17 10:00:03 +0200 | [diff] [blame] | 781 | mvc __LC_LAST_UPDATE_TIMER(8),__LC_MCCK_ENTER_TIMER |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 782 | LAST_BREAK |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 783 | mcck_no_vtime: |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 784 | la %r2,SP_PTREGS(%r15) # load pt_regs |
| 785 | brasl %r14,s390_do_machine_check |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 786 | tm SP_PSW+1(%r15),0x01 # returning to user ? |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 787 | jno mcck_return |
| 788 | lg %r1,__LC_KERNEL_STACK # switch to kernel stack |
| 789 | aghi %r1,-SP_SIZE |
| 790 | mvc SP_PTREGS(__PT_SIZE,%r1),SP_PTREGS(%r15) |
| 791 | xc __SF_BACKCHAIN(8,%r1),__SF_BACKCHAIN(%r1) # clear back chain |
| 792 | lgr %r15,%r1 |
| 793 | stosm __SF_EMPTY(%r15),0x04 # turn dat on |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 794 | tm __TI_flags+7(%r12),_TIF_MCCK_PENDING |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 795 | jno mcck_return |
Heiko Carstens | 1f194a4 | 2006-07-03 00:24:46 -0700 | [diff] [blame] | 796 | TRACE_IRQS_OFF |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 797 | brasl %r14,s390_handle_mcck |
Heiko Carstens | 1f194a4 | 2006-07-03 00:24:46 -0700 | [diff] [blame] | 798 | TRACE_IRQS_ON |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 799 | mcck_return: |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 800 | mvc __LC_RETURN_MCCK_PSW(16),SP_PSW(%r15) # move return PSW |
| 801 | ni __LC_RETURN_MCCK_PSW+1,0xfd # clear wait state bit |
| 802 | lmg %r0,%r15,SP_R0(%r15) # load gprs 0-15 |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 803 | tm __LC_RETURN_MCCK_PSW+1,0x01 # returning to user ? |
| 804 | jno 0f |
| 805 | stpt __LC_EXIT_TIMER |
Martin Schwidefsky | c185b78 | 2008-12-25 13:39:25 +0100 | [diff] [blame] | 806 | 0: lpswe __LC_RETURN_MCCK_PSW # back to caller |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 807 | mcck_done: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 808 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 809 | /* |
| 810 | * Restart interruption handler, kick starter for additional CPUs |
| 811 | */ |
Heiko Carstens | 84b36a8 | 2007-06-19 13:10:03 +0200 | [diff] [blame] | 812 | #ifdef CONFIG_SMP |
Heiko Carstens | 2bc89b5 | 2008-02-05 16:50:40 +0100 | [diff] [blame] | 813 | __CPUINIT |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 814 | ENTRY(restart_int_handler) |
Martin Schwidefsky | 5b409ed | 2009-04-14 15:36:27 +0200 | [diff] [blame] | 815 | basr %r1,0 |
| 816 | restart_base: |
| 817 | spt restart_vtime-restart_base(%r1) |
| 818 | stck __LC_LAST_UPDATE_CLOCK |
| 819 | mvc __LC_LAST_UPDATE_TIMER(8),restart_vtime-restart_base(%r1) |
| 820 | mvc __LC_EXIT_TIMER(8),restart_vtime-restart_base(%r1) |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 821 | lg %r15,__LC_SAVE_AREA+120 # load ksp |
| 822 | lghi %r10,__LC_CREGS_SAVE_AREA |
| 823 | lctlg %c0,%c15,0(%r10) # get new ctl regs |
| 824 | lghi %r10,__LC_AREGS_SAVE_AREA |
| 825 | lam %a0,%a15,0(%r10) |
| 826 | lmg %r6,%r15,__SF_GPRS(%r15) # load registers from clone |
Martin Schwidefsky | 5b409ed | 2009-04-14 15:36:27 +0200 | [diff] [blame] | 827 | lg %r1,__LC_THREAD_INFO |
| 828 | mvc __LC_USER_TIMER(8),__TI_user_timer(%r1) |
| 829 | mvc __LC_SYSTEM_TIMER(8),__TI_system_timer(%r1) |
| 830 | xc __LC_STEAL_TIMER(8),__LC_STEAL_TIMER |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 831 | stosm __SF_EMPTY(%r15),0x04 # now we can turn dat on |
Michael Holzheu | 8eb4bd6 | 2011-05-10 17:13:39 +0200 | [diff] [blame] | 832 | brasl %r14,start_secondary |
Martin Schwidefsky | 5b409ed | 2009-04-14 15:36:27 +0200 | [diff] [blame] | 833 | .align 8 |
| 834 | restart_vtime: |
| 835 | .long 0x7fffffff,0xffffffff |
Heiko Carstens | 84b36a8 | 2007-06-19 13:10:03 +0200 | [diff] [blame] | 836 | .previous |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 837 | #else |
| 838 | /* |
| 839 | * If we do not run with SMP enabled, let the new CPU crash ... |
| 840 | */ |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 841 | ENTRY(restart_int_handler) |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 842 | basr %r1,0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 843 | restart_base: |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 844 | lpswe restart_crash-restart_base(%r1) |
| 845 | .align 8 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 846 | restart_crash: |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 847 | .long 0x000a0000,0x00000000,0x00000000,0x00000000 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 848 | restart_go: |
| 849 | #endif |
| 850 | |
Michael Holzheu | 7dd6b33 | 2011-08-03 16:44:19 +0200 | [diff] [blame] | 851 | # |
| 852 | # PSW restart interrupt handler |
| 853 | # |
| 854 | ENTRY(psw_restart_int_handler) |
Martin Schwidefsky | 0edc8fa | 2011-10-30 15:16:45 +0100 | [diff] [blame] | 855 | stg %r15,__LC_SAVE_AREA+120(%r0) # save r15 |
Michael Holzheu | 7dd6b33 | 2011-08-03 16:44:19 +0200 | [diff] [blame] | 856 | larl %r15,restart_stack # load restart stack |
| 857 | lg %r15,0(%r15) |
| 858 | aghi %r15,-SP_SIZE # make room for pt_regs |
| 859 | stmg %r0,%r14,SP_R0(%r15) # store gprs %r0-%r14 to stack |
Martin Schwidefsky | 0edc8fa | 2011-10-30 15:16:45 +0100 | [diff] [blame] | 860 | mvc SP_R15(8,%r15),__LC_SAVE_AREA+120(%r0)# store saved %r15 to stack |
Michael Holzheu | 7dd6b33 | 2011-08-03 16:44:19 +0200 | [diff] [blame] | 861 | mvc SP_PSW(16,%r15),__LC_RST_OLD_PSW(%r0)# store restart old psw |
| 862 | xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) # set backchain to 0 |
| 863 | brasl %r14,do_restart |
| 864 | |
| 865 | larl %r14,restart_psw_crash # load disabled wait PSW if |
| 866 | lpswe 0(%r14) # do_restart returns |
| 867 | .align 8 |
| 868 | restart_psw_crash: |
| 869 | .quad 0x0002000080000000,0x0000000000000000 + restart_psw_crash |
| 870 | |
Martin Schwidefsky | 860dba4 | 2011-01-05 12:47:25 +0100 | [diff] [blame] | 871 | .section .kprobes.text, "ax" |
| 872 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 873 | #ifdef CONFIG_CHECK_STACK |
| 874 | /* |
| 875 | * The synchronous or the asynchronous stack overflowed. We are dead. |
| 876 | * No need to properly save the registers, we are going to panic anyway. |
| 877 | * Setup a pt_regs so that show_trace can provide a good call trace. |
| 878 | */ |
| 879 | stack_overflow: |
| 880 | lg %r15,__LC_PANIC_STACK # change to panic stack |
Heiko Carstens | 9514e23 | 2006-09-20 15:59:22 +0200 | [diff] [blame] | 881 | aghi %r15,-SP_SIZE |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 882 | mvc SP_PSW(16,%r15),0(%r12) # move user PSW to stack |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 883 | stmg %r0,%r10,SP_R0(%r15) # store gprs %r0-%r10 to kernel stack |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 884 | la %r1,__LC_SAVE_AREA |
| 885 | chi %r12,__LC_SVC_OLD_PSW |
| 886 | je 0f |
| 887 | chi %r12,__LC_PGM_OLD_PSW |
| 888 | je 0f |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 889 | la %r1,__LC_SAVE_AREA+40 |
| 890 | 0: mvc SP_R11(40,%r15),0(%r1) # move %r11-%r15 to stack |
Christian Borntraeger | 9e74a6b8 | 2008-04-17 07:46:30 +0200 | [diff] [blame] | 891 | mvc SP_ARGS(8,%r15),__LC_LAST_BREAK |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 892 | xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) # clear back chain |
| 893 | la %r2,SP_PTREGS(%r15) # load pt_regs |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 894 | jg kernel_stack_overflow |
| 895 | #endif |
| 896 | |
| 897 | cleanup_table_system_call: |
| 898 | .quad system_call, sysc_do_svc |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 899 | cleanup_table_sysc_tif: |
| 900 | .quad sysc_tif, sysc_restore |
| 901 | cleanup_table_sysc_restore: |
| 902 | .quad sysc_restore, sysc_done |
| 903 | cleanup_table_io_tif: |
| 904 | .quad io_tif, io_restore |
| 905 | cleanup_table_io_restore: |
| 906 | .quad io_restore, io_done |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 907 | |
| 908 | cleanup_critical: |
| 909 | clc 8(8,%r12),BASED(cleanup_table_system_call) |
| 910 | jl 0f |
| 911 | clc 8(8,%r12),BASED(cleanup_table_system_call+8) |
| 912 | jl cleanup_system_call |
| 913 | 0: |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 914 | clc 8(8,%r12),BASED(cleanup_table_sysc_tif) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 915 | jl 0f |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 916 | clc 8(8,%r12),BASED(cleanup_table_sysc_tif+8) |
| 917 | jl cleanup_sysc_tif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 918 | 0: |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 919 | clc 8(8,%r12),BASED(cleanup_table_sysc_restore) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 920 | jl 0f |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 921 | clc 8(8,%r12),BASED(cleanup_table_sysc_restore+8) |
| 922 | jl cleanup_sysc_restore |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 923 | 0: |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 924 | clc 8(8,%r12),BASED(cleanup_table_io_tif) |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 925 | jl 0f |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 926 | clc 8(8,%r12),BASED(cleanup_table_io_tif+8) |
| 927 | jl cleanup_io_tif |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 928 | 0: |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 929 | clc 8(8,%r12),BASED(cleanup_table_io_restore) |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 930 | jl 0f |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 931 | clc 8(8,%r12),BASED(cleanup_table_io_restore+8) |
| 932 | jl cleanup_io_restore |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 933 | 0: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 934 | br %r14 |
| 935 | |
| 936 | cleanup_system_call: |
| 937 | mvc __LC_RETURN_PSW(16),0(%r12) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 938 | clc __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn+8) |
| 939 | jh 0f |
Martin Schwidefsky | 6377981 | 2010-05-17 10:00:03 +0200 | [diff] [blame] | 940 | mvc __LC_SYNC_ENTER_TIMER(8),__LC_MCCK_ENTER_TIMER |
| 941 | cghi %r12,__LC_MCK_OLD_PSW |
| 942 | je 0f |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 943 | mvc __LC_SYNC_ENTER_TIMER(8),__LC_ASYNC_ENTER_TIMER |
Martin Schwidefsky | 6377981 | 2010-05-17 10:00:03 +0200 | [diff] [blame] | 944 | 0: cghi %r12,__LC_MCK_OLD_PSW |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 945 | la %r12,__LC_SAVE_AREA+80 |
Martin Schwidefsky | 6377981 | 2010-05-17 10:00:03 +0200 | [diff] [blame] | 946 | je 0f |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 947 | la %r12,__LC_SAVE_AREA+40 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 948 | 0: clc __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn+16) |
| 949 | jhe cleanup_vtime |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 950 | clc __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn) |
| 951 | jh 0f |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 952 | mvc __LC_SAVE_AREA(40),0(%r12) |
| 953 | 0: lg %r15,__LC_KERNEL_STACK # problem state -> load ksp |
| 954 | aghi %r15,-SP_SIZE # make room for registers & psw |
| 955 | stg %r15,32(%r12) |
| 956 | stg %r11,0(%r12) |
| 957 | CREATE_STACK_FRAME __LC_SAVE_AREA |
Martin Schwidefsky | b6ef5bb | 2011-10-30 15:16:49 +0100 | [diff] [blame] | 958 | mvc 8(8,%r12),__LC_THREAD_INFO |
| 959 | lg %r12,__LC_THREAD_INFO |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 960 | mvc SP_PSW(16,%r15),__LC_SVC_OLD_PSW |
Martin Schwidefsky | 20b40a7 | 2011-10-30 15:16:47 +0100 | [diff] [blame] | 961 | mvc SP_SVC_CODE(4,%r15),__LC_SVC_ILC |
Martin Schwidefsky | b6ef5bb | 2011-10-30 15:16:49 +0100 | [diff] [blame] | 962 | oi __TI_flags+7(%r12),_TIF_SYSCALL |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 963 | cleanup_vtime: |
| 964 | clc __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn+24) |
| 965 | jhe cleanup_stime |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 966 | UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER |
| 967 | cleanup_stime: |
| 968 | clc __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn+32) |
| 969 | jh cleanup_update |
| 970 | UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER |
| 971 | cleanup_update: |
| 972 | mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 973 | srag %r12,%r11,23 |
| 974 | lg %r12,__LC_THREAD_INFO |
| 975 | jz 0f |
| 976 | stg %r11,__TI_last_break(%r12) |
| 977 | 0: mvc __LC_RETURN_PSW+8(8),BASED(cleanup_table_system_call+8) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 978 | la %r12,__LC_RETURN_PSW |
| 979 | br %r14 |
| 980 | cleanup_system_call_insn: |
| 981 | .quad sysc_saveall |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 982 | .quad system_call |
| 983 | .quad sysc_vtime |
| 984 | .quad sysc_stime |
| 985 | .quad sysc_update |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 986 | |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 987 | cleanup_sysc_tif: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 988 | mvc __LC_RETURN_PSW(8),0(%r12) |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 989 | mvc __LC_RETURN_PSW+8(8),BASED(cleanup_table_sysc_tif) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 990 | la %r12,__LC_RETURN_PSW |
| 991 | br %r14 |
| 992 | |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 993 | cleanup_sysc_restore: |
| 994 | clc 8(8,%r12),BASED(cleanup_sysc_restore_insn) |
Martin Schwidefsky | 6377981 | 2010-05-17 10:00:03 +0200 | [diff] [blame] | 995 | je 2f |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 996 | clc 8(8,%r12),BASED(cleanup_sysc_restore_insn+8) |
Martin Schwidefsky | c742b31 | 2008-12-31 15:11:42 +0100 | [diff] [blame] | 997 | jhe 0f |
Martin Schwidefsky | 6377981 | 2010-05-17 10:00:03 +0200 | [diff] [blame] | 998 | mvc __LC_EXIT_TIMER(8),__LC_MCCK_ENTER_TIMER |
| 999 | cghi %r12,__LC_MCK_OLD_PSW |
| 1000 | je 0f |
Martin Schwidefsky | c742b31 | 2008-12-31 15:11:42 +0100 | [diff] [blame] | 1001 | mvc __LC_EXIT_TIMER(8),__LC_ASYNC_ENTER_TIMER |
| 1002 | 0: mvc __LC_RETURN_PSW(16),SP_PSW(%r15) |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 1003 | cghi %r12,__LC_MCK_OLD_PSW |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 1004 | la %r12,__LC_SAVE_AREA+80 |
Martin Schwidefsky | 6377981 | 2010-05-17 10:00:03 +0200 | [diff] [blame] | 1005 | je 1f |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 1006 | la %r12,__LC_SAVE_AREA+40 |
| 1007 | 1: mvc 0(40,%r12),SP_R11(%r15) |
| 1008 | lmg %r0,%r10,SP_R0(%r15) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1009 | lg %r15,SP_R15(%r15) |
Martin Schwidefsky | 6377981 | 2010-05-17 10:00:03 +0200 | [diff] [blame] | 1010 | 2: la %r12,__LC_RETURN_PSW |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1011 | br %r14 |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 1012 | cleanup_sysc_restore_insn: |
Heiko Carstens | 411788e | 2007-11-20 11:13:32 +0100 | [diff] [blame] | 1013 | .quad sysc_done - 4 |
Martin Schwidefsky | c742b31 | 2008-12-31 15:11:42 +0100 | [diff] [blame] | 1014 | .quad sysc_done - 16 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1015 | |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 1016 | cleanup_io_tif: |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 1017 | mvc __LC_RETURN_PSW(8),0(%r12) |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 1018 | mvc __LC_RETURN_PSW+8(8),BASED(cleanup_table_io_tif) |
Martin Schwidefsky | 176b180 | 2010-04-09 13:43:00 +0200 | [diff] [blame] | 1019 | la %r12,__LC_RETURN_PSW |
| 1020 | br %r14 |
| 1021 | |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 1022 | cleanup_io_restore: |
| 1023 | clc 8(8,%r12),BASED(cleanup_io_restore_insn) |
Martin Schwidefsky | 6377981 | 2010-05-17 10:00:03 +0200 | [diff] [blame] | 1024 | je 1f |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 1025 | clc 8(8,%r12),BASED(cleanup_io_restore_insn+8) |
Martin Schwidefsky | c742b31 | 2008-12-31 15:11:42 +0100 | [diff] [blame] | 1026 | jhe 0f |
Martin Schwidefsky | 6377981 | 2010-05-17 10:00:03 +0200 | [diff] [blame] | 1027 | mvc __LC_EXIT_TIMER(8),__LC_MCCK_ENTER_TIMER |
Martin Schwidefsky | c742b31 | 2008-12-31 15:11:42 +0100 | [diff] [blame] | 1028 | 0: mvc __LC_RETURN_PSW(16),SP_PSW(%r15) |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 1029 | mvc __LC_SAVE_AREA+80(40),SP_R11(%r15) |
| 1030 | lmg %r0,%r10,SP_R0(%r15) |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 1031 | lg %r15,SP_R15(%r15) |
Martin Schwidefsky | 6377981 | 2010-05-17 10:00:03 +0200 | [diff] [blame] | 1032 | 1: la %r12,__LC_RETURN_PSW |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 1033 | br %r14 |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 1034 | cleanup_io_restore_insn: |
Heiko Carstens | 411788e | 2007-11-20 11:13:32 +0100 | [diff] [blame] | 1035 | .quad io_done - 4 |
Martin Schwidefsky | c742b31 | 2008-12-31 15:11:42 +0100 | [diff] [blame] | 1036 | .quad io_done - 16 |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 1037 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1038 | /* |
| 1039 | * Integer constants |
| 1040 | */ |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 1041 | .align 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1042 | .Lcritical_start: |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 1043 | .quad __critical_start |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1044 | .Lcritical_end: |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 1045 | .quad __critical_end |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1046 | |
Martin Schwidefsky | 603d1a5 | 2011-07-24 10:48:18 +0200 | [diff] [blame] | 1047 | #if defined(CONFIG_KVM) || defined(CONFIG_KVM_MODULE) |
| 1048 | /* |
| 1049 | * sie64a calling convention: |
| 1050 | * %r2 pointer to sie control block |
| 1051 | * %r3 guest register save area |
| 1052 | */ |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 1053 | ENTRY(sie64a) |
Martin Schwidefsky | 603d1a5 | 2011-07-24 10:48:18 +0200 | [diff] [blame] | 1054 | stmg %r6,%r14,__SF_GPRS(%r15) # save kernel registers |
| 1055 | stg %r2,__SF_EMPTY(%r15) # save control block pointer |
| 1056 | stg %r3,__SF_EMPTY+8(%r15) # save guest register save area |
Martin Schwidefsky | ddd6f95 | 2011-12-27 11:27:13 +0100 | [diff] [blame^] | 1057 | xc __SF_EMPTY+16(8,%r15),__SF_EMPTY+16(%r15) # host id == 0 |
Martin Schwidefsky | 603d1a5 | 2011-07-24 10:48:18 +0200 | [diff] [blame] | 1058 | lmg %r0,%r13,0(%r3) # load guest gprs 0-13 |
| 1059 | lg %r14,__LC_THREAD_INFO # pointer thread_info struct |
| 1060 | oi __TI_flags+6(%r14),_TIF_SIE>>8 |
| 1061 | sie_loop: |
| 1062 | lg %r14,__LC_THREAD_INFO # pointer thread_info struct |
| 1063 | tm __TI_flags+7(%r14),_TIF_EXIT_SIE |
| 1064 | jnz sie_exit |
Christian Borntraeger | 480e592 | 2011-09-20 17:07:28 +0200 | [diff] [blame] | 1065 | lg %r14,__LC_GMAP # get gmap pointer |
| 1066 | ltgr %r14,%r14 |
| 1067 | jz sie_gmap |
| 1068 | lctlg %c1,%c1,__GMAP_ASCE(%r14) # load primary asce |
| 1069 | sie_gmap: |
Martin Schwidefsky | 603d1a5 | 2011-07-24 10:48:18 +0200 | [diff] [blame] | 1070 | lg %r14,__SF_EMPTY(%r15) # get control block pointer |
| 1071 | SPP __SF_EMPTY(%r15) # set guest id |
| 1072 | sie 0(%r14) |
| 1073 | sie_done: |
Martin Schwidefsky | ddd6f95 | 2011-12-27 11:27:13 +0100 | [diff] [blame^] | 1074 | SPP __SF_EMPTY+16(%r15) # set host id |
Martin Schwidefsky | 603d1a5 | 2011-07-24 10:48:18 +0200 | [diff] [blame] | 1075 | lg %r14,__LC_THREAD_INFO # pointer thread_info struct |
| 1076 | sie_exit: |
Christian Borntraeger | 480e592 | 2011-09-20 17:07:28 +0200 | [diff] [blame] | 1077 | lctlg %c1,%c1,__LC_USER_ASCE # load primary asce |
Martin Schwidefsky | 603d1a5 | 2011-07-24 10:48:18 +0200 | [diff] [blame] | 1078 | ni __TI_flags+6(%r14),255-(_TIF_SIE>>8) |
| 1079 | lg %r14,__SF_EMPTY+8(%r15) # load guest register save area |
| 1080 | stmg %r0,%r13,0(%r14) # save guest gprs 0-13 |
| 1081 | lmg %r6,%r14,__SF_GPRS(%r15) # restore kernel registers |
| 1082 | lghi %r2,0 |
| 1083 | br %r14 |
| 1084 | sie_fault: |
Carsten Otte | 69ba974 | 2011-10-30 15:16:59 +0100 | [diff] [blame] | 1085 | lctlg %c1,%c1,__LC_USER_ASCE # load primary asce |
Martin Schwidefsky | 603d1a5 | 2011-07-24 10:48:18 +0200 | [diff] [blame] | 1086 | lg %r14,__LC_THREAD_INFO # pointer thread_info struct |
| 1087 | ni __TI_flags+6(%r14),255-(_TIF_SIE>>8) |
| 1088 | lg %r14,__SF_EMPTY+8(%r15) # load guest register save area |
| 1089 | stmg %r0,%r13,0(%r14) # save guest gprs 0-13 |
| 1090 | lmg %r6,%r14,__SF_GPRS(%r15) # restore kernel registers |
| 1091 | lghi %r2,-EFAULT |
| 1092 | br %r14 |
| 1093 | |
| 1094 | .align 8 |
| 1095 | .Lsie_loop: |
| 1096 | .quad sie_loop |
| 1097 | .Lsie_done: |
| 1098 | .quad sie_done |
Martin Schwidefsky | ddd6f95 | 2011-12-27 11:27:13 +0100 | [diff] [blame^] | 1099 | .Lhost_id: |
| 1100 | .quad 0 |
Martin Schwidefsky | 603d1a5 | 2011-07-24 10:48:18 +0200 | [diff] [blame] | 1101 | |
| 1102 | .section __ex_table,"a" |
| 1103 | .quad sie_loop,sie_fault |
| 1104 | .previous |
| 1105 | #endif |
| 1106 | |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 1107 | .section .rodata, "a" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1108 | #define SYSCALL(esa,esame,emu) .long esame |
Heiko Carstens | 9bf1226 | 2009-06-12 10:26:47 +0200 | [diff] [blame] | 1109 | .globl sys_call_table |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1110 | sys_call_table: |
| 1111 | #include "syscalls.S" |
| 1112 | #undef SYSCALL |
| 1113 | |
Martin Schwidefsky | 347a8dc | 2006-01-06 00:19:28 -0800 | [diff] [blame] | 1114 | #ifdef CONFIG_COMPAT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1115 | |
| 1116 | #define SYSCALL(esa,esame,emu) .long emu |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1117 | sys_call_table_emu: |
| 1118 | #include "syscalls.S" |
| 1119 | #undef SYSCALL |
| 1120 | #endif |