| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Traps/Non-MMU Exception handling for ARC |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * 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. |
|---|
| 9 | 6 | * |
|---|
| 10 | 7 | * vineetg: May 2011 |
|---|
| 11 | 8 | * -user-space unaligned access emulation |
|---|
| .. | .. |
|---|
| 42 | 39 | * -for kernel, chk if due to copy_(to|from)_user, otherwise die() |
|---|
| 43 | 40 | */ |
|---|
| 44 | 41 | 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) |
|---|
| 46 | 44 | { |
|---|
| 47 | 45 | if (user_mode(regs)) { |
|---|
| 48 | 46 | struct task_struct *tsk = current; |
|---|
| 49 | 47 | |
|---|
| 50 | | - tsk->thread.fault_address = (__force unsigned int)info->si_addr; |
|---|
| 48 | + tsk->thread.fault_address = (__force unsigned int)addr; |
|---|
| 51 | 49 | |
|---|
| 52 | | - force_sig_info(info->si_signo, info, tsk); |
|---|
| 50 | + force_sig_fault(signo, si_code, addr); |
|---|
| 53 | 51 | |
|---|
| 54 | 52 | } else { |
|---|
| 55 | 53 | /* If not due to copy_(to|from)_user, we are doomed */ |
|---|
| 56 | 54 | if (fixup_exception(regs)) |
|---|
| 57 | 55 | return 0; |
|---|
| 58 | 56 | |
|---|
| 59 | | - die(str, regs, (unsigned long)info->si_addr); |
|---|
| 57 | + die(str, regs, (unsigned long)addr); |
|---|
| 60 | 58 | } |
|---|
| 61 | 59 | |
|---|
| 62 | 60 | return 1; |
|---|
| .. | .. |
|---|
| 64 | 62 | |
|---|
| 65 | 63 | #define DO_ERROR_INFO(signr, str, name, sicode) \ |
|---|
| 66 | 64 | 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); \ |
|---|
| 77 | 68 | } |
|---|
| 78 | 69 | |
|---|
| 79 | 70 | /* |
|---|