Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132111
b: refs/heads/master
c: ab9e185
h: refs/heads/master
i:
  132109: c6b5efb
  132107: 210df80
  132103: c3302f8
  132095: 6a108b3
v: v3
  • Loading branch information
Daniel Glöckner authored and Ingo Molnar committed Mar 4, 2009
1 parent badeb15 commit fa3b8ec
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dd39ecf522ba86c70809715af46e6557f6491131
refs/heads/master: ab9e18587f4cdb5f3fb3854c732f27a36f98e8f6
8 changes: 7 additions & 1 deletion trunk/arch/x86/include/asm/i387.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/i387.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
31 changes: 20 additions & 11 deletions trunk/arch/x86/math-emu/fpu_aux.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down

0 comments on commit fa3b8ec

Please sign in to comment.