.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Common Low Level Interrupts/Traps/Exceptions(non-TLB) Handling for ARC |
---|
3 | 4 | * (included from entry-<isa>.S |
---|
4 | 5 | * |
---|
5 | 6 | * Copyright (C) 2014-15 Synopsys, Inc. (www.synopsys.com) |
---|
6 | 7 | * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) |
---|
7 | | - * |
---|
8 | | - * This program is free software; you can redistribute it and/or modify |
---|
9 | | - * it under the terms of the GNU General Public License version 2 as |
---|
10 | | - * published by the Free Software Foundation. |
---|
11 | 8 | */ |
---|
12 | 9 | |
---|
13 | 10 | /*------------------------------------------------------------------ |
---|
.. | .. |
---|
37 | 34 | |
---|
38 | 35 | b .Lret_from_system_call |
---|
39 | 36 | END(sys_clone_wrapper) |
---|
| 37 | + |
---|
| 38 | +ENTRY(sys_clone3_wrapper) |
---|
| 39 | + SAVE_CALLEE_SAVED_USER |
---|
| 40 | + bl @sys_clone3 |
---|
| 41 | + DISCARD_CALLEE_SAVED_USER |
---|
| 42 | + |
---|
| 43 | + GET_CURR_THR_INFO_FLAGS r10 |
---|
| 44 | + btst r10, TIF_SYSCALL_TRACE |
---|
| 45 | + bnz tracesys_exit |
---|
| 46 | + |
---|
| 47 | + b .Lret_from_system_call |
---|
| 48 | +END(sys_clone3_wrapper) |
---|
40 | 49 | |
---|
41 | 50 | ENTRY(ret_from_fork) |
---|
42 | 51 | ; when the forked child comes here from the __switch_to function |
---|
.. | .. |
---|
156 | 165 | tracesys: |
---|
157 | 166 | ; save EFA in case tracer wants the PC of traced task |
---|
158 | 167 | ; using ERET won't work since next-PC has already committed |
---|
159 | | - lr r12, [efa] |
---|
160 | 168 | GET_CURR_TASK_FIELD_PTR TASK_THREAD, r11 |
---|
161 | 169 | st r12, [r11, THREAD_FAULT_ADDR] ; thread.fault_address |
---|
162 | 170 | |
---|
.. | .. |
---|
191 | 199 | st r0, [sp, PT_r0] ; sys call return value in pt_regs |
---|
192 | 200 | |
---|
193 | 201 | ;POST Sys Call Ptrace Hook |
---|
| 202 | + mov r0, sp ; pt_regs needed |
---|
194 | 203 | bl @syscall_trace_exit |
---|
195 | 204 | b ret_from_exception ; NOT ret_from_system_call at is saves r0 which |
---|
196 | 205 | ; we'd done before calling post hook above |
---|
.. | .. |
---|
199 | 208 | ; Breakpoint TRAP |
---|
200 | 209 | ; --------------------------------------------- |
---|
201 | 210 | trap_with_param: |
---|
202 | | - |
---|
203 | | - ; stop_pc info by gdb needs this info |
---|
204 | | - lr r0, [efa] |
---|
| 211 | + mov r0, r12 ; EFA in case ptracer/gdb wants stop_pc |
---|
205 | 212 | mov r1, sp |
---|
206 | | - |
---|
207 | | - ; Now that we have read EFA, it is safe to do "fake" rtie |
---|
208 | | - ; and get out of CPU exception mode |
---|
209 | | - FAKE_RET_FROM_EXCPN |
---|
210 | 213 | |
---|
211 | 214 | ; Save callee regs in case gdb wants to have a look |
---|
212 | 215 | ; SP will grow up by size of CALLEE Reg-File |
---|
.. | .. |
---|
234 | 237 | |
---|
235 | 238 | EXCEPTION_PROLOGUE |
---|
236 | 239 | |
---|
| 240 | + lr r12, [efa] |
---|
| 241 | + |
---|
| 242 | + FAKE_RET_FROM_EXCPN |
---|
| 243 | + |
---|
237 | 244 | ;============ TRAP 1 :breakpoints |
---|
238 | | - ; Check ECR for trap with arg (PROLOGUE ensures r9 has ECR) |
---|
239 | | - bmsk.f 0, r9, 7 |
---|
| 245 | + ; Check ECR for trap with arg (PROLOGUE ensures r10 has ECR) |
---|
| 246 | + bmsk.f 0, r10, 7 |
---|
240 | 247 | bnz trap_with_param |
---|
241 | 248 | |
---|
242 | 249 | ;============ TRAP (no param): syscall top level |
---|
243 | | - |
---|
244 | | - ; First return from Exception to pure K mode (Exception/IRQs renabled) |
---|
245 | | - FAKE_RET_FROM_EXCPN |
---|
246 | 250 | |
---|
247 | 251 | ; If syscall tracing ongoing, invoke pre-post-hooks |
---|
248 | 252 | GET_CURR_THR_INFO_FLAGS r10 |
---|
.. | .. |
---|
304 | 308 | mov r0, sp ; pt_regs for arg to do_signal()/do_notify_resume() |
---|
305 | 309 | |
---|
306 | 310 | GET_CURR_THR_INFO_FLAGS r9 |
---|
307 | | - bbit0 r9, TIF_SIGPENDING, .Lchk_notify_resume |
---|
| 311 | + and.f 0, r9, _TIF_SIGPENDING|_TIF_NOTIFY_SIGNAL |
---|
| 312 | + bz .Lchk_notify_resume |
---|
308 | 313 | |
---|
309 | 314 | ; Normal Trap/IRQ entry only saves Scratch (caller-saved) regs |
---|
310 | 315 | ; in pt_reg since the "C" ABI (kernel code) will automatically |
---|
.. | .. |
---|
340 | 345 | resume_kernel_mode: |
---|
341 | 346 | |
---|
342 | 347 | ; Disable Interrupts from this point on |
---|
343 | | - ; CONFIG_PREEMPT: This is a must for preempt_schedule_irq() |
---|
344 | | - ; !CONFIG_PREEMPT: To ensure restore_regs is intr safe |
---|
| 348 | + ; CONFIG_PREEMPTION: This is a must for preempt_schedule_irq() |
---|
| 349 | + ; !CONFIG_PREEMPTION: To ensure restore_regs is intr safe |
---|
345 | 350 | IRQ_DISABLE r9 |
---|
346 | 351 | |
---|
347 | | -#ifdef CONFIG_PREEMPT |
---|
| 352 | +#ifdef CONFIG_PREEMPTION |
---|
348 | 353 | |
---|
349 | 354 | ; Can't preempt if preemption disabled |
---|
350 | 355 | GET_CURR_THR_INFO_FROM_SP r10 |
---|