summaryrefslogtreecommitdiffstats
path: root/include/linux/sched/signal.h
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2018-01-18 14:54:54 -0600
committerEric W. Biederman <ebiederm@xmission.com>2018-01-22 19:07:09 -0600
commitf8ec66014ffd95a783b1f9f3b62d7cadb96b78d5 (patch)
tree6e57bcf6bcd9e70ccc1b1cd89345299dc9105a33 /include/linux/sched/signal.h
parent3b10db2b06e2f6191aabb14babe28dcaa657a947 (diff)
downloadop-kernel-dev-f8ec66014ffd95a783b1f9f3b62d7cadb96b78d5.zip
op-kernel-dev-f8ec66014ffd95a783b1f9f3b62d7cadb96b78d5.tar.gz
signal: Add send_sig_fault and force_sig_fault
The vast majority of signals sent from architecture specific code are simple faults. Encapsulate this reality with two helper functions so that the nit-picky implementation of preparing a siginfo does not need to be repeated many times on each architecture. As only some architectures support the trapno field, make the trapno arguement only present on those architectures. Similary as ia64 has three fields: imm, flags, and isr that are specific to it. Have those arguments always present on ia64 and no where else. This ensures the architecture specific code always remembers which fields it needs to pass into the siginfo structure. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'include/linux/sched/signal.h')
-rw-r--r--include/linux/sched/signal.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h
index 0aa4548..375f31e 100644
--- a/include/linux/sched/signal.h
+++ b/include/linux/sched/signal.h
@@ -285,6 +285,26 @@ static inline void kernel_signal_stop(void)
schedule();
}
+#ifdef __ARCH_SI_TRAPNO
+# define ___ARCH_SI_TRAPNO(_a1) , _a1
+#else
+# define ___ARCH_SI_TRAPNO(_a1)
+#endif
+#ifdef __ia64__
+# define ___ARCH_SI_IA64(_a1, _a2, _a3) , _a1, _a2, _a3
+#else
+# define ___ARCH_SI_IA64(_a1, _a2, _a3)
+#endif
+
+int force_sig_fault(int sig, int code, void __user *addr
+ ___ARCH_SI_TRAPNO(int trapno)
+ ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)
+ , struct task_struct *t);
+int send_sig_fault(int sig, int code, void __user *addr
+ ___ARCH_SI_TRAPNO(int trapno)
+ ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)
+ , struct task_struct *t);
+
extern int send_sig_info(int, struct siginfo *, struct task_struct *);
extern int force_sigsegv(int, struct task_struct *);
extern int force_sig_info(int, struct siginfo *, struct task_struct *);
OpenPOWER on IntegriCloud