Commit f28f0c23576662fb293defe9b1884d5a6e1bd85c
1 parent
ea499fec48
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
x86: Move some signal-handling definitions to a common header
There are some definitions which are duplicated between kernel/signal.c and ia32/ia32_signal.c; move them to a common header file. Rather than adding stuff to existing header files which contain data structures, create a new header file; hence the slightly odd name ("all the good ones were taken.") Note: nothing relied on signal_fault() being defined in <asm/ptrace.h>. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Showing 4 changed files with 22 additions and 20 deletions Side-by-side Diff
arch/x86/ia32/ia32_signal.c
... | ... | @@ -12,10 +12,8 @@ |
12 | 12 | #include <linux/mm.h> |
13 | 13 | #include <linux/smp.h> |
14 | 14 | #include <linux/kernel.h> |
15 | -#include <linux/signal.h> | |
16 | 15 | #include <linux/errno.h> |
17 | 16 | #include <linux/wait.h> |
18 | -#include <linux/ptrace.h> | |
19 | 17 | #include <linux/unistd.h> |
20 | 18 | #include <linux/stddef.h> |
21 | 19 | #include <linux/personality.h> |
22 | 20 | |
... | ... | @@ -31,16 +29,10 @@ |
31 | 29 | #include <asm/proto.h> |
32 | 30 | #include <asm/vdso.h> |
33 | 31 | #include <asm/sigframe.h> |
32 | +#include <asm/sighandling.h> | |
34 | 33 | #include <asm/sys_ia32.h> |
35 | 34 | |
36 | -#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | |
37 | - | |
38 | -#define FIX_EFLAGS (X86_EFLAGS_AC | X86_EFLAGS_OF | \ | |
39 | - X86_EFLAGS_DF | X86_EFLAGS_TF | X86_EFLAGS_SF | \ | |
40 | - X86_EFLAGS_ZF | X86_EFLAGS_AF | X86_EFLAGS_PF | \ | |
41 | - X86_EFLAGS_CF) | |
42 | - | |
43 | -void signal_fault(struct pt_regs *regs, void __user *frame, char *where); | |
35 | +#define FIX_EFLAGS __FIX_EFLAGS | |
44 | 36 | |
45 | 37 | int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) |
46 | 38 | { |
arch/x86/include/asm/ptrace.h
... | ... | @@ -145,7 +145,6 @@ |
145 | 145 | convert_ip_to_linear(struct task_struct *child, struct pt_regs *regs); |
146 | 146 | extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, |
147 | 147 | int error_code, int si_code); |
148 | -void signal_fault(struct pt_regs *regs, void __user *frame, char *where); | |
149 | 148 | |
150 | 149 | extern long syscall_trace_enter(struct pt_regs *); |
151 | 150 | extern void syscall_trace_leave(struct pt_regs *); |
arch/x86/include/asm/sighandling.h
1 | +#ifndef _ASM_X86_SIGHANDLING_H | |
2 | +#define _ASM_X86_SIGHANDLING_H | |
3 | + | |
4 | +#include <linux/compiler.h> | |
5 | +#include <linux/ptrace.h> | |
6 | +#include <linux/signal.h> | |
7 | + | |
8 | +#include <asm/processor-flags.h> | |
9 | + | |
10 | +#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | |
11 | + | |
12 | +#define __FIX_EFLAGS (X86_EFLAGS_AC | X86_EFLAGS_OF | \ | |
13 | + X86_EFLAGS_DF | X86_EFLAGS_TF | X86_EFLAGS_SF | \ | |
14 | + X86_EFLAGS_ZF | X86_EFLAGS_AF | X86_EFLAGS_PF | \ | |
15 | + X86_EFLAGS_CF) | |
16 | + | |
17 | +void signal_fault(struct pt_regs *regs, void __user *frame, char *where); | |
18 | + | |
19 | +#endif /* _ASM_X86_SIGHANDLING_H */ |
arch/x86/kernel/signal.c
... | ... | @@ -10,10 +10,8 @@ |
10 | 10 | #include <linux/mm.h> |
11 | 11 | #include <linux/smp.h> |
12 | 12 | #include <linux/kernel.h> |
13 | -#include <linux/signal.h> | |
14 | 13 | #include <linux/errno.h> |
15 | 14 | #include <linux/wait.h> |
16 | -#include <linux/ptrace.h> | |
17 | 15 | #include <linux/tracehook.h> |
18 | 16 | #include <linux/unistd.h> |
19 | 17 | #include <linux/stddef.h> |
... | ... | @@ -26,6 +24,7 @@ |
26 | 24 | #include <asm/i387.h> |
27 | 25 | #include <asm/vdso.h> |
28 | 26 | #include <asm/mce.h> |
27 | +#include <asm/sighandling.h> | |
29 | 28 | |
30 | 29 | #ifdef CONFIG_X86_64 |
31 | 30 | #include <asm/proto.h> |
... | ... | @@ -36,13 +35,6 @@ |
36 | 35 | #include <asm/syscalls.h> |
37 | 36 | |
38 | 37 | #include <asm/sigframe.h> |
39 | - | |
40 | -#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | |
41 | - | |
42 | -#define __FIX_EFLAGS (X86_EFLAGS_AC | X86_EFLAGS_OF | \ | |
43 | - X86_EFLAGS_DF | X86_EFLAGS_TF | X86_EFLAGS_SF | \ | |
44 | - X86_EFLAGS_ZF | X86_EFLAGS_AF | X86_EFLAGS_PF | \ | |
45 | - X86_EFLAGS_CF) | |
46 | 38 | |
47 | 39 | #ifdef CONFIG_X86_32 |
48 | 40 | # define FIX_EFLAGS (__FIX_EFLAGS | X86_EFLAGS_RF) |