From fa3b8ecff44cbb29be3850d63caa09e57cf62b56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gl=C3=B6ckner?= Date: Wed, 4 Mar 2009 19:42:27 +0100 Subject: [PATCH] --- yaml --- r: 132111 b: refs/heads/master c: ab9e18587f4cdb5f3fb3854c732f27a36f98e8f6 h: refs/heads/master i: 132109: c6b5efb303a11f11c6c63e911e389efef2b58bd7 132107: 210df80bbb71fca12d11f913129503841829c299 132103: c3302f85a223afd1185da9142c739971d2a59b6f 132095: 6a108b32c4d4a626d199403b5e12ab8b5b11f7a2 v: v3 --- [refs] | 2 +- trunk/arch/x86/include/asm/i387.h | 8 +++++++- trunk/arch/x86/kernel/i387.c | 2 +- trunk/arch/x86/math-emu/fpu_aux.c | 31 ++++++++++++++++++++----------- 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/[refs] b/[refs] index baff8caa54ff..5622f1b536ac 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: dd39ecf522ba86c70809715af46e6557f6491131 +refs/heads/master: ab9e18587f4cdb5f3fb3854c732f27a36f98e8f6 diff --git a/trunk/arch/x86/include/asm/i387.h b/trunk/arch/x86/include/asm/i387.h index 48f0004db8c9..71c9e5183982 100644 --- a/trunk/arch/x86/include/asm/i387.h +++ b/trunk/arch/x86/include/asm/i387.h @@ -172,7 +172,13 @@ static inline void __save_init_fpu(struct task_struct *tsk) #else /* CONFIG_X86_32 */ -extern void finit(void); +#ifdef CONFIG_MATH_EMULATION +extern void finit_task(struct task_struct *tsk); +#else +static inline void finit_task(struct task_struct *tsk) +{ +} +#endif static inline void tolerant_fwait(void) { diff --git a/trunk/arch/x86/kernel/i387.c b/trunk/arch/x86/kernel/i387.c index b0f61f0dcd0a..f2f8540a7f3d 100644 --- a/trunk/arch/x86/kernel/i387.c +++ b/trunk/arch/x86/kernel/i387.c @@ -136,7 +136,7 @@ int init_fpu(struct task_struct *tsk) #ifdef CONFIG_X86_32 if (!HAVE_HWFP) { memset(tsk->thread.xstate, 0, xstate_size); - finit(); + finit_task(tsk); set_stopped_child_used_math(tsk); return 0; } diff --git a/trunk/arch/x86/math-emu/fpu_aux.c b/trunk/arch/x86/math-emu/fpu_aux.c index 491e737ce547..aa0987088774 100644 --- a/trunk/arch/x86/math-emu/fpu_aux.c +++ b/trunk/arch/x86/math-emu/fpu_aux.c @@ -30,20 +30,29 @@ static void fclex(void) } /* Needs to be externally visible */ -void finit(void) +void finit_task(struct task_struct *tsk) { - control_word = 0x037f; - partial_status = 0; - top = 0; /* We don't keep top in the status word internally. */ - fpu_tag_word = 0xffff; + struct i387_soft_struct *soft = &tsk->thread.xstate->soft; + struct address *oaddr, *iaddr; + soft->cwd = 0x037f; + soft->swd = 0; + soft->ftop = 0; /* We don't keep top in the status word internally. */ + soft->twd = 0xffff; /* The behaviour is different from that detailed in Section 15.1.6 of the Intel manual */ - operand_address.offset = 0; - operand_address.selector = 0; - instruction_address.offset = 0; - instruction_address.selector = 0; - instruction_address.opcode = 0; - no_ip_update = 1; + oaddr = (struct address *)&soft->foo; + oaddr->offset = 0; + oaddr->selector = 0; + iaddr = (struct address *)&soft->fip; + iaddr->offset = 0; + iaddr->selector = 0; + iaddr->opcode = 0; + soft->no_update = 1; +} + +void finit(void) +{ + finit_task(current); } /*