aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-02-08 15:09:59 -0500
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:40:46 -0400
commit1a1768039c8fdd48d69a6bc3b7f56943b2b20567 (patch)
tree8b32335faa6192d420851bc9050d6d2360b6611a /arch
parentac66f3fd89ee20b73b3374e6343c5e36e3e3c51a (diff)
x86: Use FIX_EFLAGS define in X86_64
[ tglx@linutronix.de: simplified ] Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Cc: Roland McGrath <roland@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/signal_32.c16
-rw-r--r--arch/x86/kernel/signal_64.c14
2 files changed, 24 insertions, 6 deletions
diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c
index 182269b752da..9eb23fb66b1e 100644
--- a/arch/x86/kernel/signal_32.c
+++ b/arch/x86/kernel/signal_32.c
@@ -30,6 +30,17 @@
30 30
31#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 31#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
32 32
33#define __FIX_EFLAGS (X86_EFLAGS_AC | X86_EFLAGS_OF | \
34 X86_EFLAGS_DF | X86_EFLAGS_TF | X86_EFLAGS_SF | \
35 X86_EFLAGS_ZF | X86_EFLAGS_AF | X86_EFLAGS_PF | \
36 X86_EFLAGS_CF)
37
38#ifdef CONFIG_X86_32
39# define FIX_EFLAGS (__FIX_EFLAGS | X86_EFLAGS_RF)
40#else
41# define FIX_EFLAGS __FIX_EFLAGS
42#endif
43
33/* 44/*
34 * Atomically swap in the new signal mask, and wait for a signal. 45 * Atomically swap in the new signal mask, and wait for a signal.
35 */ 46 */
@@ -122,11 +133,6 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *peax
122 err |= __get_user(tmp, &sc->seg); \ 133 err |= __get_user(tmp, &sc->seg); \
123 loadsegment(seg,tmp); } 134 loadsegment(seg,tmp); }
124 135
125#define FIX_EFLAGS (X86_EFLAGS_AC | X86_EFLAGS_RF | \
126 X86_EFLAGS_OF | X86_EFLAGS_DF | \
127 X86_EFLAGS_TF | X86_EFLAGS_SF | X86_EFLAGS_ZF | \
128 X86_EFLAGS_AF | X86_EFLAGS_PF | X86_EFLAGS_CF)
129
130 GET_SEG(gs); 136 GET_SEG(gs);
131 COPY_SEG(fs); 137 COPY_SEG(fs);
132 COPY_SEG(es); 138 COPY_SEG(es);
diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c
index 863cebe8e60a..b7d7a6d5c26b 100644
--- a/arch/x86/kernel/signal_64.c
+++ b/arch/x86/kernel/signal_64.c
@@ -19,6 +19,7 @@
19#include <linux/stddef.h> 19#include <linux/stddef.h>
20#include <linux/personality.h> 20#include <linux/personality.h>
21#include <linux/compiler.h> 21#include <linux/compiler.h>
22#include <asm/processor.h>
22#include <asm/ucontext.h> 23#include <asm/ucontext.h>
23#include <asm/uaccess.h> 24#include <asm/uaccess.h>
24#include <asm/i387.h> 25#include <asm/i387.h>
@@ -30,6 +31,17 @@
30 31
31#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 32#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
32 33
34#define __FIX_EFLAGS (X86_EFLAGS_AC | X86_EFLAGS_OF | \
35 X86_EFLAGS_DF | X86_EFLAGS_TF | X86_EFLAGS_SF | \
36 X86_EFLAGS_ZF | X86_EFLAGS_AF | X86_EFLAGS_PF | \
37 X86_EFLAGS_CF)
38
39#ifdef CONFIG_X86_32
40# define FIX_EFLAGS (__FIX_EFLAGS | X86_EFLAGS_RF)
41#else
42# define FIX_EFLAGS __FIX_EFLAGS
43#endif
44
33int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, 45int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
34 sigset_t *set, struct pt_regs * regs); 46 sigset_t *set, struct pt_regs * regs);
35int ia32_setup_frame(int sig, struct k_sigaction *ka, 47int ia32_setup_frame(int sig, struct k_sigaction *ka,
@@ -87,7 +99,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, unsigned
87 { 99 {
88 unsigned int tmpflags; 100 unsigned int tmpflags;
89 err |= __get_user(tmpflags, &sc->flags); 101 err |= __get_user(tmpflags, &sc->flags);
90 regs->flags = (regs->flags & ~0x40DD5) | (tmpflags & 0x40DD5); 102 regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS);
91 regs->orig_ax = -1; /* disable syscall checks */ 103 regs->orig_ax = -1; /* disable syscall checks */
92 } 104 }
93 105