forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-09-20 a36159eec6ca17402b0e146b86efaf76568dc353
kernel/arch/arc/kernel/signal.c
....@@ -1,11 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Signal Handling for ARC
34 *
45 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License version 2 as
8
- * published by the Free Software Foundation.
96 *
107 * vineetg: Jan 2010 (Restarting of timer related syscalls)
118 *
....@@ -212,7 +209,7 @@
212209
213210 sf = (struct rt_sigframe __force __user *)(regs->sp);
214211
215
- if (!access_ok(VERIFY_READ, sf, sizeof(*sf)))
212
+ if (!access_ok(sf, sizeof(*sf)))
216213 goto badframe;
217214
218215 if (__get_user(magic, &sf->sigret_magic))
....@@ -240,7 +237,7 @@
240237 return regs->r0;
241238
242239 badframe:
243
- force_sig(SIGSEGV, current);
240
+ force_sig(SIGSEGV);
244241 return 0;
245242 }
246243
....@@ -262,7 +259,7 @@
262259 frame = (void __user *)((sp - framesize) & ~7);
263260
264261 /* Check that we can actually write to the signal frame */
265
- if (!access_ok(VERIFY_WRITE, frame, framesize))
262
+ if (!access_ok(frame, framesize))
266263 frame = NULL;
267264
268265 return frame;
....@@ -367,7 +364,7 @@
367364 regs->r0 = -EINTR;
368365 break;
369366 }
370
- /* fallthrough */
367
+ fallthrough;
371368
372369 case -ERESTARTNOINTR:
373370 /*
....@@ -408,7 +405,7 @@
408405
409406 restart_scall = in_syscall(regs) && syscall_restartable(regs);
410407
411
- if (get_signal(&ksig)) {
408
+ if (test_thread_flag(TIF_SIGPENDING) && get_signal(&ksig)) {
412409 if (restart_scall) {
413410 arc_restart_syscall(&ksig.ka, regs);
414411 syscall_wont_restart(regs); /* No more restarts */
....@@ -440,6 +437,6 @@
440437 * ASM glue gaurantees that this is only called when returning to
441438 * user mode
442439 */
443
- if (test_and_clear_thread_flag(TIF_NOTIFY_RESUME))
440
+ if (test_thread_flag(TIF_NOTIFY_RESUME))
444441 tracehook_notify_resume(regs);
445442 }