Thomas Gleixner | caab277 | 2019-06-03 07:44:50 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Will Deacon | 3dd681d | 2012-03-05 11:49:32 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2012 ARM Ltd. |
Will Deacon | 3dd681d | 2012-03-05 11:49:32 +0000 | [diff] [blame] | 4 | */ |
| 5 | #ifndef __ASM_SIGNAL32_H |
| 6 | #define __ASM_SIGNAL32_H |
| 7 | |
Will Deacon | 3dd681d | 2012-03-05 11:49:32 +0000 | [diff] [blame] | 8 | #ifdef CONFIG_COMPAT |
| 9 | #include <linux/compat.h> |
| 10 | |
Vincenzo Frascino | 206c0df | 2019-06-21 10:52:34 +0100 | [diff] [blame] | 11 | struct compat_sigcontext { |
| 12 | /* We always set these two fields to 0 */ |
| 13 | compat_ulong_t trap_no; |
| 14 | compat_ulong_t error_code; |
| 15 | |
| 16 | compat_ulong_t oldmask; |
| 17 | compat_ulong_t arm_r0; |
| 18 | compat_ulong_t arm_r1; |
| 19 | compat_ulong_t arm_r2; |
| 20 | compat_ulong_t arm_r3; |
| 21 | compat_ulong_t arm_r4; |
| 22 | compat_ulong_t arm_r5; |
| 23 | compat_ulong_t arm_r6; |
| 24 | compat_ulong_t arm_r7; |
| 25 | compat_ulong_t arm_r8; |
| 26 | compat_ulong_t arm_r9; |
| 27 | compat_ulong_t arm_r10; |
| 28 | compat_ulong_t arm_fp; |
| 29 | compat_ulong_t arm_ip; |
| 30 | compat_ulong_t arm_sp; |
| 31 | compat_ulong_t arm_lr; |
| 32 | compat_ulong_t arm_pc; |
| 33 | compat_ulong_t arm_cpsr; |
| 34 | compat_ulong_t fault_address; |
| 35 | }; |
| 36 | |
| 37 | struct compat_ucontext { |
| 38 | compat_ulong_t uc_flags; |
| 39 | compat_uptr_t uc_link; |
| 40 | compat_stack_t uc_stack; |
| 41 | struct compat_sigcontext uc_mcontext; |
| 42 | compat_sigset_t uc_sigmask; |
| 43 | int __unused[32 - (sizeof(compat_sigset_t) / sizeof(int))]; |
| 44 | compat_ulong_t uc_regspace[128] __attribute__((__aligned__(8))); |
| 45 | }; |
| 46 | |
| 47 | struct compat_sigframe { |
| 48 | struct compat_ucontext uc; |
| 49 | compat_ulong_t retcode[2]; |
| 50 | }; |
| 51 | |
| 52 | struct compat_rt_sigframe { |
| 53 | struct compat_siginfo info; |
| 54 | struct compat_sigframe sig; |
| 55 | }; |
| 56 | |
Richard Weinberger | 00554fa | 2013-10-06 22:52:44 +0200 | [diff] [blame] | 57 | int compat_setup_frame(int usig, struct ksignal *ksig, sigset_t *set, |
Will Deacon | 3dd681d | 2012-03-05 11:49:32 +0000 | [diff] [blame] | 58 | struct pt_regs *regs); |
Richard Weinberger | 00554fa | 2013-10-06 22:52:44 +0200 | [diff] [blame] | 59 | int compat_setup_rt_frame(int usig, struct ksignal *ksig, sigset_t *set, |
| 60 | struct pt_regs *regs); |
Will Deacon | 3dd681d | 2012-03-05 11:49:32 +0000 | [diff] [blame] | 61 | |
| 62 | void compat_setup_restart_syscall(struct pt_regs *regs); |
| 63 | #else |
| 64 | |
Richard Weinberger | 00554fa | 2013-10-06 22:52:44 +0200 | [diff] [blame] | 65 | static inline int compat_setup_frame(int usid, struct ksignal *ksig, |
Will Deacon | 3dd681d | 2012-03-05 11:49:32 +0000 | [diff] [blame] | 66 | sigset_t *set, struct pt_regs *regs) |
| 67 | { |
| 68 | return -ENOSYS; |
| 69 | } |
| 70 | |
Richard Weinberger | 00554fa | 2013-10-06 22:52:44 +0200 | [diff] [blame] | 71 | static inline int compat_setup_rt_frame(int usig, struct ksignal *ksig, sigset_t *set, |
Will Deacon | 3dd681d | 2012-03-05 11:49:32 +0000 | [diff] [blame] | 72 | struct pt_regs *regs) |
| 73 | { |
| 74 | return -ENOSYS; |
| 75 | } |
| 76 | |
| 77 | static inline void compat_setup_restart_syscall(struct pt_regs *regs) |
| 78 | { |
| 79 | } |
| 80 | #endif /* CONFIG_COMPAT */ |
Will Deacon | 3dd681d | 2012-03-05 11:49:32 +0000 | [diff] [blame] | 81 | #endif /* __ASM_SIGNAL32_H */ |