diff options
author | H. Peter Anvin <hpa@zytor.com> | 2012-02-19 10:38:43 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2012-02-20 15:52:04 -0500 |
commit | f28f0c23576662fb293defe9b1884d5a6e1bd85c (patch) | |
tree | c648cb81828ef0e904af839690ab308abc66ead7 | |
parent | ea499fec48dd771bd92984337fcb57ed4c787e69 (diff) |
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>
-rw-r--r-- | arch/x86/ia32/ia32_signal.c | 12 | ||||
-rw-r--r-- | arch/x86/include/asm/ptrace.h | 1 | ||||
-rw-r--r-- | arch/x86/include/asm/sighandling.h | 19 | ||||
-rw-r--r-- | arch/x86/kernel/signal.c | 10 |
4 files changed, 22 insertions, 20 deletions
diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c index 65577698cab2..25d80f3faf2e 100644 --- a/arch/x86/ia32/ia32_signal.c +++ b/arch/x86/ia32/ia32_signal.c | |||
@@ -12,10 +12,8 @@ | |||
12 | #include <linux/mm.h> | 12 | #include <linux/mm.h> |
13 | #include <linux/smp.h> | 13 | #include <linux/smp.h> |
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/signal.h> | ||
16 | #include <linux/errno.h> | 15 | #include <linux/errno.h> |
17 | #include <linux/wait.h> | 16 | #include <linux/wait.h> |
18 | #include <linux/ptrace.h> | ||
19 | #include <linux/unistd.h> | 17 | #include <linux/unistd.h> |
20 | #include <linux/stddef.h> | 18 | #include <linux/stddef.h> |
21 | #include <linux/personality.h> | 19 | #include <linux/personality.h> |
@@ -31,16 +29,10 @@ | |||
31 | #include <asm/proto.h> | 29 | #include <asm/proto.h> |
32 | #include <asm/vdso.h> | 30 | #include <asm/vdso.h> |
33 | #include <asm/sigframe.h> | 31 | #include <asm/sigframe.h> |
32 | #include <asm/sighandling.h> | ||
34 | #include <asm/sys_ia32.h> | 33 | #include <asm/sys_ia32.h> |
35 | 34 | ||
36 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | 35 | #define FIX_EFLAGS __FIX_EFLAGS |
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); | ||
44 | 36 | ||
45 | int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) | 37 | int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) |
46 | { | 38 | { |
diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h index 35664547125b..dcfde52979c3 100644 --- a/arch/x86/include/asm/ptrace.h +++ b/arch/x86/include/asm/ptrace.h | |||
@@ -145,7 +145,6 @@ extern unsigned long | |||
145 | convert_ip_to_linear(struct task_struct *child, struct pt_regs *regs); | 145 | convert_ip_to_linear(struct task_struct *child, struct pt_regs *regs); |
146 | extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, | 146 | extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, |
147 | int error_code, int si_code); | 147 | int error_code, int si_code); |
148 | void signal_fault(struct pt_regs *regs, void __user *frame, char *where); | ||
149 | 148 | ||
150 | extern long syscall_trace_enter(struct pt_regs *); | 149 | extern long syscall_trace_enter(struct pt_regs *); |
151 | extern void syscall_trace_leave(struct pt_regs *); | 150 | extern void syscall_trace_leave(struct pt_regs *); |
diff --git a/arch/x86/include/asm/sighandling.h b/arch/x86/include/asm/sighandling.h new file mode 100644 index 000000000000..843e299e120e --- /dev/null +++ b/arch/x86/include/asm/sighandling.h | |||
@@ -0,0 +1,19 @@ | |||
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 */ | ||
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c index 46a01bdc27e2..c432dc0e65f0 100644 --- a/arch/x86/kernel/signal.c +++ b/arch/x86/kernel/signal.c | |||
@@ -10,10 +10,8 @@ | |||
10 | #include <linux/mm.h> | 10 | #include <linux/mm.h> |
11 | #include <linux/smp.h> | 11 | #include <linux/smp.h> |
12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
13 | #include <linux/signal.h> | ||
14 | #include <linux/errno.h> | 13 | #include <linux/errno.h> |
15 | #include <linux/wait.h> | 14 | #include <linux/wait.h> |
16 | #include <linux/ptrace.h> | ||
17 | #include <linux/tracehook.h> | 15 | #include <linux/tracehook.h> |
18 | #include <linux/unistd.h> | 16 | #include <linux/unistd.h> |
19 | #include <linux/stddef.h> | 17 | #include <linux/stddef.h> |
@@ -26,6 +24,7 @@ | |||
26 | #include <asm/i387.h> | 24 | #include <asm/i387.h> |
27 | #include <asm/vdso.h> | 25 | #include <asm/vdso.h> |
28 | #include <asm/mce.h> | 26 | #include <asm/mce.h> |
27 | #include <asm/sighandling.h> | ||
29 | 28 | ||
30 | #ifdef CONFIG_X86_64 | 29 | #ifdef CONFIG_X86_64 |
31 | #include <asm/proto.h> | 30 | #include <asm/proto.h> |
@@ -37,13 +36,6 @@ | |||
37 | 36 | ||
38 | #include <asm/sigframe.h> | 37 | #include <asm/sigframe.h> |
39 | 38 | ||
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 | |||
47 | #ifdef CONFIG_X86_32 | 39 | #ifdef CONFIG_X86_32 |
48 | # define FIX_EFLAGS (__FIX_EFLAGS | X86_EFLAGS_RF) | 40 | # define FIX_EFLAGS (__FIX_EFLAGS | X86_EFLAGS_RF) |
49 | #else | 41 | #else |