FROMLIST: [PATCH] arm64: compat: Expose offset to registers in sigframes
[GitHub/exynos8895/android_kernel_samsung_universal8895.git] / arch / arm64 / include / asm / signal32.h
CommitLineData
3dd681d9
WD
1/*
2 * Copyright (C) 2012 ARM Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#ifndef __ASM_SIGNAL32_H
17#define __ASM_SIGNAL32_H
18
19#ifdef __KERNEL__
20#ifdef CONFIG_COMPAT
21#include <linux/compat.h>
22
b37091f4
KB
23struct compat_sigcontext {
24 /* We always set these two fields to 0 */
25 compat_ulong_t trap_no;
26 compat_ulong_t error_code;
27
28 compat_ulong_t oldmask;
29 compat_ulong_t arm_r0;
30 compat_ulong_t arm_r1;
31 compat_ulong_t arm_r2;
32 compat_ulong_t arm_r3;
33 compat_ulong_t arm_r4;
34 compat_ulong_t arm_r5;
35 compat_ulong_t arm_r6;
36 compat_ulong_t arm_r7;
37 compat_ulong_t arm_r8;
38 compat_ulong_t arm_r9;
39 compat_ulong_t arm_r10;
40 compat_ulong_t arm_fp;
41 compat_ulong_t arm_ip;
42 compat_ulong_t arm_sp;
43 compat_ulong_t arm_lr;
44 compat_ulong_t arm_pc;
45 compat_ulong_t arm_cpsr;
46 compat_ulong_t fault_address;
47};
48
49struct compat_ucontext {
50 compat_ulong_t uc_flags;
51 compat_uptr_t uc_link;
52 compat_stack_t uc_stack;
53 struct compat_sigcontext uc_mcontext;
54 compat_sigset_t uc_sigmask;
55 int __unused[32 - (sizeof(compat_sigset_t) / sizeof(int))];
56 compat_ulong_t uc_regspace[128] __aligned(8);
57};
58
59struct compat_sigframe {
60 struct compat_ucontext uc;
61 compat_ulong_t retcode[2];
62};
63
64struct compat_rt_sigframe {
65 struct compat_siginfo info;
66 struct compat_sigframe sig;
67};
68
00554fa4 69int compat_setup_frame(int usig, struct ksignal *ksig, sigset_t *set,
3dd681d9 70 struct pt_regs *regs);
00554fa4
RW
71int compat_setup_rt_frame(int usig, struct ksignal *ksig, sigset_t *set,
72 struct pt_regs *regs);
3dd681d9
WD
73
74void compat_setup_restart_syscall(struct pt_regs *regs);
75#else
76
00554fa4 77static inline int compat_setup_frame(int usid, struct ksignal *ksig,
3dd681d9
WD
78 sigset_t *set, struct pt_regs *regs)
79{
80 return -ENOSYS;
81}
82
00554fa4 83static inline int compat_setup_rt_frame(int usig, struct ksignal *ksig, sigset_t *set,
3dd681d9
WD
84 struct pt_regs *regs)
85{
86 return -ENOSYS;
87}
88
89static inline void compat_setup_restart_syscall(struct pt_regs *regs)
90{
91}
92#endif /* CONFIG_COMPAT */
93#endif /* __KERNEL__ */
94#endif /* __ASM_SIGNAL32_H */