Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * arch/s390/kernel/entry.S |
| 3 | * S390 low-level entry points. |
| 4 | * |
Heiko Carstens | 54dfe5d | 2006-02-01 03:06:38 -0800 | [diff] [blame] | 5 | * Copyright (C) IBM Corp. 1999,2006 |
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 | |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 22 | __PT_R0 = __PT_GPRS |
| 23 | __PT_R1 = __PT_GPRS + 4 |
| 24 | __PT_R2 = __PT_GPRS + 8 |
| 25 | __PT_R3 = __PT_GPRS + 12 |
| 26 | __PT_R4 = __PT_GPRS + 16 |
| 27 | __PT_R5 = __PT_GPRS + 20 |
| 28 | __PT_R6 = __PT_GPRS + 24 |
| 29 | __PT_R7 = __PT_GPRS + 28 |
| 30 | __PT_R8 = __PT_GPRS + 32 |
| 31 | __PT_R9 = __PT_GPRS + 36 |
| 32 | __PT_R10 = __PT_GPRS + 40 |
| 33 | __PT_R11 = __PT_GPRS + 44 |
| 34 | __PT_R12 = __PT_GPRS + 48 |
| 35 | __PT_R13 = __PT_GPRS + 524 |
| 36 | __PT_R14 = __PT_GPRS + 56 |
| 37 | __PT_R15 = __PT_GPRS + 60 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 39 | _TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \ |
Martin Schwidefsky | b6ef5bb | 2011-10-30 15:16:49 +0100 | [diff] [blame] | 40 | _TIF_MCCK_PENDING | _TIF_PER_TRAP ) |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 41 | _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \ |
Heiko Carstens | 54dfe5d | 2006-02-01 03:06:38 -0800 | [diff] [blame] | 42 | _TIF_MCCK_PENDING) |
Martin Schwidefsky | b6ef5bb | 2011-10-30 15:16:49 +0100 | [diff] [blame] | 43 | _TIF_TRACE = (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SECCOMP | \ |
| 44 | _TIF_SYSCALL_TRACEPOINT) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | |
| 46 | STACK_SHIFT = PAGE_SHIFT + THREAD_ORDER |
| 47 | STACK_SIZE = 1 << STACK_SHIFT |
| 48 | |
| 49 | #define BASED(name) name-system_call(%r13) |
| 50 | |
Heiko Carstens | 1f194a4 | 2006-07-03 00:24:46 -0700 | [diff] [blame] | 51 | .macro TRACE_IRQS_ON |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 52 | #ifdef CONFIG_TRACE_IRQFLAGS |
Heiko Carstens | 50bec4c | 2008-11-14 18:18:05 +0100 | [diff] [blame] | 53 | basr %r2,%r0 |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 54 | l %r1,BASED(.Lhardirqs_on) |
| 55 | basr %r14,%r1 # call trace_hardirqs_on_caller |
| 56 | #endif |
Heiko Carstens | 1f194a4 | 2006-07-03 00:24:46 -0700 | [diff] [blame] | 57 | .endm |
| 58 | |
| 59 | .macro TRACE_IRQS_OFF |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 60 | #ifdef CONFIG_TRACE_IRQFLAGS |
Heiko Carstens | 50bec4c | 2008-11-14 18:18:05 +0100 | [diff] [blame] | 61 | basr %r2,%r0 |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 62 | l %r1,BASED(.Lhardirqs_off) |
| 63 | basr %r14,%r1 # call trace_hardirqs_off_caller |
Heiko Carstens | 411788e | 2007-11-20 11:13:32 +0100 | [diff] [blame] | 64 | #endif |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 65 | .endm |
Heiko Carstens | 411788e | 2007-11-20 11:13:32 +0100 | [diff] [blame] | 66 | |
Heiko Carstens | 411788e | 2007-11-20 11:13:32 +0100 | [diff] [blame] | 67 | .macro LOCKDEP_SYS_EXIT |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 68 | #ifdef CONFIG_LOCKDEP |
| 69 | tm __PT_PSW+1(%r11),0x01 # returning to user ? |
| 70 | jz .+10 |
Heiko Carstens | 411788e | 2007-11-20 11:13:32 +0100 | [diff] [blame] | 71 | l %r1,BASED(.Llockdep_sys_exit) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 72 | basr %r14,%r1 # call lockdep_sys_exit |
Heiko Carstens | 1f194a4 | 2006-07-03 00:24:46 -0700 | [diff] [blame] | 73 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | .endm |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 76 | .macro CHECK_STACK stacksize,savearea |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 77 | #ifdef CONFIG_CHECK_STACK |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 78 | tml %r15,\stacksize - CONFIG_STACK_GUARD |
| 79 | la %r14,\savearea |
| 80 | jz stack_overflow |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 81 | #endif |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 82 | .endm |
| 83 | |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 84 | .macro SWITCH_ASYNC savearea,stack,shift |
| 85 | tmh %r8,0x0001 # interrupting from user ? |
| 86 | jnz 1f |
| 87 | lr %r14,%r9 |
| 88 | sl %r14,BASED(.Lcritical_start) |
| 89 | cl %r14,BASED(.Lcritical_length) |
| 90 | jhe 0f |
| 91 | la %r11,\savearea # inside critical section, do cleanup |
| 92 | bras %r14,cleanup_critical |
| 93 | tmh %r8,0x0001 # retest problem state after cleanup |
| 94 | jnz 1f |
| 95 | 0: l %r14,\stack # are we already on the target stack? |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 96 | slr %r14,%r15 |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 97 | sra %r14,\shift |
| 98 | jnz 1f |
| 99 | CHECK_STACK 1<<\shift,\savearea |
| 100 | j 2f |
| 101 | 1: l %r15,\stack # load target stack |
| 102 | 2: ahi %r15,-(STACK_FRAME_OVERHEAD + __PT_SIZE) |
| 103 | la %r11,STACK_FRAME_OVERHEAD(%r15) |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 104 | .endm |
| 105 | |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 106 | .macro ADD64 high,low,timer |
| 107 | al \high,\timer |
| 108 | al \low,\timer+4 |
| 109 | brc 12,.+8 |
| 110 | ahi \high,1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 111 | .endm |
| 112 | |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 113 | .macro SUB64 high,low,timer |
| 114 | sl \high,\timer |
| 115 | sl \low,\timer+4 |
| 116 | brc 3,.+8 |
| 117 | ahi \high,-1 |
| 118 | .endm |
| 119 | |
| 120 | .macro UPDATE_VTIME high,low,enter_timer |
| 121 | lm \high,\low,__LC_EXIT_TIMER |
| 122 | SUB64 \high,\low,\enter_timer |
| 123 | ADD64 \high,\low,__LC_USER_TIMER |
| 124 | stm \high,\low,__LC_USER_TIMER |
| 125 | lm \high,\low,__LC_LAST_UPDATE_TIMER |
| 126 | SUB64 \high,\low,__LC_EXIT_TIMER |
| 127 | ADD64 \high,\low,__LC_SYSTEM_TIMER |
| 128 | stm \high,\low,__LC_SYSTEM_TIMER |
| 129 | mvc __LC_LAST_UPDATE_TIMER(8),\enter_timer |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 130 | .endm |
| 131 | |
Martin Schwidefsky | 1e54622 | 2010-10-25 16:10:37 +0200 | [diff] [blame] | 132 | .macro REENABLE_IRQS |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 133 | st %r8,__LC_RETURN_PSW |
| 134 | ni __LC_RETURN_PSW,0xbf |
| 135 | ssm __LC_RETURN_PSW |
Martin Schwidefsky | 1e54622 | 2010-10-25 16:10:37 +0200 | [diff] [blame] | 136 | .endm |
| 137 | |
Martin Schwidefsky | 860dba4 | 2011-01-05 12:47:25 +0100 | [diff] [blame] | 138 | .section .kprobes.text, "ax" |
| 139 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 140 | /* |
| 141 | * Scheduler resume function, called by switch_to |
| 142 | * gpr2 = (task_struct *) prev |
| 143 | * gpr3 = (task_struct *) next |
| 144 | * Returns: |
| 145 | * gpr2 = prev |
| 146 | */ |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 147 | ENTRY(__switch_to) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 148 | l %r4,__THREAD_info(%r2) # get thread_info of prev |
Martin Schwidefsky | 5e9a269 | 2011-01-05 12:48:10 +0100 | [diff] [blame] | 149 | l %r5,__THREAD_info(%r3) # get thread_info of next |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 150 | tm __TI_flags+3(%r4),_TIF_MCCK_PENDING # machine check pending? |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 151 | jz 0f |
Martin Schwidefsky | 5e9a269 | 2011-01-05 12:48:10 +0100 | [diff] [blame] | 152 | ni __TI_flags+3(%r4),255-_TIF_MCCK_PENDING # clear flag in prev |
| 153 | oi __TI_flags+3(%r5),_TIF_MCCK_PENDING # set it in next |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 154 | 0: stm %r6,%r15,__SF_GPRS(%r15) # store gprs of prev task |
Martin Schwidefsky | 5e9a269 | 2011-01-05 12:48:10 +0100 | [diff] [blame] | 155 | st %r15,__THREAD_ksp(%r2) # store kernel stack of prev |
| 156 | l %r15,__THREAD_ksp(%r3) # load kernel stack of next |
| 157 | lctl %c4,%c4,__TASK_pid(%r3) # load pid to control reg. 4 |
| 158 | lm %r6,%r15,__SF_GPRS(%r15) # load gprs of next task |
| 159 | st %r3,__LC_CURRENT # store task struct of next |
Heiko Carstens | f2db2e6 | 2011-05-23 10:24:34 +0200 | [diff] [blame] | 160 | mvc __LC_CURRENT_PID(4,%r0),__TASK_pid(%r3) # store pid of next |
Martin Schwidefsky | 5e9a269 | 2011-01-05 12:48:10 +0100 | [diff] [blame] | 161 | st %r5,__LC_THREAD_INFO # store thread info of next |
| 162 | ahi %r5,STACK_SIZE # end of kernel stack of next |
| 163 | st %r5,__LC_KERNEL_STACK # store end of kernel stack |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 164 | br %r14 |
| 165 | |
| 166 | __critical_start: |
| 167 | /* |
| 168 | * SVC interrupt handler routine. System calls are synchronous events and |
| 169 | * are executed with interrupts enabled. |
| 170 | */ |
| 171 | |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 172 | ENTRY(system_call) |
Martin Schwidefsky | c185b78 | 2008-12-25 13:39:25 +0100 | [diff] [blame] | 173 | stpt __LC_SYNC_ENTER_TIMER |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 174 | sysc_stm: |
| 175 | stm %r8,%r15,__LC_SAVE_AREA_SYNC |
| 176 | l %r12,__LC_THREAD_INFO |
| 177 | l %r13,__LC_SVC_NEW_PSW+4 |
| 178 | sysc_per: |
| 179 | l %r15,__LC_KERNEL_STACK |
| 180 | ahi %r15,-(STACK_FRAME_OVERHEAD + __PT_SIZE) |
| 181 | la %r11,STACK_FRAME_OVERHEAD(%r15) # pointer to pt_regs |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 182 | sysc_vtime: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 183 | UPDATE_VTIME %r8,%r9,__LC_SYNC_ENTER_TIMER |
| 184 | stm %r0,%r7,__PT_R0(%r11) |
| 185 | mvc __PT_R8(32,%r11),__LC_SAVE_AREA_SYNC |
| 186 | mvc __PT_PSW(8,%r11),__LC_SVC_OLD_PSW |
Martin Schwidefsky | aa33c8c | 2011-12-27 11:27:18 +0100 | [diff] [blame] | 187 | mvc __PT_INT_CODE(4,%r11),__LC_SVC_ILC |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 188 | sysc_do_svc: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 189 | oi __TI_flags+3(%r12),_TIF_SYSCALL |
Martin Schwidefsky | aa33c8c | 2011-12-27 11:27:18 +0100 | [diff] [blame] | 190 | lh %r8,__PT_INT_CODE+2(%r11) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 191 | sla %r8,2 # shift and test for svc0 |
| 192 | jnz sysc_nr_ok |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 193 | # svc 0: system call number in %r1 |
| 194 | cl %r1,BASED(.Lnr_syscalls) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 195 | jnl sysc_nr_ok |
Martin Schwidefsky | aa33c8c | 2011-12-27 11:27:18 +0100 | [diff] [blame] | 196 | sth %r1,__PT_INT_CODE+2(%r11) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 197 | lr %r8,%r1 |
| 198 | sla %r8,2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 199 | sysc_nr_ok: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 200 | l %r10,BASED(.Lsys_call_table) # 31 bit system call table |
| 201 | xc __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15) |
| 202 | st %r2,__PT_ORIG_GPR2(%r11) |
| 203 | st %r7,STACK_FRAME_OVERHEAD(%r15) |
| 204 | l %r9,0(%r8,%r10) # get system call addr. |
Martin Schwidefsky | b6ef5bb | 2011-10-30 15:16:49 +0100 | [diff] [blame] | 205 | tm __TI_flags+2(%r12),_TIF_TRACE >> 8 |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 206 | jnz sysc_tracesys |
| 207 | basr %r14,%r9 # call sys_xxxx |
| 208 | st %r2,__PT_R2(%r11) # store return value |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 209 | |
| 210 | sysc_return: |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 211 | LOCKDEP_SYS_EXIT |
| 212 | sysc_tif: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 213 | tm __PT_PSW+1(%r11),0x01 # returning to user ? |
| 214 | jno sysc_restore |
Martin Schwidefsky | 1de3447 | 2011-01-05 12:47:57 +0100 | [diff] [blame] | 215 | tm __TI_flags+3(%r12),_TIF_WORK_SVC |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 216 | jnz sysc_work # check for work |
Martin Schwidefsky | b6ef5bb | 2011-10-30 15:16:49 +0100 | [diff] [blame] | 217 | ni __TI_flags+3(%r12),255-_TIF_SYSCALL |
Heiko Carstens | 411788e | 2007-11-20 11:13:32 +0100 | [diff] [blame] | 218 | sysc_restore: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 219 | mvc __LC_RETURN_PSW(8),__PT_PSW(%r11) |
| 220 | stpt __LC_EXIT_TIMER |
| 221 | lm %r0,%r15,__PT_R0(%r11) |
| 222 | lpsw __LC_RETURN_PSW |
Heiko Carstens | 411788e | 2007-11-20 11:13:32 +0100 | [diff] [blame] | 223 | sysc_done: |
| 224 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 225 | # |
Martin Schwidefsky | 43d399d | 2010-05-17 10:00:01 +0200 | [diff] [blame] | 226 | # One of the work bits is on. Find out which one. |
| 227 | # |
Martin Schwidefsky | b6ef5bb | 2011-10-30 15:16:49 +0100 | [diff] [blame] | 228 | sysc_work: |
Martin Schwidefsky | 1de3447 | 2011-01-05 12:47:57 +0100 | [diff] [blame] | 229 | tm __TI_flags+3(%r12),_TIF_MCCK_PENDING |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 230 | jo sysc_mcck_pending |
Martin Schwidefsky | 1de3447 | 2011-01-05 12:47:57 +0100 | [diff] [blame] | 231 | tm __TI_flags+3(%r12),_TIF_NEED_RESCHED |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 232 | jo sysc_reschedule |
Martin Schwidefsky | 1de3447 | 2011-01-05 12:47:57 +0100 | [diff] [blame] | 233 | tm __TI_flags+3(%r12),_TIF_SIGPENDING |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 234 | jo sysc_sigpending |
Martin Schwidefsky | 1de3447 | 2011-01-05 12:47:57 +0100 | [diff] [blame] | 235 | tm __TI_flags+3(%r12),_TIF_NOTIFY_RESUME |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 236 | jo sysc_notify_resume |
Martin Schwidefsky | 5e9a269 | 2011-01-05 12:48:10 +0100 | [diff] [blame] | 237 | tm __TI_flags+3(%r12),_TIF_PER_TRAP |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 238 | jo sysc_singlestep |
| 239 | j sysc_return # beware of critical section cleanup |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 240 | |
| 241 | # |
| 242 | # _TIF_NEED_RESCHED is set, call schedule |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 243 | # |
| 244 | sysc_reschedule: |
| 245 | l %r1,BASED(.Lschedule) |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 246 | la %r14,BASED(sysc_return) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 247 | br %r1 # call schedule |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 248 | |
| 249 | # |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 250 | # _TIF_MCCK_PENDING is set, call handler |
| 251 | # |
| 252 | sysc_mcck_pending: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 253 | l %r1,BASED(.Lhandle_mcck) |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 254 | la %r14,BASED(sysc_return) |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 255 | br %r1 # TIF bit will be cleared by handler |
| 256 | |
| 257 | # |
Roland McGrath | 02a029b | 2008-04-30 00:53:08 -0700 | [diff] [blame] | 258 | # _TIF_SIGPENDING is set, call do_signal |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 259 | # |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 260 | sysc_sigpending: |
Martin Schwidefsky | 5e9a269 | 2011-01-05 12:48:10 +0100 | [diff] [blame] | 261 | ni __TI_flags+3(%r12),255-_TIF_PER_TRAP # clear TIF_PER_TRAP |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 262 | lr %r2,%r11 # pass pointer to pt_regs |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 263 | l %r1,BASED(.Ldo_signal) |
| 264 | basr %r14,%r1 # call do_signal |
Martin Schwidefsky | b6ef5bb | 2011-10-30 15:16:49 +0100 | [diff] [blame] | 265 | tm __TI_flags+3(%r12),_TIF_SYSCALL |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 266 | jno sysc_return |
| 267 | lm %r2,%r7,__PT_R2(%r11) # load svc arguments |
| 268 | xr %r8,%r8 # svc 0 returns -ENOSYS |
Martin Schwidefsky | aa33c8c | 2011-12-27 11:27:18 +0100 | [diff] [blame] | 269 | clc __PT_INT_CODE+2(2,%r11),BASED(.Lnr_syscalls+2) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 270 | jnl sysc_nr_ok # invalid svc number -> do svc 0 |
Martin Schwidefsky | aa33c8c | 2011-12-27 11:27:18 +0100 | [diff] [blame] | 271 | lh %r8,__PT_INT_CODE+2(%r11) # load new svc number |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 272 | sla %r8,2 |
| 273 | j sysc_nr_ok # restart svc |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 274 | |
| 275 | # |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 276 | # _TIF_NOTIFY_RESUME is set, call do_notify_resume |
| 277 | # |
| 278 | sysc_notify_resume: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 279 | lr %r2,%r11 # pass pointer to pt_regs |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 280 | l %r1,BASED(.Ldo_notify_resume) |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 281 | la %r14,BASED(sysc_return) |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 282 | br %r1 # call do_notify_resume |
| 283 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 284 | # |
Martin Schwidefsky | 5e9a269 | 2011-01-05 12:48:10 +0100 | [diff] [blame] | 285 | # _TIF_PER_TRAP is set, call do_per_trap |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 286 | # |
| 287 | sysc_singlestep: |
Martin Schwidefsky | b6ef5bb | 2011-10-30 15:16:49 +0100 | [diff] [blame] | 288 | ni __TI_flags+3(%r12),255-(_TIF_SYSCALL | _TIF_PER_TRAP) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 289 | lr %r2,%r11 # pass pointer to pt_regs |
| 290 | l %r1,BASED(.Ldo_per_trap) |
| 291 | la %r14,BASED(sysc_return) |
| 292 | br %r1 # call do_per_trap |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 293 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 294 | # |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 295 | # call tracehook_report_syscall_entry/tracehook_report_syscall_exit before |
| 296 | # and after the system call |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 297 | # |
| 298 | sysc_tracesys: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 299 | l %r1,BASED(.Ltrace_enter) |
| 300 | lr %r2,%r11 # pass pointer to pt_regs |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 301 | la %r3,0 |
Martin Schwidefsky | 1de3447 | 2011-01-05 12:47:57 +0100 | [diff] [blame] | 302 | xr %r0,%r0 |
Martin Schwidefsky | aa33c8c | 2011-12-27 11:27:18 +0100 | [diff] [blame] | 303 | icm %r0,3,__PT_INT_CODE+2(%r11) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 304 | st %r0,__PT_R2(%r11) |
| 305 | basr %r14,%r1 # call do_syscall_trace_enter |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 306 | cl %r2,BASED(.Lnr_syscalls) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 307 | jnl sysc_tracenogo |
| 308 | lr %r8,%r2 |
| 309 | sll %r8,2 |
| 310 | l %r9,0(%r8,%r10) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 311 | sysc_tracego: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 312 | lm %r3,%r7,__PT_R3(%r11) |
| 313 | st %r7,STACK_FRAME_OVERHEAD(%r15) |
| 314 | l %r2,__PT_ORIG_GPR2(%r11) |
| 315 | basr %r14,%r9 # call sys_xxx |
| 316 | st %r2,__PT_R2(%r11) # store return value |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 317 | sysc_tracenogo: |
Martin Schwidefsky | b6ef5bb | 2011-10-30 15:16:49 +0100 | [diff] [blame] | 318 | tm __TI_flags+2(%r12),_TIF_TRACE >> 8 |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 319 | jz sysc_return |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 320 | l %r1,BASED(.Ltrace_exit) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 321 | lr %r2,%r11 # pass pointer to pt_regs |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 322 | la %r14,BASED(sysc_return) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 323 | br %r1 # call do_syscall_trace_exit |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 324 | |
| 325 | # |
| 326 | # a new process exits the kernel with ret_from_fork |
| 327 | # |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 328 | ENTRY(ret_from_fork) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 329 | la %r11,STACK_FRAME_OVERHEAD(%r15) |
| 330 | l %r12,__LC_THREAD_INFO |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 331 | l %r13,__LC_SVC_NEW_PSW+4 |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 332 | tm __PT_PSW+1(%r11),0x01 # forking a kernel thread ? |
| 333 | jo 0f |
| 334 | st %r15,__PT_R15(%r11) # store stack pointer for new kthread |
| 335 | 0: l %r1,BASED(.Lschedule_tail) |
| 336 | basr %r14,%r1 # call schedule_tail |
Heiko Carstens | 1f194a4 | 2006-07-03 00:24:46 -0700 | [diff] [blame] | 337 | TRACE_IRQS_ON |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 338 | ssm __LC_SVC_NEW_PSW # reenable interrupts |
| 339 | j sysc_tracenogo |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 340 | |
| 341 | # |
Martin Schwidefsky | 03ff9a2 | 2007-04-27 16:01:40 +0200 | [diff] [blame] | 342 | # kernel_execve function needs to deal with pt_regs that is not |
| 343 | # at the usual place |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 344 | # |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 345 | ENTRY(kernel_execve) |
Martin Schwidefsky | 03ff9a2 | 2007-04-27 16:01:40 +0200 | [diff] [blame] | 346 | stm %r12,%r15,48(%r15) |
| 347 | lr %r14,%r15 |
| 348 | l %r13,__LC_SVC_NEW_PSW+4 |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 349 | ahi %r15,-(STACK_FRAME_OVERHEAD + __PT_SIZE) |
Martin Schwidefsky | 03ff9a2 | 2007-04-27 16:01:40 +0200 | [diff] [blame] | 350 | st %r14,__SF_BACKCHAIN(%r15) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 351 | la %r12,STACK_FRAME_OVERHEAD(%r15) |
Martin Schwidefsky | 03ff9a2 | 2007-04-27 16:01:40 +0200 | [diff] [blame] | 352 | xc 0(__PT_SIZE,%r12),0(%r12) |
| 353 | l %r1,BASED(.Ldo_execve) |
| 354 | lr %r5,%r12 |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 355 | basr %r14,%r1 # call do_execve |
Martin Schwidefsky | 03ff9a2 | 2007-04-27 16:01:40 +0200 | [diff] [blame] | 356 | ltr %r2,%r2 |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 357 | je 0f |
| 358 | ahi %r15,(STACK_FRAME_OVERHEAD + __PT_SIZE) |
Martin Schwidefsky | 03ff9a2 | 2007-04-27 16:01:40 +0200 | [diff] [blame] | 359 | lm %r12,%r15,48(%r15) |
| 360 | br %r14 |
| 361 | # execve succeeded. |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 362 | 0: ssm __LC_PGM_NEW_PSW # disable I/O and ext. interrupts |
Martin Schwidefsky | 03ff9a2 | 2007-04-27 16:01:40 +0200 | [diff] [blame] | 363 | l %r15,__LC_KERNEL_STACK # load ksp |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 364 | ahi %r15,-(STACK_FRAME_OVERHEAD + __PT_SIZE) |
| 365 | la %r11,STACK_FRAME_OVERHEAD(%r15) |
| 366 | mvc 0(__PT_SIZE,%r11),0(%r12) # copy pt_regs |
Martin Schwidefsky | 1de3447 | 2011-01-05 12:47:57 +0100 | [diff] [blame] | 367 | l %r12,__LC_THREAD_INFO |
Martin Schwidefsky | 03ff9a2 | 2007-04-27 16:01:40 +0200 | [diff] [blame] | 368 | xc __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 369 | ssm __LC_SVC_NEW_PSW # reenable interrupts |
Martin Schwidefsky | 03ff9a2 | 2007-04-27 16:01:40 +0200 | [diff] [blame] | 370 | l %r1,BASED(.Lexecve_tail) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 371 | basr %r14,%r1 # call execve_tail |
| 372 | j sysc_return |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 373 | |
| 374 | /* |
| 375 | * Program check handler routine |
| 376 | */ |
| 377 | |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 378 | ENTRY(pgm_check_handler) |
Martin Schwidefsky | c185b78 | 2008-12-25 13:39:25 +0100 | [diff] [blame] | 379 | stpt __LC_SYNC_ENTER_TIMER |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 380 | stm %r8,%r15,__LC_SAVE_AREA_SYNC |
| 381 | l %r12,__LC_THREAD_INFO |
| 382 | l %r13,__LC_SVC_NEW_PSW+4 |
| 383 | lm %r8,%r9,__LC_PGM_OLD_PSW |
| 384 | tmh %r8,0x0001 # test problem state bit |
| 385 | jnz 1f # -> fault in user space |
| 386 | tmh %r8,0x4000 # PER bit set in old PSW ? |
| 387 | jnz 0f # -> enabled, can't be a double fault |
| 388 | tm __LC_PGM_ILC+3,0x80 # check for per exception |
| 389 | jnz pgm_svcper # -> single stepped svc |
| 390 | 0: CHECK_STACK STACK_SIZE,__LC_SAVE_AREA_SYNC |
| 391 | j 2f |
| 392 | 1: UPDATE_VTIME %r14,%r15,__LC_SYNC_ENTER_TIMER |
| 393 | l %r15,__LC_KERNEL_STACK |
| 394 | 2: ahi %r15,-(STACK_FRAME_OVERHEAD + __PT_SIZE) |
| 395 | la %r11,STACK_FRAME_OVERHEAD(%r15) |
| 396 | stm %r0,%r7,__PT_R0(%r11) |
| 397 | mvc __PT_R8(32,%r11),__LC_SAVE_AREA_SYNC |
| 398 | stm %r8,%r9,__PT_PSW(%r11) |
Martin Schwidefsky | aa33c8c | 2011-12-27 11:27:18 +0100 | [diff] [blame] | 399 | mvc __PT_INT_CODE(4,%r11),__LC_PGM_ILC |
| 400 | mvc __PT_INT_PARM_LONG(4,%r11),__LC_TRANS_EXC_CODE |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 401 | tm __LC_PGM_ILC+3,0x80 # check for per exception |
| 402 | jz 0f |
Martin Schwidefsky | 1de3447 | 2011-01-05 12:47:57 +0100 | [diff] [blame] | 403 | l %r1,__TI_task(%r12) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 404 | tmh %r8,0x0001 # kernel per event ? |
| 405 | jz pgm_kprobe |
| 406 | oi __TI_flags+3(%r12),_TIF_PER_TRAP |
Martin Schwidefsky | 5e9a269 | 2011-01-05 12:48:10 +0100 | [diff] [blame] | 407 | mvc __THREAD_per_address(4,%r1),__LC_PER_ADDRESS |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 408 | mvc __THREAD_per_cause(2,%r1),__LC_PER_CAUSE |
Martin Schwidefsky | 5e9a269 | 2011-01-05 12:48:10 +0100 | [diff] [blame] | 409 | mvc __THREAD_per_paid(1,%r1),__LC_PER_PAID |
Martin Schwidefsky | aa33c8c | 2011-12-27 11:27:18 +0100 | [diff] [blame] | 410 | 0: REENABLE_IRQS |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 411 | xc __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15) |
Martin Schwidefsky | 1de3447 | 2011-01-05 12:47:57 +0100 | [diff] [blame] | 412 | l %r1,BASED(.Ljump_table) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 413 | la %r10,0x7f |
Martin Schwidefsky | aa33c8c | 2011-12-27 11:27:18 +0100 | [diff] [blame] | 414 | n %r10,__PT_INT_CODE(%r11) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 415 | je sysc_return |
| 416 | sll %r10,2 |
| 417 | l %r1,0(%r10,%r1) # load address of handler routine |
| 418 | lr %r2,%r11 # pass pointer to pt_regs |
Martin Schwidefsky | 1de3447 | 2011-01-05 12:47:57 +0100 | [diff] [blame] | 419 | basr %r14,%r1 # branch to interrupt-handler |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 420 | j sysc_return |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 421 | |
| 422 | # |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 423 | # PER event in supervisor state, must be kprobes |
| 424 | # |
| 425 | pgm_kprobe: |
| 426 | REENABLE_IRQS |
| 427 | xc __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15) |
| 428 | l %r1,BASED(.Ldo_per_trap) |
| 429 | lr %r2,%r11 # pass pointer to pt_regs |
| 430 | basr %r14,%r1 # call do_per_trap |
| 431 | j sysc_return |
| 432 | |
| 433 | # |
| 434 | # single stepped system call |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 435 | # |
| 436 | pgm_svcper: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 437 | oi __TI_flags+3(%r12),_TIF_PER_TRAP |
| 438 | mvc __LC_RETURN_PSW(4),__LC_SVC_NEW_PSW |
| 439 | mvc __LC_RETURN_PSW+4(4),BASED(.Lsysc_per) |
| 440 | lpsw __LC_RETURN_PSW # branch to sysc_per and enable irqs |
Michael Grundy | 4ba069b | 2006-09-20 15:58:39 +0200 | [diff] [blame] | 441 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 442 | /* |
| 443 | * IO interrupt handler routine |
| 444 | */ |
| 445 | |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 446 | ENTRY(io_int_handler) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 447 | stck __LC_INT_CLOCK |
Martin Schwidefsky | 9cfb9b3 | 2008-12-31 15:11:41 +0100 | [diff] [blame] | 448 | stpt __LC_ASYNC_ENTER_TIMER |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 449 | stm %r8,%r15,__LC_SAVE_AREA_ASYNC |
| 450 | l %r12,__LC_THREAD_INFO |
| 451 | l %r13,__LC_SVC_NEW_PSW+4 |
| 452 | lm %r8,%r9,__LC_IO_OLD_PSW |
| 453 | tmh %r8,0x0001 # interrupting from user ? |
| 454 | jz io_skip |
| 455 | UPDATE_VTIME %r14,%r15,__LC_ASYNC_ENTER_TIMER |
| 456 | io_skip: |
| 457 | SWITCH_ASYNC __LC_SAVE_AREA_ASYNC,__LC_ASYNC_STACK,STACK_SHIFT |
| 458 | stm %r0,%r7,__PT_R0(%r11) |
| 459 | mvc __PT_R8(32,%r11),__LC_SAVE_AREA_ASYNC |
| 460 | stm %r8,%r9,__PT_PSW(%r11) |
Heiko Carstens | 1f194a4 | 2006-07-03 00:24:46 -0700 | [diff] [blame] | 461 | TRACE_IRQS_OFF |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 462 | xc __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15) |
| 463 | l %r1,BASED(.Ldo_IRQ) |
| 464 | lr %r2,%r11 # pass pointer to pt_regs |
| 465 | basr %r14,%r1 # call do_IRQ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 466 | io_return: |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 467 | LOCKDEP_SYS_EXIT |
| 468 | TRACE_IRQS_ON |
| 469 | io_tif: |
Martin Schwidefsky | 1de3447 | 2011-01-05 12:47:57 +0100 | [diff] [blame] | 470 | tm __TI_flags+3(%r12),_TIF_WORK_INT |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 471 | jnz io_work # there is work to do (signals etc.) |
Heiko Carstens | 411788e | 2007-11-20 11:13:32 +0100 | [diff] [blame] | 472 | io_restore: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 473 | mvc __LC_RETURN_PSW(8),__PT_PSW(%r11) |
| 474 | ni __LC_RETURN_PSW+1,0xfd # clean wait state bit |
| 475 | stpt __LC_EXIT_TIMER |
| 476 | lm %r0,%r15,__PT_R0(%r11) |
| 477 | lpsw __LC_RETURN_PSW |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 478 | io_done: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 479 | |
Martin Schwidefsky | 2688905 | 2008-05-07 09:22:52 +0200 | [diff] [blame] | 480 | # |
Martin Schwidefsky | 43d399d | 2010-05-17 10:00:01 +0200 | [diff] [blame] | 481 | # There is work todo, find out in which context we have been interrupted: |
| 482 | # 1) if we return to user space we can do all _TIF_WORK_INT work |
| 483 | # 2) if we return to kernel code and preemptive scheduling is enabled check |
| 484 | # the preemption counter and if it is zero call preempt_schedule_irq |
| 485 | # 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] | 486 | # |
| 487 | io_work: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 488 | tm __PT_PSW+1(%r11),0x01 # returning to user ? |
| 489 | jo io_work_user # yes -> do resched & signal |
Martin Schwidefsky | 43d399d | 2010-05-17 10:00:01 +0200 | [diff] [blame] | 490 | #ifdef CONFIG_PREEMPT |
Martin Schwidefsky | 2688905 | 2008-05-07 09:22:52 +0200 | [diff] [blame] | 491 | # check for preemptive scheduling |
Martin Schwidefsky | 1de3447 | 2011-01-05 12:47:57 +0100 | [diff] [blame] | 492 | icm %r0,15,__TI_precount(%r12) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 493 | jnz io_restore # preemption disabled |
Martin Schwidefsky | 1de3447 | 2011-01-05 12:47:57 +0100 | [diff] [blame] | 494 | tm __TI_flags+3(%r12),_TIF_NEED_RESCHED |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 495 | jno io_restore |
Martin Schwidefsky | 43d399d | 2010-05-17 10:00:01 +0200 | [diff] [blame] | 496 | # switch to kernel stack |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 497 | l %r1,__PT_R15(%r11) |
| 498 | ahi %r1,-(STACK_FRAME_OVERHEAD + __PT_SIZE) |
| 499 | mvc STACK_FRAME_OVERHEAD(__PT_SIZE,%r1),0(%r11) |
| 500 | xc __SF_BACKCHAIN(4,%r1),__SF_BACKCHAIN(%r1) |
| 501 | la %r11,STACK_FRAME_OVERHEAD(%r1) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 502 | lr %r15,%r1 |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 503 | # TRACE_IRQS_ON already done at io_return, call |
| 504 | # TRACE_IRQS_OFF to keep things symmetrical |
| 505 | TRACE_IRQS_OFF |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 506 | l %r1,BASED(.Lpreempt_irq) |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 507 | basr %r14,%r1 # call preempt_schedule_irq |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 508 | j io_return |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 509 | #else |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 510 | j io_restore |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 511 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 512 | |
Martin Schwidefsky | 43d399d | 2010-05-17 10:00:01 +0200 | [diff] [blame] | 513 | # |
| 514 | # Need to do work before returning to userspace, switch to kernel stack |
| 515 | # |
Martin Schwidefsky | 2688905 | 2008-05-07 09:22:52 +0200 | [diff] [blame] | 516 | io_work_user: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 517 | l %r1,__LC_KERNEL_STACK |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 518 | ahi %r1,-(STACK_FRAME_OVERHEAD + __PT_SIZE) |
| 519 | mvc STACK_FRAME_OVERHEAD(__PT_SIZE,%r1),0(%r11) |
| 520 | xc __SF_BACKCHAIN(4,%r1),__SF_BACKCHAIN(%r1) |
| 521 | la %r11,STACK_FRAME_OVERHEAD(%r1) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 522 | lr %r15,%r1 |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 523 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 524 | # |
| 525 | # One of the work bits is on. Find out which one. |
Martin Schwidefsky | 43d399d | 2010-05-17 10:00:01 +0200 | [diff] [blame] | 526 | # Checked are: _TIF_SIGPENDING, _TIF_NOTIFY_RESUME, _TIF_NEED_RESCHED |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 527 | # and _TIF_MCCK_PENDING |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 528 | # |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 529 | io_work_tif: |
Martin Schwidefsky | 1de3447 | 2011-01-05 12:47:57 +0100 | [diff] [blame] | 530 | tm __TI_flags+3(%r12),_TIF_MCCK_PENDING |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 531 | jo io_mcck_pending |
Martin Schwidefsky | 1de3447 | 2011-01-05 12:47:57 +0100 | [diff] [blame] | 532 | tm __TI_flags+3(%r12),_TIF_NEED_RESCHED |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 533 | jo io_reschedule |
Martin Schwidefsky | 1de3447 | 2011-01-05 12:47:57 +0100 | [diff] [blame] | 534 | tm __TI_flags+3(%r12),_TIF_SIGPENDING |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 535 | jo io_sigpending |
Martin Schwidefsky | 1de3447 | 2011-01-05 12:47:57 +0100 | [diff] [blame] | 536 | tm __TI_flags+3(%r12),_TIF_NOTIFY_RESUME |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 537 | jo io_notify_resume |
| 538 | j io_return # beware of critical section cleanup |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 539 | |
| 540 | # |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 541 | # _TIF_MCCK_PENDING is set, call handler |
| 542 | # |
| 543 | io_mcck_pending: |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 544 | # TRACE_IRQS_ON already done at io_return |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 545 | l %r1,BASED(.Lhandle_mcck) |
Heiko Carstens | b771aea | 2007-07-27 12:29:18 +0200 | [diff] [blame] | 546 | basr %r14,%r1 # TIF bit will be cleared by handler |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 547 | TRACE_IRQS_OFF |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 548 | j io_return |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 549 | |
| 550 | # |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 551 | # _TIF_NEED_RESCHED is set, call schedule |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 552 | # |
| 553 | io_reschedule: |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 554 | # TRACE_IRQS_ON already done at io_return |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 555 | l %r1,BASED(.Lschedule) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 556 | ssm __LC_SVC_NEW_PSW # reenable interrupts |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 557 | basr %r14,%r1 # call scheduler |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 558 | ssm __LC_PGM_NEW_PSW # disable I/O and ext. interrupts |
Heiko Carstens | 411788e | 2007-11-20 11:13:32 +0100 | [diff] [blame] | 559 | TRACE_IRQS_OFF |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 560 | j io_return |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 561 | |
| 562 | # |
Roland McGrath | 02a029b | 2008-04-30 00:53:08 -0700 | [diff] [blame] | 563 | # _TIF_SIGPENDING is set, call do_signal |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 564 | # |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 565 | io_sigpending: |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 566 | # TRACE_IRQS_ON already done at io_return |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 567 | l %r1,BASED(.Ldo_signal) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 568 | ssm __LC_SVC_NEW_PSW # reenable interrupts |
| 569 | lr %r2,%r11 # pass pointer to pt_regs |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 570 | basr %r14,%r1 # call do_signal |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 571 | ssm __LC_PGM_NEW_PSW # disable I/O and ext. interrupts |
Heiko Carstens | 411788e | 2007-11-20 11:13:32 +0100 | [diff] [blame] | 572 | TRACE_IRQS_OFF |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 573 | j io_return |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 574 | |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 575 | # |
| 576 | # _TIF_SIGPENDING is set, call do_signal |
| 577 | # |
| 578 | io_notify_resume: |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 579 | # TRACE_IRQS_ON already done at io_return |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 580 | l %r1,BASED(.Ldo_notify_resume) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 581 | ssm __LC_SVC_NEW_PSW # reenable interrupts |
| 582 | lr %r2,%r11 # pass pointer to pt_regs |
| 583 | basr %r14,%r1 # call do_notify_resume |
| 584 | ssm __LC_PGM_NEW_PSW # disable I/O and ext. interrupts |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 585 | TRACE_IRQS_OFF |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 586 | j io_return |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 587 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 588 | /* |
| 589 | * External interrupt handler routine |
| 590 | */ |
| 591 | |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 592 | ENTRY(ext_int_handler) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 593 | stck __LC_INT_CLOCK |
Martin Schwidefsky | 9cfb9b3 | 2008-12-31 15:11:41 +0100 | [diff] [blame] | 594 | stpt __LC_ASYNC_ENTER_TIMER |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 595 | stm %r8,%r15,__LC_SAVE_AREA_ASYNC |
| 596 | l %r12,__LC_THREAD_INFO |
| 597 | l %r13,__LC_SVC_NEW_PSW+4 |
| 598 | lm %r8,%r9,__LC_EXT_OLD_PSW |
| 599 | tmh %r8,0x0001 # interrupting from user ? |
| 600 | jz ext_skip |
| 601 | UPDATE_VTIME %r14,%r15,__LC_ASYNC_ENTER_TIMER |
| 602 | ext_skip: |
| 603 | SWITCH_ASYNC __LC_SAVE_AREA_ASYNC,__LC_ASYNC_STACK,STACK_SHIFT |
| 604 | stm %r0,%r7,__PT_R0(%r11) |
| 605 | mvc __PT_R8(32,%r11),__LC_SAVE_AREA_ASYNC |
| 606 | stm %r8,%r9,__PT_PSW(%r11) |
Heiko Carstens | 1f194a4 | 2006-07-03 00:24:46 -0700 | [diff] [blame] | 607 | TRACE_IRQS_OFF |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 608 | lr %r2,%r11 # pass pointer to pt_regs |
Martin Schwidefsky | f6649a7 | 2010-10-25 16:10:38 +0200 | [diff] [blame] | 609 | l %r3,__LC_CPU_ADDRESS # get cpu address + interruption code |
| 610 | l %r4,__LC_EXT_PARAMS # get external parameters |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 611 | l %r1,BASED(.Ldo_extint) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 612 | basr %r14,%r1 # call do_extint |
| 613 | j io_return |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 614 | |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 615 | __critical_end: |
| 616 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 617 | /* |
| 618 | * Machine check handler routines |
| 619 | */ |
| 620 | |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 621 | ENTRY(mcck_int_handler) |
Martin Schwidefsky | 6377981 | 2010-05-17 10:00:03 +0200 | [diff] [blame] | 622 | stck __LC_MCCK_CLOCK |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 623 | spt __LC_CPU_TIMER_SAVE_AREA # revalidate cpu timer |
| 624 | lm %r0,%r15,__LC_GPREGS_SAVE_AREA # revalidate gprs |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 625 | l %r12,__LC_THREAD_INFO |
| 626 | l %r13,__LC_SVC_NEW_PSW+4 |
| 627 | lm %r8,%r9,__LC_MCK_OLD_PSW |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 628 | tm __LC_MCCK_CODE,0x80 # system damage? |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 629 | jo mcck_panic # yes -> rest of mcck code invalid |
| 630 | la %r14,__LC_CPU_TIMER_SAVE_AREA |
| 631 | mvc __LC_MCCK_ENTER_TIMER(8),0(%r14) |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 632 | tm __LC_MCCK_CODE+5,0x02 # stored cpu timer value valid? |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 633 | jo 3f |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 634 | la %r14,__LC_SYNC_ENTER_TIMER |
| 635 | clc 0(8,%r14),__LC_ASYNC_ENTER_TIMER |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 636 | jl 0f |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 637 | la %r14,__LC_ASYNC_ENTER_TIMER |
| 638 | 0: clc 0(8,%r14),__LC_EXIT_TIMER |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 639 | jl 1f |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 640 | la %r14,__LC_EXIT_TIMER |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 641 | 1: clc 0(8,%r14),__LC_LAST_UPDATE_TIMER |
| 642 | jl 2f |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 643 | la %r14,__LC_LAST_UPDATE_TIMER |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 644 | 2: spt 0(%r14) |
Martin Schwidefsky | 6377981 | 2010-05-17 10:00:03 +0200 | [diff] [blame] | 645 | mvc __LC_MCCK_ENTER_TIMER(8),0(%r14) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 646 | 3: tm __LC_MCCK_CODE+2,0x09 # mwp + ia of old psw valid? |
| 647 | jno mcck_panic # no -> skip cleanup critical |
| 648 | tm %r8,0x0001 # interrupting from user ? |
| 649 | jz mcck_skip |
| 650 | UPDATE_VTIME %r14,%r15,__LC_MCCK_ENTER_TIMER |
| 651 | mcck_skip: |
| 652 | SWITCH_ASYNC __LC_GPREGS_SAVE_AREA+32,__LC_PANIC_STACK,PAGE_SHIFT |
| 653 | mvc __PT_R0(64,%r11),__LC_GPREGS_SAVE_AREA |
| 654 | stm %r8,%r9,__PT_PSW(%r11) |
| 655 | xc __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15) |
| 656 | l %r1,BASED(.Ldo_machine_check) |
| 657 | lr %r2,%r11 # pass pointer to pt_regs |
| 658 | basr %r14,%r1 # call s390_do_machine_check |
| 659 | tm __PT_PSW+1(%r11),0x01 # returning to user ? |
| 660 | jno mcck_return |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 661 | l %r1,__LC_KERNEL_STACK # switch to kernel stack |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 662 | ahi %r1,-(STACK_FRAME_OVERHEAD + __PT_SIZE) |
| 663 | mvc STACK_FRAME_OVERHEAD(__PT_SIZE,%r1),0(%r11) |
| 664 | xc __SF_BACKCHAIN(4,%r1),__SF_BACKCHAIN(%r1) |
| 665 | la %r11,STACK_FRAME_OVERHEAD(%r15) |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 666 | lr %r15,%r1 |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 667 | ssm __LC_PGM_NEW_PSW # turn dat on, keep irqs off |
Martin Schwidefsky | 1de3447 | 2011-01-05 12:47:57 +0100 | [diff] [blame] | 668 | tm __TI_flags+3(%r12),_TIF_MCCK_PENDING |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 669 | jno mcck_return |
Heiko Carstens | 1f194a4 | 2006-07-03 00:24:46 -0700 | [diff] [blame] | 670 | TRACE_IRQS_OFF |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 671 | l %r1,BASED(.Lhandle_mcck) |
| 672 | basr %r14,%r1 # call s390_handle_mcck |
Heiko Carstens | 1f194a4 | 2006-07-03 00:24:46 -0700 | [diff] [blame] | 673 | TRACE_IRQS_ON |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 674 | mcck_return: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 675 | mvc __LC_RETURN_MCCK_PSW(8),__PT_PSW(%r11) # move return PSW |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 676 | ni __LC_RETURN_MCCK_PSW+1,0xfd # clear wait state bit |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 677 | tm __LC_RETURN_MCCK_PSW+1,0x01 # returning to user ? |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 678 | jno 0f |
| 679 | lm %r0,%r15,__PT_R0(%r11) |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 680 | stpt __LC_EXIT_TIMER |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 681 | lpsw __LC_RETURN_MCCK_PSW |
| 682 | 0: lm %r0,%r15,__PT_R0(%r11) |
| 683 | lpsw __LC_RETURN_MCCK_PSW |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 684 | |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 685 | mcck_panic: |
| 686 | l %r14,__LC_PANIC_STACK |
| 687 | slr %r14,%r15 |
| 688 | sra %r14,PAGE_SHIFT |
| 689 | jz 0f |
| 690 | l %r15,__LC_PANIC_STACK |
| 691 | 0: ahi %r15,-(STACK_FRAME_OVERHEAD + __PT_SIZE) |
| 692 | j mcck_skip |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 693 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 694 | /* |
| 695 | * Restart interruption handler, kick starter for additional CPUs |
| 696 | */ |
Heiko Carstens | 84b36a8 | 2007-06-19 13:10:03 +0200 | [diff] [blame] | 697 | #ifdef CONFIG_SMP |
Heiko Carstens | 2bc89b5 | 2008-02-05 16:50:40 +0100 | [diff] [blame] | 698 | __CPUINIT |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 699 | ENTRY(restart_int_handler) |
Martin Schwidefsky | 5b409ed | 2009-04-14 15:36:27 +0200 | [diff] [blame] | 700 | basr %r1,0 |
| 701 | restart_base: |
| 702 | spt restart_vtime-restart_base(%r1) |
| 703 | stck __LC_LAST_UPDATE_CLOCK |
| 704 | mvc __LC_LAST_UPDATE_TIMER(8),restart_vtime-restart_base(%r1) |
| 705 | mvc __LC_EXIT_TIMER(8),restart_vtime-restart_base(%r1) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 706 | l %r15,__LC_GPREGS_SAVE_AREA+60 # load ksp |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 707 | lctl %c0,%c15,__LC_CREGS_SAVE_AREA # get new ctl regs |
| 708 | lam %a0,%a15,__LC_AREGS_SAVE_AREA |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 709 | lm %r6,%r15,__SF_GPRS(%r15)# load registers from clone |
Martin Schwidefsky | 5b409ed | 2009-04-14 15:36:27 +0200 | [diff] [blame] | 710 | l %r1,__LC_THREAD_INFO |
| 711 | mvc __LC_USER_TIMER(8),__TI_user_timer(%r1) |
| 712 | mvc __LC_SYSTEM_TIMER(8),__TI_system_timer(%r1) |
| 713 | xc __LC_STEAL_TIMER(8),__LC_STEAL_TIMER |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 714 | ssm __LC_PGM_NEW_PSW # turn dat on, keep irqs off |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 715 | basr %r14,0 |
| 716 | l %r14,restart_addr-.(%r14) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 717 | basr %r14,%r14 # call start_secondary |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 718 | restart_addr: |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 719 | .long start_secondary |
Martin Schwidefsky | 5b409ed | 2009-04-14 15:36:27 +0200 | [diff] [blame] | 720 | .align 8 |
| 721 | restart_vtime: |
| 722 | .long 0x7fffffff,0xffffffff |
Heiko Carstens | 84b36a8 | 2007-06-19 13:10:03 +0200 | [diff] [blame] | 723 | .previous |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 724 | #else |
| 725 | /* |
| 726 | * If we do not run with SMP enabled, let the new CPU crash ... |
| 727 | */ |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 728 | ENTRY(restart_int_handler) |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 729 | basr %r1,0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 730 | restart_base: |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 731 | lpsw restart_crash-restart_base(%r1) |
| 732 | .align 8 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 733 | restart_crash: |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 734 | .long 0x000a0000,0x00000000 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 735 | restart_go: |
| 736 | #endif |
| 737 | |
Michael Holzheu | 7dd6b33 | 2011-08-03 16:44:19 +0200 | [diff] [blame] | 738 | # |
| 739 | # PSW restart interrupt handler |
| 740 | # |
| 741 | ENTRY(psw_restart_int_handler) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 742 | st %r15,__LC_SAVE_AREA_RESTART |
Michael Holzheu | 7dd6b33 | 2011-08-03 16:44:19 +0200 | [diff] [blame] | 743 | basr %r15,0 |
| 744 | 0: l %r15,.Lrestart_stack-0b(%r15) # load restart stack |
| 745 | l %r15,0(%r15) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 746 | ahi %r15,-__PT_SIZE # create pt_regs on stack |
| 747 | stm %r0,%r14,__PT_R0(%r15) |
| 748 | mvc __PT_R15(4,%r15),__LC_SAVE_AREA_RESTART |
| 749 | mvc __PT_PSW(8,%r15),__LC_RST_OLD_PSW # store restart old psw |
| 750 | ahi %r15,-STACK_FRAME_OVERHEAD |
| 751 | xc __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15) |
Michael Holzheu | 7dd6b33 | 2011-08-03 16:44:19 +0200 | [diff] [blame] | 752 | basr %r14,0 |
| 753 | 1: l %r14,.Ldo_restart-1b(%r14) |
| 754 | basr %r14,%r14 |
Michael Holzheu | 7dd6b33 | 2011-08-03 16:44:19 +0200 | [diff] [blame] | 755 | basr %r14,0 # load disabled wait PSW if |
| 756 | 2: lpsw restart_psw_crash-2b(%r14) # do_restart returns |
| 757 | .align 4 |
| 758 | .Ldo_restart: |
| 759 | .long do_restart |
| 760 | .Lrestart_stack: |
| 761 | .long restart_stack |
| 762 | .align 8 |
| 763 | restart_psw_crash: |
| 764 | .long 0x000a0000,0x00000000 + restart_psw_crash |
| 765 | |
Martin Schwidefsky | 860dba4 | 2011-01-05 12:47:25 +0100 | [diff] [blame] | 766 | .section .kprobes.text, "ax" |
| 767 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 768 | #ifdef CONFIG_CHECK_STACK |
| 769 | /* |
| 770 | * The synchronous or the asynchronous stack overflowed. We are dead. |
| 771 | * No need to properly save the registers, we are going to panic anyway. |
| 772 | * Setup a pt_regs so that show_trace can provide a good call trace. |
| 773 | */ |
| 774 | stack_overflow: |
| 775 | l %r15,__LC_PANIC_STACK # change to panic stack |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 776 | ahi %r15,-__PT_SIZE # create pt_regs |
| 777 | stm %r0,%r7,__PT_R0(%r15) |
| 778 | stm %r8,%r9,__PT_PSW(%r15) |
| 779 | mvc __PT_R8(32,%r11),0(%r14) |
| 780 | lr %r15,%r11 |
| 781 | ahi %r15,-STACK_FRAME_OVERHEAD |
| 782 | l %r1,BASED(1f) |
| 783 | xc __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15) |
| 784 | lr %r2,%r11 # pass pointer to pt_regs |
| 785 | br %r1 # branch to kernel_stack_overflow |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 786 | 1: .long kernel_stack_overflow |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 787 | #endif |
| 788 | |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 789 | cleanup_table: |
| 790 | .long system_call + 0x80000000 |
| 791 | .long sysc_do_svc + 0x80000000 |
| 792 | .long sysc_tif + 0x80000000 |
| 793 | .long sysc_restore + 0x80000000 |
| 794 | .long sysc_done + 0x80000000 |
| 795 | .long io_tif + 0x80000000 |
| 796 | .long io_restore + 0x80000000 |
| 797 | .long io_done + 0x80000000 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 798 | |
| 799 | cleanup_critical: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 800 | cl %r9,BASED(cleanup_table) # system_call |
| 801 | jl 0f |
| 802 | cl %r9,BASED(cleanup_table+4) # sysc_do_svc |
| 803 | jl cleanup_system_call |
| 804 | cl %r9,BASED(cleanup_table+8) # sysc_tif |
| 805 | jl 0f |
| 806 | cl %r9,BASED(cleanup_table+12) # sysc_restore |
| 807 | jl cleanup_sysc_tif |
| 808 | cl %r9,BASED(cleanup_table+16) # sysc_done |
| 809 | jl cleanup_sysc_restore |
| 810 | cl %r9,BASED(cleanup_table+20) # io_tif |
| 811 | jl 0f |
| 812 | cl %r9,BASED(cleanup_table+24) # io_restore |
| 813 | jl cleanup_io_tif |
| 814 | cl %r9,BASED(cleanup_table+28) # io_done |
| 815 | jl cleanup_io_restore |
| 816 | 0: br %r14 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 817 | |
| 818 | cleanup_system_call: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 819 | # check if stpt has been executed |
| 820 | cl %r9,BASED(cleanup_system_call_insn) |
| 821 | jh 0f |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 822 | mvc __LC_SYNC_ENTER_TIMER(8),__LC_ASYNC_ENTER_TIMER |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 823 | chi %r11,__LC_SAVE_AREA_ASYNC |
| 824 | je 0f |
| 825 | mvc __LC_SYNC_ENTER_TIMER(8),__LC_MCCK_ENTER_TIMER |
| 826 | 0: # check if stm has been executed |
| 827 | cl %r9,BASED(cleanup_system_call_insn+4) |
| 828 | jh 0f |
| 829 | mvc __LC_SAVE_AREA_SYNC(32),0(%r11) |
| 830 | 0: # set up saved registers r12, and r13 |
| 831 | st %r12,16(%r11) # r12 thread-info pointer |
| 832 | st %r13,20(%r11) # r13 literal-pool pointer |
| 833 | # check if the user time calculation has been done |
| 834 | cl %r9,BASED(cleanup_system_call_insn+8) |
| 835 | jh 0f |
| 836 | l %r10,__LC_EXIT_TIMER |
| 837 | l %r15,__LC_EXIT_TIMER+4 |
| 838 | SUB64 %r10,%r15,__LC_SYNC_ENTER_TIMER |
| 839 | ADD64 %r10,%r15,__LC_USER_TIMER |
| 840 | st %r10,__LC_USER_TIMER |
| 841 | st %r15,__LC_USER_TIMER+4 |
| 842 | 0: # check if the system time calculation has been done |
| 843 | cl %r9,BASED(cleanup_system_call_insn+12) |
| 844 | jh 0f |
| 845 | l %r10,__LC_LAST_UPDATE_TIMER |
| 846 | l %r15,__LC_LAST_UPDATE_TIMER+4 |
| 847 | SUB64 %r10,%r15,__LC_EXIT_TIMER |
| 848 | ADD64 %r10,%r15,__LC_SYSTEM_TIMER |
| 849 | st %r10,__LC_SYSTEM_TIMER |
| 850 | st %r15,__LC_SYSTEM_TIMER+4 |
| 851 | 0: # update accounting time stamp |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 852 | mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 853 | # set up saved register 11 |
| 854 | l %r15,__LC_KERNEL_STACK |
| 855 | ahi %r15,-__PT_SIZE |
| 856 | st %r15,12(%r11) # r11 pt_regs pointer |
| 857 | # fill pt_regs |
| 858 | mvc __PT_R8(32,%r15),__LC_SAVE_AREA_SYNC |
| 859 | stm %r0,%r7,__PT_R0(%r15) |
| 860 | mvc __PT_PSW(8,%r15),__LC_SVC_OLD_PSW |
Martin Schwidefsky | aa33c8c | 2011-12-27 11:27:18 +0100 | [diff] [blame] | 861 | mvc __PT_INT_CODE(4,%r15),__LC_SVC_ILC |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 862 | # setup saved register 15 |
| 863 | ahi %r15,-STACK_FRAME_OVERHEAD |
| 864 | st %r15,28(%r11) # r15 stack pointer |
| 865 | # set new psw address and exit |
| 866 | l %r9,BASED(cleanup_table+4) # sysc_do_svc + 0x80000000 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 867 | br %r14 |
| 868 | cleanup_system_call_insn: |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 869 | .long system_call + 0x80000000 |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 870 | .long sysc_stm + 0x80000000 |
| 871 | .long sysc_vtime + 0x80000000 + 36 |
| 872 | .long sysc_vtime + 0x80000000 + 76 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 873 | |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 874 | cleanup_sysc_tif: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 875 | l %r9,BASED(cleanup_table+8) # sysc_tif + 0x80000000 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 876 | br %r14 |
| 877 | |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 878 | cleanup_sysc_restore: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 879 | cl %r9,BASED(cleanup_sysc_restore_insn) |
| 880 | jhe 0f |
| 881 | l %r9,12(%r11) # get saved pointer to pt_regs |
| 882 | mvc __LC_RETURN_PSW(8),__PT_PSW(%r9) |
| 883 | mvc 0(32,%r11),__PT_R8(%r9) |
| 884 | lm %r0,%r7,__PT_R0(%r9) |
| 885 | 0: lm %r8,%r9,__LC_RETURN_PSW |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 886 | br %r14 |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 887 | cleanup_sysc_restore_insn: |
Heiko Carstens | 411788e | 2007-11-20 11:13:32 +0100 | [diff] [blame] | 888 | .long sysc_done - 4 + 0x80000000 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 889 | |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 890 | cleanup_io_tif: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 891 | l %r9,BASED(cleanup_table+20) # io_tif + 0x80000000 |
Martin Schwidefsky | 176b180 | 2010-04-09 13:43:00 +0200 | [diff] [blame] | 892 | br %r14 |
| 893 | |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 894 | cleanup_io_restore: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 895 | cl %r9,BASED(cleanup_io_restore_insn) |
| 896 | jhe 0f |
| 897 | l %r9,12(%r11) # get saved r11 pointer to pt_regs |
| 898 | mvc __LC_RETURN_PSW(8),__PT_PSW(%r9) |
| 899 | ni __LC_RETURN_PSW+1,0xfd # clear wait state bit |
| 900 | mvc 0(32,%r11),__PT_R8(%r9) |
| 901 | lm %r0,%r7,__PT_R0(%r9) |
| 902 | 0: lm %r8,%r9,__LC_RETURN_PSW |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 903 | br %r14 |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 904 | cleanup_io_restore_insn: |
Heiko Carstens | 411788e | 2007-11-20 11:13:32 +0100 | [diff] [blame] | 905 | .long io_done - 4 + 0x80000000 |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 906 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 907 | /* |
| 908 | * Integer constants |
| 909 | */ |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 910 | .align 4 |
| 911 | .Lnr_syscalls: .long NR_syscalls |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 912 | |
| 913 | /* |
| 914 | * Symbol constants |
| 915 | */ |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 916 | .Ldo_machine_check: .long s390_do_machine_check |
| 917 | .Lhandle_mcck: .long s390_handle_mcck |
| 918 | .Ldo_IRQ: .long do_IRQ |
| 919 | .Ldo_extint: .long do_extint |
| 920 | .Ldo_signal: .long do_signal |
| 921 | .Ldo_notify_resume: .long do_notify_resume |
| 922 | .Ldo_per_trap: .long do_per_trap |
| 923 | .Ldo_execve: .long do_execve |
| 924 | .Lexecve_tail: .long execve_tail |
| 925 | .Ljump_table: .long pgm_check_table |
| 926 | .Lschedule: .long schedule |
Christian Borntraeger | ab1809b | 2007-12-04 16:09:04 +0100 | [diff] [blame] | 927 | #ifdef CONFIG_PREEMPT |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 928 | .Lpreempt_irq: .long preempt_schedule_irq |
Christian Borntraeger | ab1809b | 2007-12-04 16:09:04 +0100 | [diff] [blame] | 929 | #endif |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 930 | .Ltrace_enter: .long do_syscall_trace_enter |
| 931 | .Ltrace_exit: .long do_syscall_trace_exit |
| 932 | .Lschedule_tail: .long schedule_tail |
| 933 | .Lsys_call_table: .long sys_call_table |
| 934 | .Lsysc_per: .long sysc_per + 0x80000000 |
Heiko Carstens | 1f194a4 | 2006-07-03 00:24:46 -0700 | [diff] [blame] | 935 | #ifdef CONFIG_TRACE_IRQFLAGS |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 936 | .Lhardirqs_on: .long trace_hardirqs_on_caller |
| 937 | .Lhardirqs_off: .long trace_hardirqs_off_caller |
Heiko Carstens | af4c6874 | 2008-11-14 18:18:03 +0100 | [diff] [blame] | 938 | #endif |
| 939 | #ifdef CONFIG_LOCKDEP |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 940 | .Llockdep_sys_exit: .long lockdep_sys_exit |
Heiko Carstens | 1f194a4 | 2006-07-03 00:24:46 -0700 | [diff] [blame] | 941 | #endif |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 942 | .Lcritical_start: .long __critical_start + 0x80000000 |
| 943 | .Lcritical_length: .long __critical_end - __critical_start |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 944 | |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 945 | .section .rodata, "a" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 946 | #define SYSCALL(esa,esame,emu) .long esa |
Heiko Carstens | 9bf1226 | 2009-06-12 10:26:47 +0200 | [diff] [blame] | 947 | .globl sys_call_table |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 948 | sys_call_table: |
| 949 | #include "syscalls.S" |
| 950 | #undef SYSCALL |