forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/arch/arc/kernel/traps.c
....@@ -1,11 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Traps/Non-MMU Exception 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: May 2011
118 * -user-space unaligned access emulation
....@@ -42,21 +39,22 @@
4239 * -for kernel, chk if due to copy_(to|from)_user, otherwise die()
4340 */
4441 static noinline int
45
-unhandled_exception(const char *str, struct pt_regs *regs, siginfo_t *info)
42
+unhandled_exception(const char *str, struct pt_regs *regs,
43
+ int signo, int si_code, void __user *addr)
4644 {
4745 if (user_mode(regs)) {
4846 struct task_struct *tsk = current;
4947
50
- tsk->thread.fault_address = (__force unsigned int)info->si_addr;
48
+ tsk->thread.fault_address = (__force unsigned int)addr;
5149
52
- force_sig_info(info->si_signo, info, tsk);
50
+ force_sig_fault(signo, si_code, addr);
5351
5452 } else {
5553 /* If not due to copy_(to|from)_user, we are doomed */
5654 if (fixup_exception(regs))
5755 return 0;
5856
59
- die(str, regs, (unsigned long)info->si_addr);
57
+ die(str, regs, (unsigned long)addr);
6058 }
6159
6260 return 1;
....@@ -64,16 +62,9 @@
6462
6563 #define DO_ERROR_INFO(signr, str, name, sicode) \
6664 int name(unsigned long address, struct pt_regs *regs) \
67
-{ \
68
- siginfo_t info; \
69
- \
70
- clear_siginfo(&info); \
71
- info.si_signo = signr; \
72
- info.si_errno = 0; \
73
- info.si_code = sicode; \
74
- info.si_addr = (void __user *)address; \
75
- \
76
- return unhandled_exception(str, regs, &info);\
65
+{ \
66
+ return unhandled_exception(str, regs, signr, sicode, \
67
+ (void __user *)address); \
7768 }
7869
7970 /*