Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae6af41f authored by Tejun Heo's avatar Tejun Heo Committed by Ingo Molnar
Browse files

x86: math_emu info cleanup



Impact: cleanup

* Come on, struct info?  s/struct info/struct math_emu_info/

* Use struct pt_regs and kernel_vm86_regs instead of defining its own
  register frame structure.

Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 914c3d63
Loading
Loading
Loading
Loading
+8 −21
Original line number Diff line number Diff line
#ifndef _ASM_X86_MATH_EMU_H
#define _ASM_X86_MATH_EMU_H

#include <asm/ptrace.h>
#include <asm/vm86.h>

/* This structure matches the layout of the data saved to the stack
   following a device-not-present interrupt, part of it saved
   automatically by the 80386/80486.
   */
struct info {
struct math_emu_info {
	long ___orig_eip;
	long ___ebx;
	long ___ecx;
	long ___edx;
	long ___esi;
	long ___edi;
	long ___ebp;
	long ___eax;
	long ___ds;
	long ___es;
	long ___fs;
	long ___orig_eax;
	long ___eip;
	long ___cs;
	long ___eflags;
	long ___esp;
	long ___ss;
	long ___vm86_es; /* This and the following only in vm86 mode */
	long ___vm86_ds;
	long ___vm86_fs;
	long ___vm86_gs;
	union {
		struct pt_regs regs;
		struct kernel_vm86_regs vm86;
	};
};
#endif /* _ASM_X86_MATH_EMU_H */
+1 −1
Original line number Diff line number Diff line
@@ -353,7 +353,7 @@ struct i387_soft_struct {
	u8			no_update;
	u8			rm;
	u8			alimit;
	struct info		*info;
	struct math_emu_info	*info;
	u32			entry_eip;
};

+1 −1
Original line number Diff line number Diff line
@@ -659,7 +659,7 @@ static int valid_prefix(u_char *Byte, u_char __user **fpu_eip,
	}
}

void math_abort(struct info *info, unsigned int signal)
void math_abort(struct math_emu_info *info, unsigned int signal)
{
	FPU_EIP = FPU_ORIG_EIP;
	current->thread.trap_no = 16;
+1 −1
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ extern void fst_i_(void);
extern void fstp_i(void);
/* fpu_entry.c */
asmlinkage extern void math_emulate(long arg);
extern void math_abort(struct info *info, unsigned int signal);
extern void math_abort(struct math_emu_info *info, unsigned int signal);
/* fpu_etc.c */
extern void FPU_etc(void);
/* fpu_tags.c */
+7 −7
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@

/* This sets the pointer FPU_info to point to the argument part
   of the stack frame of math_emulate() */
#define SETUP_DATA_AREA(arg)	FPU_info = (struct info *) &arg
#define SETUP_DATA_AREA(arg)	FPU_info = (struct math_emu_info *) &arg

/* s is always from a cpu register, and the cpu does bounds checking
 * during register load --> no further bounds checks needed */
@@ -38,12 +38,12 @@
#define I387			(current->thread.xstate)
#define FPU_info		(I387->soft.info)

#define FPU_CS			(*(unsigned short *) &(FPU_info->___cs))
#define FPU_SS			(*(unsigned short *) &(FPU_info->___ss))
#define FPU_DS			(*(unsigned short *) &(FPU_info->___ds))
#define FPU_EAX			(FPU_info->___eax)
#define FPU_EFLAGS		(FPU_info->___eflags)
#define FPU_EIP			(FPU_info->___eip)
#define FPU_CS			(*(unsigned short *) &(FPU_info->regs.cs))
#define FPU_SS			(*(unsigned short *) &(FPU_info->regs.ss))
#define FPU_DS			(*(unsigned short *) &(FPU_info->regs.ds))
#define FPU_EAX			(FPU_info->regs.ax)
#define FPU_EFLAGS		(FPU_info->regs.flags)
#define FPU_EIP			(FPU_info->regs.ip)
#define FPU_ORIG_EIP		(FPU_info->___orig_eip)

#define FPU_lookahead           (I387->soft.lookahead)
Loading