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), |
| 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 | |
| 12 | #include <linux/sys.h> |
| 13 | #include <linux/linkage.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | #include <asm/cache.h> |
| 15 | #include <asm/lowcore.h> |
| 16 | #include <asm/errno.h> |
| 17 | #include <asm/ptrace.h> |
| 18 | #include <asm/thread_info.h> |
Sam Ravnborg | 0013a85 | 2005-09-09 20:57:26 +0200 | [diff] [blame] | 19 | #include <asm/asm-offsets.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | #include <asm/unistd.h> |
| 21 | #include <asm/page.h> |
| 22 | |
| 23 | /* |
| 24 | * Stack layout for the system_call stack entry. |
| 25 | * The first few entries are identical to the user_regs_struct. |
| 26 | */ |
| 27 | SP_PTREGS = STACK_FRAME_OVERHEAD |
| 28 | SP_ARGS = STACK_FRAME_OVERHEAD + __PT_ARGS |
| 29 | SP_PSW = STACK_FRAME_OVERHEAD + __PT_PSW |
| 30 | SP_R0 = STACK_FRAME_OVERHEAD + __PT_GPRS |
| 31 | SP_R1 = STACK_FRAME_OVERHEAD + __PT_GPRS + 4 |
| 32 | SP_R2 = STACK_FRAME_OVERHEAD + __PT_GPRS + 8 |
| 33 | SP_R3 = STACK_FRAME_OVERHEAD + __PT_GPRS + 12 |
| 34 | SP_R4 = STACK_FRAME_OVERHEAD + __PT_GPRS + 16 |
| 35 | SP_R5 = STACK_FRAME_OVERHEAD + __PT_GPRS + 20 |
| 36 | SP_R6 = STACK_FRAME_OVERHEAD + __PT_GPRS + 24 |
| 37 | SP_R7 = STACK_FRAME_OVERHEAD + __PT_GPRS + 28 |
| 38 | SP_R8 = STACK_FRAME_OVERHEAD + __PT_GPRS + 32 |
| 39 | SP_R9 = STACK_FRAME_OVERHEAD + __PT_GPRS + 36 |
| 40 | SP_R10 = STACK_FRAME_OVERHEAD + __PT_GPRS + 40 |
| 41 | SP_R11 = STACK_FRAME_OVERHEAD + __PT_GPRS + 44 |
| 42 | SP_R12 = STACK_FRAME_OVERHEAD + __PT_GPRS + 48 |
| 43 | SP_R13 = STACK_FRAME_OVERHEAD + __PT_GPRS + 52 |
| 44 | SP_R14 = STACK_FRAME_OVERHEAD + __PT_GPRS + 56 |
| 45 | SP_R15 = STACK_FRAME_OVERHEAD + __PT_GPRS + 60 |
| 46 | SP_ORIG_R2 = STACK_FRAME_OVERHEAD + __PT_ORIG_GPR2 |
| 47 | SP_ILC = STACK_FRAME_OVERHEAD + __PT_ILC |
| 48 | SP_TRAP = STACK_FRAME_OVERHEAD + __PT_TRAP |
| 49 | SP_SIZE = STACK_FRAME_OVERHEAD + __PT_SIZE |
| 50 | |
Heiko Carstens | 54dfe5d | 2006-02-01 03:06:38 -0800 | [diff] [blame] | 51 | _TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | _TIF_NEED_RESCHED | \ |
| 52 | _TIF_MCCK_PENDING | _TIF_RESTART_SVC | _TIF_SINGLE_STEP ) |
| 53 | _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | _TIF_NEED_RESCHED | \ |
| 54 | _TIF_MCCK_PENDING) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | |
| 56 | STACK_SHIFT = PAGE_SHIFT + THREAD_ORDER |
| 57 | STACK_SIZE = 1 << STACK_SHIFT |
| 58 | |
| 59 | #define BASED(name) name-system_call(%r13) |
| 60 | |
| 61 | /* |
| 62 | * Register usage in interrupt handlers: |
| 63 | * R9 - pointer to current task structure |
| 64 | * R13 - pointer to literal pool |
| 65 | * R14 - return register for function calls |
| 66 | * R15 - kernel stack pointer |
| 67 | */ |
| 68 | |
| 69 | .macro STORE_TIMER lc_offset |
| 70 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING |
| 71 | stpt \lc_offset |
| 72 | #endif |
| 73 | .endm |
| 74 | |
| 75 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING |
| 76 | .macro UPDATE_VTIME lc_from,lc_to,lc_sum |
| 77 | lm %r10,%r11,\lc_from |
| 78 | sl %r10,\lc_to |
| 79 | sl %r11,\lc_to+4 |
| 80 | bc 3,BASED(0f) |
| 81 | sl %r10,BASED(.Lc_1) |
| 82 | 0: al %r10,\lc_sum |
| 83 | al %r11,\lc_sum+4 |
| 84 | bc 12,BASED(1f) |
| 85 | al %r10,BASED(.Lc_1) |
| 86 | 1: stm %r10,%r11,\lc_sum |
| 87 | .endm |
| 88 | #endif |
| 89 | |
| 90 | .macro SAVE_ALL_BASE savearea |
| 91 | stm %r12,%r15,\savearea |
| 92 | l %r13,__LC_SVC_NEW_PSW+4 # load &system_call to %r13 |
| 93 | .endm |
| 94 | |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 95 | .macro SAVE_ALL_SYNC psworg,savearea |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 96 | la %r12,\psworg |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 97 | tm \psworg+1,0x01 # test problem state bit |
| 98 | bz BASED(2f) # skip stack setup save |
| 99 | l %r15,__LC_KERNEL_STACK # problem state -> load ksp |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 100 | #ifdef CONFIG_CHECK_STACK |
| 101 | b BASED(3f) |
| 102 | 2: tml %r15,STACK_SIZE - CONFIG_STACK_GUARD |
| 103 | bz BASED(stack_overflow) |
| 104 | 3: |
| 105 | #endif |
| 106 | 2: |
| 107 | .endm |
| 108 | |
| 109 | .macro SAVE_ALL_ASYNC psworg,savearea |
| 110 | la %r12,\psworg |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 111 | tm \psworg+1,0x01 # test problem state bit |
| 112 | bnz BASED(1f) # from user -> load async stack |
| 113 | clc \psworg+4(4),BASED(.Lcritical_end) |
| 114 | bhe BASED(0f) |
| 115 | clc \psworg+4(4),BASED(.Lcritical_start) |
| 116 | bl BASED(0f) |
| 117 | l %r14,BASED(.Lcleanup_critical) |
| 118 | basr %r14,%r14 |
Peter Oberparleiter | 6add9f7 | 2005-09-16 19:27:42 -0700 | [diff] [blame] | 119 | tm 1(%r12),0x01 # retest problem state after cleanup |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 120 | bnz BASED(1f) |
| 121 | 0: l %r14,__LC_ASYNC_STACK # are we already on the async stack ? |
| 122 | slr %r14,%r15 |
| 123 | sra %r14,STACK_SHIFT |
| 124 | be BASED(2f) |
| 125 | 1: l %r15,__LC_ASYNC_STACK |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 126 | #ifdef CONFIG_CHECK_STACK |
| 127 | b BASED(3f) |
| 128 | 2: tml %r15,STACK_SIZE - CONFIG_STACK_GUARD |
| 129 | bz BASED(stack_overflow) |
| 130 | 3: |
| 131 | #endif |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 132 | 2: |
| 133 | .endm |
| 134 | |
| 135 | .macro CREATE_STACK_FRAME psworg,savearea |
| 136 | s %r15,BASED(.Lc_spsize) # make room for registers & psw |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 137 | mvc SP_PSW(8,%r15),0(%r12) # move user PSW to stack |
| 138 | la %r12,\psworg |
| 139 | st %r2,SP_ORIG_R2(%r15) # store original content of gpr 2 |
| 140 | icm %r12,12,__LC_SVC_ILC |
| 141 | stm %r0,%r11,SP_R0(%r15) # store gprs %r0-%r11 to kernel stack |
| 142 | st %r12,SP_ILC(%r15) |
| 143 | mvc SP_R12(16,%r15),\savearea # move %r12-%r15 to stack |
| 144 | la %r12,0 |
| 145 | st %r12,__SF_BACKCHAIN(%r15) # clear back chain |
| 146 | .endm |
| 147 | |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 148 | .macro RESTORE_ALL psworg,sync |
| 149 | mvc \psworg(8),SP_PSW(%r15) # move user PSW to lowcore |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 150 | .if !\sync |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 151 | ni \psworg+1,0xfd # clear wait state bit |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 152 | .endif |
| 153 | lm %r0,%r15,SP_R0(%r15) # load gprs 0-15 of user |
| 154 | STORE_TIMER __LC_EXIT_TIMER |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 155 | lpsw \psworg # back to caller |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 156 | .endm |
| 157 | |
| 158 | /* |
| 159 | * Scheduler resume function, called by switch_to |
| 160 | * gpr2 = (task_struct *) prev |
| 161 | * gpr3 = (task_struct *) next |
| 162 | * Returns: |
| 163 | * gpr2 = prev |
| 164 | */ |
| 165 | .globl __switch_to |
| 166 | __switch_to: |
| 167 | basr %r1,0 |
| 168 | __switch_to_base: |
| 169 | tm __THREAD_per(%r3),0xe8 # new process is using per ? |
| 170 | bz __switch_to_noper-__switch_to_base(%r1) # if not we're fine |
| 171 | stctl %c9,%c11,__SF_EMPTY(%r15) # We are using per stuff |
| 172 | clc __THREAD_per(12,%r3),__SF_EMPTY(%r15) |
| 173 | be __switch_to_noper-__switch_to_base(%r1) # we got away w/o bashing TLB's |
| 174 | lctl %c9,%c11,__THREAD_per(%r3) # Nope we didn't |
| 175 | __switch_to_noper: |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 176 | l %r4,__THREAD_info(%r2) # get thread_info of prev |
| 177 | tm __TI_flags+3(%r4),_TIF_MCCK_PENDING # machine check pending? |
| 178 | bz __switch_to_no_mcck-__switch_to_base(%r1) |
| 179 | ni __TI_flags+3(%r4),255-_TIF_MCCK_PENDING # clear flag in prev |
| 180 | l %r4,__THREAD_info(%r3) # get thread_info of next |
| 181 | oi __TI_flags+3(%r4),_TIF_MCCK_PENDING # set it in next |
| 182 | __switch_to_no_mcck: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 183 | stm %r6,%r15,__SF_GPRS(%r15)# store __switch_to registers of prev task |
| 184 | st %r15,__THREAD_ksp(%r2) # store kernel stack to prev->tss.ksp |
| 185 | l %r15,__THREAD_ksp(%r3) # load kernel stack from next->tss.ksp |
| 186 | lm %r6,%r15,__SF_GPRS(%r15)# load __switch_to registers of next task |
| 187 | st %r3,__LC_CURRENT # __LC_CURRENT = current task struct |
| 188 | lctl %c4,%c4,__TASK_pid(%r3) # load pid to control reg. 4 |
| 189 | l %r3,__THREAD_info(%r3) # load thread_info from task struct |
| 190 | st %r3,__LC_THREAD_INFO |
| 191 | ahi %r3,STACK_SIZE |
| 192 | st %r3,__LC_KERNEL_STACK # __LC_KERNEL_STACK = new kernel stack |
| 193 | br %r14 |
| 194 | |
| 195 | __critical_start: |
| 196 | /* |
| 197 | * SVC interrupt handler routine. System calls are synchronous events and |
| 198 | * are executed with interrupts enabled. |
| 199 | */ |
| 200 | |
| 201 | .globl system_call |
| 202 | system_call: |
| 203 | STORE_TIMER __LC_SYNC_ENTER_TIMER |
| 204 | sysc_saveall: |
| 205 | SAVE_ALL_BASE __LC_SAVE_AREA |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 206 | SAVE_ALL_SYNC __LC_SVC_OLD_PSW,__LC_SAVE_AREA |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 207 | CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 208 | lh %r7,0x8a # get svc number from lowcore |
| 209 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING |
| 210 | sysc_vtime: |
| 211 | tm SP_PSW+1(%r15),0x01 # interrupting from user ? |
| 212 | bz BASED(sysc_do_svc) |
| 213 | UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER |
| 214 | sysc_stime: |
| 215 | UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER |
| 216 | sysc_update: |
| 217 | mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER |
| 218 | #endif |
| 219 | sysc_do_svc: |
| 220 | l %r9,__LC_THREAD_INFO # load pointer to thread_info struct |
| 221 | sla %r7,2 # *4 and test for svc 0 |
| 222 | bnz BASED(sysc_nr_ok) # svc number > 0 |
| 223 | # svc 0: system call number in %r1 |
| 224 | cl %r1,BASED(.Lnr_syscalls) |
| 225 | bnl BASED(sysc_nr_ok) |
| 226 | lr %r7,%r1 # copy svc number to %r7 |
| 227 | sla %r7,2 # *4 |
| 228 | sysc_nr_ok: |
| 229 | mvc SP_ARGS(4,%r15),SP_R7(%r15) |
| 230 | sysc_do_restart: |
Heiko Carstens | d882b17 | 2006-07-01 04:36:31 -0700 | [diff] [blame^] | 231 | l %r8,BASED(.Lsysc_table) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 232 | tm __TI_flags+3(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT) |
Heiko Carstens | d882b17 | 2006-07-01 04:36:31 -0700 | [diff] [blame^] | 233 | l %r8,0(%r7,%r8) # get system call addr. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 234 | bnz BASED(sysc_tracesys) |
| 235 | basr %r14,%r8 # call sys_xxxx |
| 236 | st %r2,SP_R2(%r15) # store return value (change R2 on stack) |
| 237 | # ATTENTION: check sys_execve_glue before |
| 238 | # changing anything here !! |
| 239 | |
| 240 | sysc_return: |
| 241 | tm SP_PSW+1(%r15),0x01 # returning to user ? |
| 242 | bno BASED(sysc_leave) |
| 243 | tm __TI_flags+3(%r9),_TIF_WORK_SVC |
| 244 | bnz BASED(sysc_work) # there is work to do (signals etc.) |
| 245 | sysc_leave: |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 246 | RESTORE_ALL __LC_RETURN_PSW,1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 247 | |
| 248 | # |
| 249 | # recheck if there is more work to do |
| 250 | # |
| 251 | sysc_work_loop: |
| 252 | tm __TI_flags+3(%r9),_TIF_WORK_SVC |
| 253 | bz BASED(sysc_leave) # there is no work to do |
| 254 | # |
| 255 | # One of the work bits is on. Find out which one. |
| 256 | # |
| 257 | sysc_work: |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 258 | tm __TI_flags+3(%r9),_TIF_MCCK_PENDING |
| 259 | bo BASED(sysc_mcck_pending) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 260 | tm __TI_flags+3(%r9),_TIF_NEED_RESCHED |
| 261 | bo BASED(sysc_reschedule) |
Heiko Carstens | 54dfe5d | 2006-02-01 03:06:38 -0800 | [diff] [blame] | 262 | tm __TI_flags+3(%r9),(_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK) |
| 263 | bnz BASED(sysc_sigpending) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 264 | tm __TI_flags+3(%r9),_TIF_RESTART_SVC |
| 265 | bo BASED(sysc_restart) |
| 266 | tm __TI_flags+3(%r9),_TIF_SINGLE_STEP |
| 267 | bo BASED(sysc_singlestep) |
| 268 | b BASED(sysc_leave) |
| 269 | |
| 270 | # |
| 271 | # _TIF_NEED_RESCHED is set, call schedule |
| 272 | # |
| 273 | sysc_reschedule: |
| 274 | l %r1,BASED(.Lschedule) |
| 275 | la %r14,BASED(sysc_work_loop) |
| 276 | br %r1 # call scheduler |
| 277 | |
| 278 | # |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 279 | # _TIF_MCCK_PENDING is set, call handler |
| 280 | # |
| 281 | sysc_mcck_pending: |
| 282 | l %r1,BASED(.Ls390_handle_mcck) |
| 283 | la %r14,BASED(sysc_work_loop) |
| 284 | br %r1 # TIF bit will be cleared by handler |
| 285 | |
| 286 | # |
Heiko Carstens | 54dfe5d | 2006-02-01 03:06:38 -0800 | [diff] [blame] | 287 | # _TIF_SIGPENDING or _TIF_RESTORE_SIGMASK is set, call do_signal |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 288 | # |
| 289 | sysc_sigpending: |
| 290 | ni __TI_flags+3(%r9),255-_TIF_SINGLE_STEP # clear TIF_SINGLE_STEP |
| 291 | la %r2,SP_PTREGS(%r15) # load pt_regs |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 292 | l %r1,BASED(.Ldo_signal) |
| 293 | basr %r14,%r1 # call do_signal |
| 294 | tm __TI_flags+3(%r9),_TIF_RESTART_SVC |
| 295 | bo BASED(sysc_restart) |
| 296 | tm __TI_flags+3(%r9),_TIF_SINGLE_STEP |
| 297 | bo BASED(sysc_singlestep) |
Heiko Carstens | e1c3ad9 | 2005-11-07 00:59:02 -0800 | [diff] [blame] | 298 | b BASED(sysc_work_loop) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 299 | |
| 300 | # |
| 301 | # _TIF_RESTART_SVC is set, set up registers and restart svc |
| 302 | # |
| 303 | sysc_restart: |
| 304 | ni __TI_flags+3(%r9),255-_TIF_RESTART_SVC # clear TIF_RESTART_SVC |
| 305 | l %r7,SP_R2(%r15) # load new svc number |
| 306 | sla %r7,2 |
| 307 | mvc SP_R2(4,%r15),SP_ORIG_R2(%r15) # restore first argument |
| 308 | lm %r2,%r6,SP_R2(%r15) # load svc arguments |
| 309 | b BASED(sysc_do_restart) # restart svc |
| 310 | |
| 311 | # |
| 312 | # _TIF_SINGLE_STEP is set, call do_single_step |
| 313 | # |
| 314 | sysc_singlestep: |
| 315 | ni __TI_flags+3(%r9),255-_TIF_SINGLE_STEP # clear TIF_SINGLE_STEP |
| 316 | mvi SP_TRAP+1(%r15),0x28 # set trap indication to pgm check |
| 317 | la %r2,SP_PTREGS(%r15) # address of register-save area |
| 318 | l %r1,BASED(.Lhandle_per) # load adr. of per handler |
| 319 | la %r14,BASED(sysc_return) # load adr. of system return |
| 320 | br %r1 # branch to do_single_step |
| 321 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 322 | # |
| 323 | # call trace before and after sys_call |
| 324 | # |
| 325 | sysc_tracesys: |
| 326 | l %r1,BASED(.Ltrace) |
| 327 | la %r2,SP_PTREGS(%r15) # load pt_regs |
| 328 | la %r3,0 |
| 329 | srl %r7,2 |
| 330 | st %r7,SP_R2(%r15) |
| 331 | basr %r14,%r1 |
| 332 | clc SP_R2(4,%r15),BASED(.Lnr_syscalls) |
| 333 | bnl BASED(sysc_tracenogo) |
Heiko Carstens | d882b17 | 2006-07-01 04:36:31 -0700 | [diff] [blame^] | 334 | l %r8,BASED(.Lsysc_table) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 335 | l %r7,SP_R2(%r15) # strace might have changed the |
| 336 | sll %r7,2 # system call |
Heiko Carstens | d882b17 | 2006-07-01 04:36:31 -0700 | [diff] [blame^] | 337 | l %r8,0(%r7,%r8) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 338 | sysc_tracego: |
| 339 | lm %r3,%r6,SP_R3(%r15) |
| 340 | l %r2,SP_ORIG_R2(%r15) |
| 341 | basr %r14,%r8 # call sys_xxx |
| 342 | st %r2,SP_R2(%r15) # store return value |
| 343 | sysc_tracenogo: |
| 344 | tm __TI_flags+3(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT) |
| 345 | bz BASED(sysc_return) |
| 346 | l %r1,BASED(.Ltrace) |
| 347 | la %r2,SP_PTREGS(%r15) # load pt_regs |
| 348 | la %r3,1 |
| 349 | la %r14,BASED(sysc_return) |
| 350 | br %r1 |
| 351 | |
| 352 | # |
| 353 | # a new process exits the kernel with ret_from_fork |
| 354 | # |
| 355 | .globl ret_from_fork |
| 356 | ret_from_fork: |
| 357 | l %r13,__LC_SVC_NEW_PSW+4 |
| 358 | l %r9,__LC_THREAD_INFO # load pointer to thread_info struct |
| 359 | tm SP_PSW+1(%r15),0x01 # forking a kernel thread ? |
| 360 | bo BASED(0f) |
| 361 | st %r15,SP_R15(%r15) # store stack pointer for new kthread |
| 362 | 0: l %r1,BASED(.Lschedtail) |
| 363 | basr %r14,%r1 |
| 364 | stosm __SF_EMPTY(%r15),0x03 # reenable interrupts |
| 365 | b BASED(sysc_return) |
| 366 | |
| 367 | # |
| 368 | # clone, fork, vfork, exec and sigreturn need glue, |
| 369 | # because they all expect pt_regs as parameter, |
| 370 | # but are called with different parameter. |
| 371 | # return-address is set up above |
| 372 | # |
| 373 | sys_clone_glue: |
| 374 | la %r2,SP_PTREGS(%r15) # load pt_regs |
| 375 | l %r1,BASED(.Lclone) |
| 376 | br %r1 # branch to sys_clone |
| 377 | |
| 378 | sys_fork_glue: |
| 379 | la %r2,SP_PTREGS(%r15) # load pt_regs |
| 380 | l %r1,BASED(.Lfork) |
| 381 | br %r1 # branch to sys_fork |
| 382 | |
| 383 | sys_vfork_glue: |
| 384 | la %r2,SP_PTREGS(%r15) # load pt_regs |
| 385 | l %r1,BASED(.Lvfork) |
| 386 | br %r1 # branch to sys_vfork |
| 387 | |
| 388 | sys_execve_glue: |
| 389 | la %r2,SP_PTREGS(%r15) # load pt_regs |
| 390 | l %r1,BASED(.Lexecve) |
| 391 | lr %r12,%r14 # save return address |
| 392 | basr %r14,%r1 # call sys_execve |
| 393 | ltr %r2,%r2 # check if execve failed |
| 394 | bnz 0(%r12) # it did fail -> store result in gpr2 |
| 395 | b 4(%r12) # SKIP ST 2,SP_R2(15) after BASR 14,8 |
| 396 | # in system_call/sysc_tracesys |
| 397 | |
| 398 | sys_sigreturn_glue: |
| 399 | la %r2,SP_PTREGS(%r15) # load pt_regs as parameter |
| 400 | l %r1,BASED(.Lsigreturn) |
| 401 | br %r1 # branch to sys_sigreturn |
| 402 | |
| 403 | sys_rt_sigreturn_glue: |
| 404 | la %r2,SP_PTREGS(%r15) # load pt_regs as parameter |
| 405 | l %r1,BASED(.Lrt_sigreturn) |
| 406 | br %r1 # branch to sys_sigreturn |
| 407 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 408 | sys_sigaltstack_glue: |
| 409 | la %r4,SP_PTREGS(%r15) # load pt_regs as parameter |
| 410 | l %r1,BASED(.Lsigaltstack) |
| 411 | br %r1 # branch to sys_sigreturn |
| 412 | |
| 413 | |
| 414 | /* |
| 415 | * Program check handler routine |
| 416 | */ |
| 417 | |
| 418 | .globl pgm_check_handler |
| 419 | pgm_check_handler: |
| 420 | /* |
| 421 | * First we need to check for a special case: |
| 422 | * Single stepping an instruction that disables the PER event mask will |
| 423 | * cause a PER event AFTER the mask has been set. Example: SVC or LPSW. |
| 424 | * For a single stepped SVC the program check handler gets control after |
| 425 | * the SVC new PSW has been loaded. But we want to execute the SVC first and |
| 426 | * then handle the PER event. Therefore we update the SVC old PSW to point |
| 427 | * to the pgm_check_handler and branch to the SVC handler after we checked |
| 428 | * if we have to load the kernel stack register. |
| 429 | * For every other possible cause for PER event without the PER mask set |
| 430 | * we just ignore the PER event (FIXME: is there anything we have to do |
| 431 | * for LPSW?). |
| 432 | */ |
| 433 | STORE_TIMER __LC_SYNC_ENTER_TIMER |
| 434 | SAVE_ALL_BASE __LC_SAVE_AREA |
| 435 | tm __LC_PGM_INT_CODE+1,0x80 # check whether we got a per exception |
| 436 | bnz BASED(pgm_per) # got per exception -> special case |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 437 | SAVE_ALL_SYNC __LC_PGM_OLD_PSW,__LC_SAVE_AREA |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 438 | CREATE_STACK_FRAME __LC_PGM_OLD_PSW,__LC_SAVE_AREA |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 439 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING |
| 440 | tm SP_PSW+1(%r15),0x01 # interrupting from user ? |
| 441 | bz BASED(pgm_no_vtime) |
| 442 | UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER |
| 443 | UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER |
| 444 | mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER |
| 445 | pgm_no_vtime: |
| 446 | #endif |
| 447 | l %r9,__LC_THREAD_INFO # load pointer to thread_info struct |
| 448 | l %r3,__LC_PGM_ILC # load program interruption code |
| 449 | la %r8,0x7f |
| 450 | nr %r8,%r3 |
| 451 | pgm_do_call: |
| 452 | l %r7,BASED(.Ljump_table) |
| 453 | sll %r8,2 |
| 454 | l %r7,0(%r8,%r7) # load address of handler routine |
| 455 | la %r2,SP_PTREGS(%r15) # address of register-save area |
| 456 | la %r14,BASED(sysc_return) |
| 457 | br %r7 # branch to interrupt-handler |
| 458 | |
| 459 | # |
| 460 | # handle per exception |
| 461 | # |
| 462 | pgm_per: |
| 463 | tm __LC_PGM_OLD_PSW,0x40 # test if per event recording is on |
| 464 | bnz BASED(pgm_per_std) # ok, normal per event from user space |
| 465 | # ok its one of the special cases, now we need to find out which one |
| 466 | clc __LC_PGM_OLD_PSW(8),__LC_SVC_NEW_PSW |
| 467 | be BASED(pgm_svcper) |
| 468 | # no interesting special case, ignore PER event |
| 469 | lm %r12,%r15,__LC_SAVE_AREA |
| 470 | lpsw 0x28 |
| 471 | |
| 472 | # |
| 473 | # Normal per exception |
| 474 | # |
| 475 | pgm_per_std: |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 476 | SAVE_ALL_SYNC __LC_PGM_OLD_PSW,__LC_SAVE_AREA |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 477 | CREATE_STACK_FRAME __LC_PGM_OLD_PSW,__LC_SAVE_AREA |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 478 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING |
| 479 | tm SP_PSW+1(%r15),0x01 # interrupting from user ? |
| 480 | bz BASED(pgm_no_vtime2) |
| 481 | UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER |
| 482 | UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER |
| 483 | mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER |
| 484 | pgm_no_vtime2: |
| 485 | #endif |
| 486 | l %r9,__LC_THREAD_INFO # load pointer to thread_info struct |
| 487 | l %r1,__TI_task(%r9) |
| 488 | mvc __THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID |
| 489 | mvc __THREAD_per+__PER_address(4,%r1),__LC_PER_ADDRESS |
| 490 | mvc __THREAD_per+__PER_access_id(1,%r1),__LC_PER_ACCESS_ID |
| 491 | oi __TI_flags+3(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP |
| 492 | l %r3,__LC_PGM_ILC # load program interruption code |
| 493 | la %r8,0x7f |
| 494 | nr %r8,%r3 # clear per-event-bit and ilc |
| 495 | be BASED(sysc_return) # only per or per+check ? |
| 496 | b BASED(pgm_do_call) |
| 497 | |
| 498 | # |
| 499 | # it was a single stepped SVC that is causing all the trouble |
| 500 | # |
| 501 | pgm_svcper: |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 502 | SAVE_ALL_SYNC __LC_SVC_OLD_PSW,__LC_SAVE_AREA |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 503 | CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 504 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING |
| 505 | tm SP_PSW+1(%r15),0x01 # interrupting from user ? |
| 506 | bz BASED(pgm_no_vtime3) |
| 507 | UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER |
| 508 | UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER |
| 509 | mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER |
| 510 | pgm_no_vtime3: |
| 511 | #endif |
| 512 | lh %r7,0x8a # get svc number from lowcore |
| 513 | l %r9,__LC_THREAD_INFO # load pointer to thread_info struct |
| 514 | l %r1,__TI_task(%r9) |
| 515 | mvc __THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID |
| 516 | mvc __THREAD_per+__PER_address(4,%r1),__LC_PER_ADDRESS |
| 517 | mvc __THREAD_per+__PER_access_id(1,%r1),__LC_PER_ACCESS_ID |
| 518 | oi __TI_flags+3(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP |
| 519 | stosm __SF_EMPTY(%r15),0x03 # reenable interrupts |
| 520 | b BASED(sysc_do_svc) |
| 521 | |
| 522 | /* |
| 523 | * IO interrupt handler routine |
| 524 | */ |
| 525 | |
| 526 | .globl io_int_handler |
| 527 | io_int_handler: |
| 528 | STORE_TIMER __LC_ASYNC_ENTER_TIMER |
| 529 | stck __LC_INT_CLOCK |
| 530 | SAVE_ALL_BASE __LC_SAVE_AREA+16 |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 531 | SAVE_ALL_ASYNC __LC_IO_OLD_PSW,__LC_SAVE_AREA+16 |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 532 | CREATE_STACK_FRAME __LC_IO_OLD_PSW,__LC_SAVE_AREA+16 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 533 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING |
| 534 | tm SP_PSW+1(%r15),0x01 # interrupting from user ? |
| 535 | bz BASED(io_no_vtime) |
| 536 | UPDATE_VTIME __LC_EXIT_TIMER,__LC_ASYNC_ENTER_TIMER,__LC_USER_TIMER |
| 537 | UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER |
| 538 | mvc __LC_LAST_UPDATE_TIMER(8),__LC_ASYNC_ENTER_TIMER |
| 539 | io_no_vtime: |
| 540 | #endif |
| 541 | l %r9,__LC_THREAD_INFO # load pointer to thread_info struct |
| 542 | l %r1,BASED(.Ldo_IRQ) # load address of do_IRQ |
| 543 | la %r2,SP_PTREGS(%r15) # address of register-save area |
| 544 | basr %r14,%r1 # branch to standard irq handler |
| 545 | |
| 546 | io_return: |
| 547 | tm SP_PSW+1(%r15),0x01 # returning to user ? |
| 548 | #ifdef CONFIG_PREEMPT |
| 549 | bno BASED(io_preempt) # no -> check for preemptive scheduling |
| 550 | #else |
| 551 | bno BASED(io_leave) # no-> skip resched & signal |
| 552 | #endif |
| 553 | tm __TI_flags+3(%r9),_TIF_WORK_INT |
| 554 | bnz BASED(io_work) # there is work to do (signals etc.) |
| 555 | io_leave: |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 556 | RESTORE_ALL __LC_RETURN_PSW,0 |
| 557 | io_done: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 558 | |
| 559 | #ifdef CONFIG_PREEMPT |
| 560 | io_preempt: |
| 561 | icm %r0,15,__TI_precount(%r9) |
| 562 | bnz BASED(io_leave) |
| 563 | l %r1,SP_R15(%r15) |
| 564 | s %r1,BASED(.Lc_spsize) |
| 565 | mvc SP_PTREGS(__PT_SIZE,%r1),SP_PTREGS(%r15) |
| 566 | xc __SF_BACKCHAIN(4,%r1),__SF_BACKCHAIN(%r1) # clear back chain |
| 567 | lr %r15,%r1 |
| 568 | io_resume_loop: |
| 569 | tm __TI_flags+3(%r9),_TIF_NEED_RESCHED |
| 570 | bno BASED(io_leave) |
| 571 | mvc __TI_precount(4,%r9),BASED(.Lc_pactive) |
| 572 | stosm __SF_EMPTY(%r15),0x03 # reenable interrupts |
| 573 | l %r1,BASED(.Lschedule) |
| 574 | basr %r14,%r1 # call schedule |
| 575 | stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts |
| 576 | xc __TI_precount(4,%r9),__TI_precount(%r9) |
| 577 | b BASED(io_resume_loop) |
| 578 | #endif |
| 579 | |
| 580 | # |
| 581 | # switch to kernel stack, then check the TIF bits |
| 582 | # |
| 583 | io_work: |
| 584 | l %r1,__LC_KERNEL_STACK |
| 585 | s %r1,BASED(.Lc_spsize) |
| 586 | mvc SP_PTREGS(__PT_SIZE,%r1),SP_PTREGS(%r15) |
| 587 | xc __SF_BACKCHAIN(4,%r1),__SF_BACKCHAIN(%r1) # clear back chain |
| 588 | lr %r15,%r1 |
| 589 | # |
| 590 | # One of the work bits is on. Find out which one. |
Heiko Carstens | 54dfe5d | 2006-02-01 03:06:38 -0800 | [diff] [blame] | 591 | # Checked are: _TIF_SIGPENDING, _TIF_RESTORE_SIGMASK, _TIF_NEED_RESCHED |
| 592 | # and _TIF_MCCK_PENDING |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 593 | # |
| 594 | io_work_loop: |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 595 | tm __TI_flags+3(%r9),_TIF_MCCK_PENDING |
| 596 | bo BASED(io_mcck_pending) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 597 | tm __TI_flags+3(%r9),_TIF_NEED_RESCHED |
| 598 | bo BASED(io_reschedule) |
Heiko Carstens | 54dfe5d | 2006-02-01 03:06:38 -0800 | [diff] [blame] | 599 | tm __TI_flags+3(%r9),(_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK) |
| 600 | bnz BASED(io_sigpending) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 601 | b BASED(io_leave) |
| 602 | |
| 603 | # |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 604 | # _TIF_MCCK_PENDING is set, call handler |
| 605 | # |
| 606 | io_mcck_pending: |
| 607 | l %r1,BASED(.Ls390_handle_mcck) |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 608 | la %r14,BASED(io_work_loop) |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 609 | br %r1 # TIF bit will be cleared by handler |
| 610 | |
| 611 | # |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 612 | # _TIF_NEED_RESCHED is set, call schedule |
| 613 | # |
| 614 | io_reschedule: |
| 615 | l %r1,BASED(.Lschedule) |
| 616 | stosm __SF_EMPTY(%r15),0x03 # reenable interrupts |
| 617 | basr %r14,%r1 # call scheduler |
| 618 | stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts |
| 619 | tm __TI_flags+3(%r9),_TIF_WORK_INT |
| 620 | bz BASED(io_leave) # there is no work to do |
| 621 | b BASED(io_work_loop) |
| 622 | |
| 623 | # |
Heiko Carstens | 54dfe5d | 2006-02-01 03:06:38 -0800 | [diff] [blame] | 624 | # _TIF_SIGPENDING or _TIF_RESTORE_SIGMASK is set, call do_signal |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 625 | # |
| 626 | io_sigpending: |
| 627 | stosm __SF_EMPTY(%r15),0x03 # reenable interrupts |
| 628 | la %r2,SP_PTREGS(%r15) # load pt_regs |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 629 | l %r1,BASED(.Ldo_signal) |
| 630 | basr %r14,%r1 # call do_signal |
| 631 | stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts |
Heiko Carstens | e1c3ad9 | 2005-11-07 00:59:02 -0800 | [diff] [blame] | 632 | b BASED(io_work_loop) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 633 | |
| 634 | /* |
| 635 | * External interrupt handler routine |
| 636 | */ |
| 637 | |
| 638 | .globl ext_int_handler |
| 639 | ext_int_handler: |
| 640 | STORE_TIMER __LC_ASYNC_ENTER_TIMER |
| 641 | stck __LC_INT_CLOCK |
| 642 | SAVE_ALL_BASE __LC_SAVE_AREA+16 |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 643 | SAVE_ALL_ASYNC __LC_EXT_OLD_PSW,__LC_SAVE_AREA+16 |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 644 | CREATE_STACK_FRAME __LC_EXT_OLD_PSW,__LC_SAVE_AREA+16 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 645 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING |
| 646 | tm SP_PSW+1(%r15),0x01 # interrupting from user ? |
| 647 | bz BASED(ext_no_vtime) |
| 648 | UPDATE_VTIME __LC_EXIT_TIMER,__LC_ASYNC_ENTER_TIMER,__LC_USER_TIMER |
| 649 | UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER |
| 650 | mvc __LC_LAST_UPDATE_TIMER(8),__LC_ASYNC_ENTER_TIMER |
| 651 | ext_no_vtime: |
| 652 | #endif |
| 653 | l %r9,__LC_THREAD_INFO # load pointer to thread_info struct |
| 654 | la %r2,SP_PTREGS(%r15) # address of register-save area |
| 655 | lh %r3,__LC_EXT_INT_CODE # get interruption code |
| 656 | l %r1,BASED(.Ldo_extint) |
| 657 | basr %r14,%r1 |
| 658 | b BASED(io_return) |
| 659 | |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 660 | __critical_end: |
| 661 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 662 | /* |
| 663 | * Machine check handler routines |
| 664 | */ |
| 665 | |
| 666 | .globl mcck_int_handler |
| 667 | mcck_int_handler: |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 668 | spt __LC_CPU_TIMER_SAVE_AREA # revalidate cpu timer |
| 669 | lm %r0,%r15,__LC_GPREGS_SAVE_AREA # revalidate gprs |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 670 | SAVE_ALL_BASE __LC_SAVE_AREA+32 |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 671 | la %r12,__LC_MCK_OLD_PSW |
| 672 | tm __LC_MCCK_CODE,0x80 # system damage? |
| 673 | bo BASED(mcck_int_main) # yes -> rest of mcck code invalid |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 674 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 675 | mvc __LC_SAVE_AREA+52(8),__LC_ASYNC_ENTER_TIMER |
| 676 | mvc __LC_ASYNC_ENTER_TIMER(8),__LC_CPU_TIMER_SAVE_AREA |
| 677 | tm __LC_MCCK_CODE+5,0x02 # stored cpu timer value valid? |
| 678 | bo BASED(1f) |
| 679 | la %r14,__LC_SYNC_ENTER_TIMER |
| 680 | clc 0(8,%r14),__LC_ASYNC_ENTER_TIMER |
| 681 | bl BASED(0f) |
| 682 | la %r14,__LC_ASYNC_ENTER_TIMER |
| 683 | 0: clc 0(8,%r14),__LC_EXIT_TIMER |
| 684 | bl BASED(0f) |
| 685 | la %r14,__LC_EXIT_TIMER |
| 686 | 0: clc 0(8,%r14),__LC_LAST_UPDATE_TIMER |
| 687 | bl BASED(0f) |
| 688 | la %r14,__LC_LAST_UPDATE_TIMER |
| 689 | 0: spt 0(%r14) |
| 690 | mvc __LC_ASYNC_ENTER_TIMER(8),0(%r14) |
| 691 | 1: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 692 | #endif |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 693 | tm __LC_MCCK_CODE+2,0x09 # mwp + ia of old psw valid? |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 694 | bno BASED(mcck_int_main) # no -> skip cleanup critical |
| 695 | tm __LC_MCK_OLD_PSW+1,0x01 # test problem state bit |
| 696 | bnz BASED(mcck_int_main) # from user -> load async stack |
| 697 | clc __LC_MCK_OLD_PSW+4(4),BASED(.Lcritical_end) |
| 698 | bhe BASED(mcck_int_main) |
| 699 | clc __LC_MCK_OLD_PSW+4(4),BASED(.Lcritical_start) |
| 700 | bl BASED(mcck_int_main) |
| 701 | l %r14,BASED(.Lcleanup_critical) |
| 702 | basr %r14,%r14 |
| 703 | mcck_int_main: |
| 704 | l %r14,__LC_PANIC_STACK # are we already on the panic stack? |
| 705 | slr %r14,%r15 |
| 706 | sra %r14,PAGE_SHIFT |
| 707 | be BASED(0f) |
| 708 | l %r15,__LC_PANIC_STACK # load panic stack |
| 709 | 0: CREATE_STACK_FRAME __LC_MCK_OLD_PSW,__LC_SAVE_AREA+32 |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 710 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING |
| 711 | tm __LC_MCCK_CODE+2,0x08 # mwp of old psw valid? |
| 712 | bno BASED(mcck_no_vtime) # no -> skip cleanup critical |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 713 | tm SP_PSW+1(%r15),0x01 # interrupting from user ? |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 714 | bz BASED(mcck_no_vtime) |
| 715 | UPDATE_VTIME __LC_EXIT_TIMER,__LC_ASYNC_ENTER_TIMER,__LC_USER_TIMER |
| 716 | UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER |
| 717 | mvc __LC_LAST_UPDATE_TIMER(8),__LC_ASYNC_ENTER_TIMER |
| 718 | mcck_no_vtime: |
| 719 | #endif |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 720 | l %r9,__LC_THREAD_INFO # load pointer to thread_info struct |
| 721 | la %r2,SP_PTREGS(%r15) # load pt_regs |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 722 | l %r1,BASED(.Ls390_mcck) |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 723 | basr %r14,%r1 # call machine check handler |
| 724 | tm SP_PSW+1(%r15),0x01 # returning to user ? |
| 725 | bno BASED(mcck_return) |
| 726 | l %r1,__LC_KERNEL_STACK # switch to kernel stack |
| 727 | s %r1,BASED(.Lc_spsize) |
| 728 | mvc SP_PTREGS(__PT_SIZE,%r1),SP_PTREGS(%r15) |
| 729 | xc __SF_BACKCHAIN(4,%r1),__SF_BACKCHAIN(%r1) # clear back chain |
| 730 | lr %r15,%r1 |
| 731 | stosm __SF_EMPTY(%r15),0x04 # turn dat on |
| 732 | tm __TI_flags+3(%r9),_TIF_MCCK_PENDING |
| 733 | bno BASED(mcck_return) |
| 734 | l %r1,BASED(.Ls390_handle_mcck) |
| 735 | basr %r14,%r1 # call machine check handler |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 736 | mcck_return: |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 737 | mvc __LC_RETURN_MCCK_PSW(8),SP_PSW(%r15) # move return PSW |
| 738 | ni __LC_RETURN_MCCK_PSW+1,0xfd # clear wait state bit |
| 739 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING |
| 740 | mvc __LC_ASYNC_ENTER_TIMER(8),__LC_SAVE_AREA+52 |
| 741 | tm __LC_RETURN_MCCK_PSW+1,0x01 # returning to user ? |
| 742 | bno BASED(0f) |
| 743 | lm %r0,%r15,SP_R0(%r15) # load gprs 0-15 |
| 744 | stpt __LC_EXIT_TIMER |
| 745 | lpsw __LC_RETURN_MCCK_PSW # back to caller |
| 746 | 0: |
| 747 | #endif |
| 748 | lm %r0,%r15,SP_R0(%r15) # load gprs 0-15 |
| 749 | lpsw __LC_RETURN_MCCK_PSW # back to caller |
| 750 | |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 751 | RESTORE_ALL __LC_RETURN_MCCK_PSW,0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 752 | |
| 753 | #ifdef CONFIG_SMP |
| 754 | /* |
| 755 | * Restart interruption handler, kick starter for additional CPUs |
| 756 | */ |
| 757 | .globl restart_int_handler |
| 758 | restart_int_handler: |
| 759 | l %r15,__LC_SAVE_AREA+60 # load ksp |
| 760 | lctl %c0,%c15,__LC_CREGS_SAVE_AREA # get new ctl regs |
| 761 | lam %a0,%a15,__LC_AREGS_SAVE_AREA |
| 762 | lm %r6,%r15,__SF_GPRS(%r15) # load registers from clone |
| 763 | stosm __SF_EMPTY(%r15),0x04 # now we can turn dat on |
| 764 | basr %r14,0 |
| 765 | l %r14,restart_addr-.(%r14) |
| 766 | br %r14 # branch to start_secondary |
| 767 | restart_addr: |
| 768 | .long start_secondary |
| 769 | #else |
| 770 | /* |
| 771 | * If we do not run with SMP enabled, let the new CPU crash ... |
| 772 | */ |
| 773 | .globl restart_int_handler |
| 774 | restart_int_handler: |
| 775 | basr %r1,0 |
| 776 | restart_base: |
| 777 | lpsw restart_crash-restart_base(%r1) |
| 778 | .align 8 |
| 779 | restart_crash: |
| 780 | .long 0x000a0000,0x00000000 |
| 781 | restart_go: |
| 782 | #endif |
| 783 | |
| 784 | #ifdef CONFIG_CHECK_STACK |
| 785 | /* |
| 786 | * The synchronous or the asynchronous stack overflowed. We are dead. |
| 787 | * No need to properly save the registers, we are going to panic anyway. |
| 788 | * Setup a pt_regs so that show_trace can provide a good call trace. |
| 789 | */ |
| 790 | stack_overflow: |
| 791 | l %r15,__LC_PANIC_STACK # change to panic stack |
| 792 | sl %r15,BASED(.Lc_spsize) |
| 793 | mvc SP_PSW(8,%r15),0(%r12) # move user PSW to stack |
| 794 | stm %r0,%r11,SP_R0(%r15) # store gprs %r0-%r11 to kernel stack |
| 795 | la %r1,__LC_SAVE_AREA |
| 796 | ch %r12,BASED(.L0x020) # old psw addr == __LC_SVC_OLD_PSW ? |
| 797 | be BASED(0f) |
| 798 | ch %r12,BASED(.L0x028) # old psw addr == __LC_PGM_OLD_PSW ? |
| 799 | be BASED(0f) |
| 800 | la %r1,__LC_SAVE_AREA+16 |
| 801 | 0: mvc SP_R12(16,%r15),0(%r1) # move %r12-%r15 to stack |
| 802 | xc __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15) # clear back chain |
| 803 | l %r1,BASED(1f) # branch to kernel_stack_overflow |
| 804 | la %r2,SP_PTREGS(%r15) # load pt_regs |
| 805 | br %r1 |
| 806 | 1: .long kernel_stack_overflow |
| 807 | #endif |
| 808 | |
| 809 | cleanup_table_system_call: |
| 810 | .long system_call + 0x80000000, sysc_do_svc + 0x80000000 |
| 811 | cleanup_table_sysc_return: |
| 812 | .long sysc_return + 0x80000000, sysc_leave + 0x80000000 |
| 813 | cleanup_table_sysc_leave: |
| 814 | .long sysc_leave + 0x80000000, sysc_work_loop + 0x80000000 |
| 815 | cleanup_table_sysc_work_loop: |
| 816 | .long sysc_work_loop + 0x80000000, sysc_reschedule + 0x80000000 |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 817 | cleanup_table_io_return: |
| 818 | .long io_return + 0x80000000, io_leave + 0x80000000 |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 819 | cleanup_table_io_leave: |
| 820 | .long io_leave + 0x80000000, io_done + 0x80000000 |
| 821 | cleanup_table_io_work_loop: |
| 822 | .long io_work_loop + 0x80000000, io_mcck_pending + 0x80000000 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 823 | |
| 824 | cleanup_critical: |
| 825 | clc 4(4,%r12),BASED(cleanup_table_system_call) |
| 826 | bl BASED(0f) |
| 827 | clc 4(4,%r12),BASED(cleanup_table_system_call+4) |
| 828 | bl BASED(cleanup_system_call) |
| 829 | 0: |
| 830 | clc 4(4,%r12),BASED(cleanup_table_sysc_return) |
| 831 | bl BASED(0f) |
| 832 | clc 4(4,%r12),BASED(cleanup_table_sysc_return+4) |
| 833 | bl BASED(cleanup_sysc_return) |
| 834 | 0: |
| 835 | clc 4(4,%r12),BASED(cleanup_table_sysc_leave) |
| 836 | bl BASED(0f) |
| 837 | clc 4(4,%r12),BASED(cleanup_table_sysc_leave+4) |
| 838 | bl BASED(cleanup_sysc_leave) |
| 839 | 0: |
| 840 | clc 4(4,%r12),BASED(cleanup_table_sysc_work_loop) |
| 841 | bl BASED(0f) |
| 842 | clc 4(4,%r12),BASED(cleanup_table_sysc_work_loop+4) |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 843 | bl BASED(cleanup_sysc_return) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 844 | 0: |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 845 | clc 4(4,%r12),BASED(cleanup_table_io_return) |
| 846 | bl BASED(0f) |
| 847 | clc 4(4,%r12),BASED(cleanup_table_io_return+4) |
| 848 | bl BASED(cleanup_io_return) |
| 849 | 0: |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 850 | clc 4(4,%r12),BASED(cleanup_table_io_leave) |
| 851 | bl BASED(0f) |
| 852 | clc 4(4,%r12),BASED(cleanup_table_io_leave+4) |
| 853 | bl BASED(cleanup_io_leave) |
| 854 | 0: |
| 855 | clc 4(4,%r12),BASED(cleanup_table_io_work_loop) |
| 856 | bl BASED(0f) |
| 857 | clc 4(4,%r12),BASED(cleanup_table_io_work_loop+4) |
| 858 | bl BASED(cleanup_io_return) |
| 859 | 0: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 860 | br %r14 |
| 861 | |
| 862 | cleanup_system_call: |
| 863 | mvc __LC_RETURN_PSW(8),0(%r12) |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 864 | c %r12,BASED(.Lmck_old_psw) |
| 865 | be BASED(0f) |
| 866 | la %r12,__LC_SAVE_AREA+16 |
| 867 | b BASED(1f) |
| 868 | 0: la %r12,__LC_SAVE_AREA+32 |
| 869 | 1: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 870 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING |
| 871 | clc __LC_RETURN_PSW+4(4),BASED(cleanup_system_call_insn+4) |
| 872 | bh BASED(0f) |
| 873 | mvc __LC_SYNC_ENTER_TIMER(8),__LC_ASYNC_ENTER_TIMER |
| 874 | 0: clc __LC_RETURN_PSW+4(4),BASED(cleanup_system_call_insn+8) |
| 875 | bhe BASED(cleanup_vtime) |
| 876 | #endif |
| 877 | clc __LC_RETURN_PSW+4(4),BASED(cleanup_system_call_insn) |
| 878 | bh BASED(0f) |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 879 | mvc __LC_SAVE_AREA(16),0(%r12) |
| 880 | 0: st %r13,4(%r12) |
| 881 | st %r12,__LC_SAVE_AREA+48 # argh |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 882 | SAVE_ALL_SYNC __LC_SVC_OLD_PSW,__LC_SAVE_AREA |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 883 | CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 884 | l %r12,__LC_SAVE_AREA+48 # argh |
| 885 | st %r15,12(%r12) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 886 | lh %r7,0x8a |
| 887 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING |
| 888 | cleanup_vtime: |
| 889 | clc __LC_RETURN_PSW+4(4),BASED(cleanup_system_call_insn+12) |
| 890 | bhe BASED(cleanup_stime) |
| 891 | tm SP_PSW+1(%r15),0x01 # interrupting from user ? |
| 892 | bz BASED(cleanup_novtime) |
| 893 | UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER |
| 894 | cleanup_stime: |
| 895 | clc __LC_RETURN_PSW+4(4),BASED(cleanup_system_call_insn+16) |
| 896 | bh BASED(cleanup_update) |
| 897 | UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER |
| 898 | cleanup_update: |
| 899 | mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER |
| 900 | cleanup_novtime: |
| 901 | #endif |
| 902 | mvc __LC_RETURN_PSW+4(4),BASED(cleanup_table_system_call+4) |
| 903 | la %r12,__LC_RETURN_PSW |
| 904 | br %r14 |
| 905 | cleanup_system_call_insn: |
| 906 | .long sysc_saveall + 0x80000000 |
| 907 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING |
| 908 | .long system_call + 0x80000000 |
| 909 | .long sysc_vtime + 0x80000000 |
| 910 | .long sysc_stime + 0x80000000 |
| 911 | .long sysc_update + 0x80000000 |
| 912 | #endif |
| 913 | |
| 914 | cleanup_sysc_return: |
| 915 | mvc __LC_RETURN_PSW(4),0(%r12) |
| 916 | mvc __LC_RETURN_PSW+4(4),BASED(cleanup_table_sysc_return) |
| 917 | la %r12,__LC_RETURN_PSW |
| 918 | br %r14 |
| 919 | |
| 920 | cleanup_sysc_leave: |
| 921 | clc 4(4,%r12),BASED(cleanup_sysc_leave_insn) |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 922 | be BASED(2f) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 923 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING |
| 924 | mvc __LC_EXIT_TIMER(8),__LC_ASYNC_ENTER_TIMER |
| 925 | clc 4(4,%r12),BASED(cleanup_sysc_leave_insn+4) |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 926 | be BASED(2f) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 927 | #endif |
| 928 | mvc __LC_RETURN_PSW(8),SP_PSW(%r15) |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 929 | c %r12,BASED(.Lmck_old_psw) |
| 930 | bne BASED(0f) |
| 931 | mvc __LC_SAVE_AREA+32(16),SP_R12(%r15) |
| 932 | b BASED(1f) |
| 933 | 0: mvc __LC_SAVE_AREA+16(16),SP_R12(%r15) |
| 934 | 1: lm %r0,%r11,SP_R0(%r15) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 935 | l %r15,SP_R15(%r15) |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 936 | 2: la %r12,__LC_RETURN_PSW |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 937 | br %r14 |
| 938 | cleanup_sysc_leave_insn: |
| 939 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING |
| 940 | .long sysc_leave + 14 + 0x80000000 |
| 941 | #endif |
| 942 | .long sysc_leave + 10 + 0x80000000 |
| 943 | |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 944 | cleanup_io_return: |
| 945 | mvc __LC_RETURN_PSW(4),0(%r12) |
| 946 | mvc __LC_RETURN_PSW+4(4),BASED(cleanup_table_io_work_loop) |
| 947 | la %r12,__LC_RETURN_PSW |
| 948 | br %r14 |
| 949 | |
| 950 | cleanup_io_leave: |
| 951 | clc 4(4,%r12),BASED(cleanup_io_leave_insn) |
| 952 | be BASED(2f) |
| 953 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING |
| 954 | mvc __LC_EXIT_TIMER(8),__LC_ASYNC_ENTER_TIMER |
| 955 | clc 4(4,%r12),BASED(cleanup_io_leave_insn+4) |
| 956 | be BASED(2f) |
| 957 | #endif |
| 958 | mvc __LC_RETURN_PSW(8),SP_PSW(%r15) |
| 959 | c %r12,BASED(.Lmck_old_psw) |
| 960 | bne BASED(0f) |
| 961 | mvc __LC_SAVE_AREA+32(16),SP_R12(%r15) |
| 962 | b BASED(1f) |
| 963 | 0: mvc __LC_SAVE_AREA+16(16),SP_R12(%r15) |
| 964 | 1: lm %r0,%r11,SP_R0(%r15) |
| 965 | l %r15,SP_R15(%r15) |
| 966 | 2: la %r12,__LC_RETURN_PSW |
| 967 | br %r14 |
| 968 | cleanup_io_leave_insn: |
| 969 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING |
| 970 | .long io_leave + 18 + 0x80000000 |
| 971 | #endif |
| 972 | .long io_leave + 14 + 0x80000000 |
| 973 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 974 | /* |
| 975 | * Integer constants |
| 976 | */ |
| 977 | .align 4 |
| 978 | .Lc_spsize: .long SP_SIZE |
| 979 | .Lc_overhead: .long STACK_FRAME_OVERHEAD |
| 980 | .Lc_pactive: .long PREEMPT_ACTIVE |
| 981 | .Lnr_syscalls: .long NR_syscalls |
| 982 | .L0x018: .short 0x018 |
| 983 | .L0x020: .short 0x020 |
| 984 | .L0x028: .short 0x028 |
| 985 | .L0x030: .short 0x030 |
| 986 | .L0x038: .short 0x038 |
| 987 | .Lc_1: .long 1 |
| 988 | |
| 989 | /* |
| 990 | * Symbol constants |
| 991 | */ |
| 992 | .Ls390_mcck: .long s390_do_machine_check |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 993 | .Ls390_handle_mcck: |
| 994 | .long s390_handle_mcck |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 995 | .Lmck_old_psw: .long __LC_MCK_OLD_PSW |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 996 | .Ldo_IRQ: .long do_IRQ |
| 997 | .Ldo_extint: .long do_extint |
| 998 | .Ldo_signal: .long do_signal |
| 999 | .Lhandle_per: .long do_single_step |
| 1000 | .Ljump_table: .long pgm_check_table |
| 1001 | .Lschedule: .long schedule |
| 1002 | .Lclone: .long sys_clone |
| 1003 | .Lexecve: .long sys_execve |
| 1004 | .Lfork: .long sys_fork |
| 1005 | .Lrt_sigreturn:.long sys_rt_sigreturn |
| 1006 | .Lrt_sigsuspend: |
| 1007 | .long sys_rt_sigsuspend |
| 1008 | .Lsigreturn: .long sys_sigreturn |
| 1009 | .Lsigsuspend: .long sys_sigsuspend |
| 1010 | .Lsigaltstack: .long sys_sigaltstack |
| 1011 | .Ltrace: .long syscall_trace |
| 1012 | .Lvfork: .long sys_vfork |
| 1013 | .Lschedtail: .long schedule_tail |
Heiko Carstens | d882b17 | 2006-07-01 04:36:31 -0700 | [diff] [blame^] | 1014 | .Lsysc_table: .long sys_call_table |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1015 | |
| 1016 | .Lcritical_start: |
| 1017 | .long __critical_start + 0x80000000 |
| 1018 | .Lcritical_end: |
| 1019 | .long __critical_end + 0x80000000 |
| 1020 | .Lcleanup_critical: |
| 1021 | .long cleanup_critical |
| 1022 | |
Heiko Carstens | d882b17 | 2006-07-01 04:36:31 -0700 | [diff] [blame^] | 1023 | .section .rodata, "a" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1024 | #define SYSCALL(esa,esame,emu) .long esa |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1025 | sys_call_table: |
| 1026 | #include "syscalls.S" |
| 1027 | #undef SYSCALL |