hc
2024-05-10 748e4f3d702def1a4bff191e0cf93b6a05340f01
kernel/arch/sh/kernel/entry-common.S
....@@ -1,11 +1,7 @@
1
-/*
1
+/* SPDX-License-Identifier: GPL-2.0
2
+ *
23 * Copyright (C) 1999, 2000, 2002 Niibe Yutaka
34 * Copyright (C) 2003 - 2008 Paul Mundt
4
- *
5
- * This file is subject to the terms and conditions of the GNU General Public
6
- * License. See the file "COPYING" in the main directory of this archive
7
- * for more details.
8
- *
95 */
106
117 ! NOTE:
....@@ -45,7 +41,7 @@
4541 */
4642 #include <asm/dwarf.h>
4743
48
-#if defined(CONFIG_PREEMPT)
44
+#if defined(CONFIG_PREEMPTION)
4945 # define preempt_stop() cli ; TRACE_IRQS_OFF
5046 #else
5147 # define preempt_stop()
....@@ -88,7 +84,7 @@
8884 get_current_thread_info r8, r0
8985 bt resume_kernel ! Yes, it's from kernel, go back soon
9086
91
-#ifdef CONFIG_PREEMPT
87
+#ifdef CONFIG_PREEMPTION
9288 bra resume_userspace
9389 nop
9490 ENTRY(resume_kernel)
....@@ -181,34 +177,6 @@
181177 nop
182178 bra resume_userspace
183179 nop
184
-
185
- .align 2
186
-syscall_trace_entry:
187
- ! Yes it is traced.
188
- mov r15, r4
189
- mov.l 7f, r11 ! Call do_syscall_trace_enter which notifies
190
- jsr @r11 ! superior (will chomp R[0-7])
191
- nop
192
- mov.l r0, @(OFF_R0,r15) ! Save return value
193
- ! Reload R0-R4 from kernel stack, where the
194
- ! parent may have modified them using
195
- ! ptrace(POKEUSR). (Note that R0-R2 are
196
- ! reloaded from the kernel stack by syscall_call
197
- ! below, so don't need to be reloaded here.)
198
- ! This allows the parent to rewrite system calls
199
- ! and args on the fly.
200
- mov.l @(OFF_R4,r15), r4 ! arg0
201
- mov.l @(OFF_R5,r15), r5
202
- mov.l @(OFF_R6,r15), r6
203
- mov.l @(OFF_R7,r15), r7 ! arg3
204
- mov.l @(OFF_R3,r15), r3 ! syscall_nr
205
- !
206
- mov.l 6f, r10 ! Number of syscalls
207
- cmp/hs r10, r3
208
- bf syscall_call
209
- mov #-ENOSYS, r0
210
- bra syscall_exit
211
- mov.l r0, @(OFF_R0,r15) ! Return value
212180
213181 __restore_all:
214182 mov #OFF_SR, r0
....@@ -392,6 +360,36 @@
392360 bf syscall_exit_work
393361 bra __restore_all
394362 nop
363
+
364
+ .align 2
365
+syscall_trace_entry:
366
+ ! Yes it is traced.
367
+ mov r15, r4
368
+ mov.l 7f, r11 ! Call do_syscall_trace_enter which notifies
369
+ jsr @r11 ! superior (will chomp R[0-7])
370
+ nop
371
+ cmp/eq #-1, r0
372
+ bt syscall_exit
373
+ ! Reload R0-R4 from kernel stack, where the
374
+ ! parent may have modified them using
375
+ ! ptrace(POKEUSR). (Note that R0-R2 are
376
+ ! reloaded from the kernel stack by syscall_call
377
+ ! below, so don't need to be reloaded here.)
378
+ ! This allows the parent to rewrite system calls
379
+ ! and args on the fly.
380
+ mov.l @(OFF_R4,r15), r4 ! arg0
381
+ mov.l @(OFF_R5,r15), r5
382
+ mov.l @(OFF_R6,r15), r6
383
+ mov.l @(OFF_R7,r15), r7 ! arg3
384
+ mov.l @(OFF_R3,r15), r3 ! syscall_nr
385
+ !
386
+ mov.l 6f, r10 ! Number of syscalls
387
+ cmp/hs r10, r3
388
+ bf syscall_call
389
+ mov #-ENOSYS, r0
390
+ bra syscall_exit
391
+ mov.l r0, @(OFF_R0,r15) ! Return value
392
+
395393 .align 2
396394 #if !defined(CONFIG_CPU_SH2)
397395 1: .long TRA