diff options
Diffstat (limited to 'arch/x86/math-emu/fpu_emu.h')
-rw-r--r-- | arch/x86/math-emu/fpu_emu.h | 67 |
1 files changed, 33 insertions, 34 deletions
diff --git a/arch/x86/math-emu/fpu_emu.h b/arch/x86/math-emu/fpu_emu.h index 65120f52385..4dae511c85a 100644 --- a/arch/x86/math-emu/fpu_emu.h +++ b/arch/x86/math-emu/fpu_emu.h @@ -7,7 +7,6 @@ | | +---------------------------------------------------------------------------*/ - #ifndef _FPU_EMU_H_ #define _FPU_EMU_H_ @@ -28,15 +27,15 @@ #endif #define EXP_BIAS Const(0) -#define EXP_OVER Const(0x4000) /* smallest invalid large exponent */ -#define EXP_UNDER Const(-0x3fff) /* largest invalid small exponent */ -#define EXP_WAY_UNDER Const(-0x6000) /* Below the smallest denormal, but - still a 16 bit nr. */ +#define EXP_OVER Const(0x4000) /* smallest invalid large exponent */ +#define EXP_UNDER Const(-0x3fff) /* largest invalid small exponent */ +#define EXP_WAY_UNDER Const(-0x6000) /* Below the smallest denormal, but + still a 16 bit nr. */ #define EXP_Infinity EXP_OVER #define EXP_NaN EXP_OVER #define EXTENDED_Ebias Const(0x3fff) -#define EXTENDED_Emin (-0x3ffe) /* smallest valid exponent */ +#define EXTENDED_Emin (-0x3ffe) /* smallest valid exponent */ #define SIGN_POS Const(0) #define SIGN_NEG Const(0x80) @@ -44,10 +43,9 @@ #define SIGN_Positive Const(0) #define SIGN_Negative Const(0x8000) - /* Keep the order TAG_Valid, TAG_Zero, TW_Denormal */ /* The following fold to 2 (Special) in the Tag Word */ -#define TW_Denormal Const(4) /* De-normal */ +#define TW_Denormal Const(4) /* De-normal */ #define TW_Infinity Const(5) /* + or - infinity */ #define TW_NaN Const(6) /* Not a Number */ #define TW_Unsupported Const(7) /* Not supported by an 80486 */ @@ -67,14 +65,13 @@ #define DEST_RM 0x20 #define LOADED 0x40 -#define FPU_Exception Const(0x80000000) /* Added to tag returns. */ - +#define FPU_Exception Const(0x80000000) /* Added to tag returns. */ #ifndef __ASSEMBLY__ #include "fpu_system.h" -#include <asm/sigcontext.h> /* for struct _fpstate */ +#include <asm/sigcontext.h> /* for struct _fpstate */ #include <asm/math_emu.h> #include <linux/linkage.h> @@ -112,30 +109,33 @@ extern u_char emulating; #define PREFIX_DEFAULT 7 struct address { - unsigned int offset; - unsigned int selector:16; - unsigned int opcode:11; - unsigned int empty:5; + unsigned int offset; + unsigned int selector:16; + unsigned int opcode:11; + unsigned int empty:5; }; struct fpu__reg { - unsigned sigl; - unsigned sigh; - short exp; + unsigned sigl; + unsigned sigh; + short exp; }; -typedef void (*FUNC)(void); +typedef void (*FUNC) (void); typedef struct fpu__reg FPU_REG; -typedef void (*FUNC_ST0)(FPU_REG *st0_ptr, u_char st0_tag); -typedef struct { u_char address_size, operand_size, segment; } - overrides; +typedef void (*FUNC_ST0) (FPU_REG *st0_ptr, u_char st0_tag); +typedef struct { + u_char address_size, operand_size, segment; +} overrides; /* This structure is 32 bits: */ -typedef struct { overrides override; - u_char default_mode; } fpu_addr_modes; +typedef struct { + overrides override; + u_char default_mode; +} fpu_addr_modes; /* PROTECTED has a restricted meaning in the emulator; it is used to signal that the emulator needs to do special things to ensure that protection is respected in a segmented model. */ #define PROTECTED 4 -#define SIXTEEN 1 /* We rely upon this being 1 (true) */ +#define SIXTEEN 1 /* We rely upon this being 1 (true) */ #define VM86 SIXTEEN #define PM16 (SIXTEEN | PROTECTED) #define SEG32 PROTECTED @@ -168,8 +168,8 @@ extern u_char const data_sizes_16[32]; static inline void reg_copy(FPU_REG const *x, FPU_REG *y) { - *(short *)&(y->exp) = *(const short *)&(x->exp); - *(long long *)&(y->sigl) = *(const long long *)&(x->sigl); + *(short *)&(y->exp) = *(const short *)&(x->exp); + *(long long *)&(y->sigl) = *(const long long *)&(x->sigl); } #define exponent(x) (((*(short *)&((x)->exp)) & 0x7fff) - EXTENDED_Ebias) @@ -184,27 +184,26 @@ static inline void reg_copy(FPU_REG const *x, FPU_REG *y) #define significand(x) ( ((unsigned long long *)&((x)->sigl))[0] ) - /*----- Prototypes for functions written in assembler -----*/ /* extern void reg_move(FPU_REG *a, FPU_REG *b); */ asmlinkage int FPU_normalize(FPU_REG *x); asmlinkage int FPU_normalize_nuo(FPU_REG *x); asmlinkage int FPU_u_sub(FPU_REG const *arg1, FPU_REG const *arg2, - FPU_REG *answ, unsigned int control_w, u_char sign, + FPU_REG * answ, unsigned int control_w, u_char sign, int expa, int expb); asmlinkage int FPU_u_mul(FPU_REG const *arg1, FPU_REG const *arg2, - FPU_REG *answ, unsigned int control_w, u_char sign, + FPU_REG * answ, unsigned int control_w, u_char sign, int expon); asmlinkage int FPU_u_div(FPU_REG const *arg1, FPU_REG const *arg2, - FPU_REG *answ, unsigned int control_w, u_char sign); + FPU_REG * answ, unsigned int control_w, u_char sign); asmlinkage int FPU_u_add(FPU_REG const *arg1, FPU_REG const *arg2, - FPU_REG *answ, unsigned int control_w, u_char sign, + FPU_REG * answ, unsigned int control_w, u_char sign, int expa, int expb); asmlinkage int wm_sqrt(FPU_REG *n, int dummy1, int dummy2, unsigned int control_w, u_char sign); -asmlinkage unsigned FPU_shrx(void *l, unsigned x); -asmlinkage unsigned FPU_shrxs(void *v, unsigned x); +asmlinkage unsigned FPU_shrx(void *l, unsigned x); +asmlinkage unsigned FPU_shrxs(void *v, unsigned x); asmlinkage unsigned long FPU_div_small(unsigned long long *x, unsigned long y); asmlinkage int FPU_round(FPU_REG *arg, unsigned int extent, int dummy, unsigned int control_w, u_char sign); |