Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
56177d2a
Commit
56177d2a
authored
Jun 17, 2004
by
Alexander Viro
Committed by
Linus Torvalds
Jun 17, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] sparse: i387 math-emu annotation
arch/i386/math-emu/* annotated.
parent
0fd81bef
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
195 additions
and
194 deletions
+195
-194
arch/i386/math-emu/errors.c
arch/i386/math-emu/errors.c
+5
-5
arch/i386/math-emu/fpu_arith.c
arch/i386/math-emu/fpu_arith.c
+18
-18
arch/i386/math-emu/fpu_aux.c
arch/i386/math-emu/fpu_aux.c
+10
-10
arch/i386/math-emu/fpu_entry.c
arch/i386/math-emu/fpu_entry.c
+17
-16
arch/i386/math-emu/fpu_etc.c
arch/i386/math-emu/fpu_etc.c
+1
-1
arch/i386/math-emu/fpu_proto.h
arch/i386/math-emu/fpu_proto.h
+21
-21
arch/i386/math-emu/fpu_system.h
arch/i386/math-emu/fpu_system.h
+1
-1
arch/i386/math-emu/get_address.c
arch/i386/math-emu/get_address.c
+15
-15
arch/i386/math-emu/load_store.c
arch/i386/math-emu/load_store.c
+26
-26
arch/i386/math-emu/reg_compare.c
arch/i386/math-emu/reg_compare.c
+6
-6
arch/i386/math-emu/reg_ld_str.c
arch/i386/math-emu/reg_ld_str.c
+75
-75
No files found.
arch/i386/math-emu/errors.c
View file @
56177d2a
...
@@ -41,18 +41,18 @@ void Un_impl(void)
...
@@ -41,18 +41,18 @@ void Un_impl(void)
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
/* No need to verify_area(), we have previously fetched these bytes. */
/* No need to verify_area(), we have previously fetched these bytes. */
printk
(
"Unimplemented FPU Opcode at eip=%p : "
,
(
void
*
)
address
);
printk
(
"Unimplemented FPU Opcode at eip=%p : "
,
(
void
__user
*
)
address
);
if
(
FPU_CS
==
__USER_CS
)
if
(
FPU_CS
==
__USER_CS
)
{
{
while
(
1
)
while
(
1
)
{
{
FPU_get_user
(
byte1
,
(
u_char
*
)
address
);
FPU_get_user
(
byte1
,
(
u_char
__user
*
)
address
);
if
(
(
byte1
&
0xf8
)
==
0xd8
)
break
;
if
(
(
byte1
&
0xf8
)
==
0xd8
)
break
;
printk
(
"[%02x]"
,
byte1
);
printk
(
"[%02x]"
,
byte1
);
address
++
;
address
++
;
}
}
printk
(
"%02x "
,
byte1
);
printk
(
"%02x "
,
byte1
);
FPU_get_user
(
FPU_modrm
,
1
+
(
u_char
*
)
address
);
FPU_get_user
(
FPU_modrm
,
1
+
(
u_char
__user
*
)
address
);
if
(
FPU_modrm
>=
0300
)
if
(
FPU_modrm
>=
0300
)
printk
(
"%02x (%02x+%d)
\n
"
,
FPU_modrm
,
FPU_modrm
&
0xf8
,
FPU_modrm
&
7
);
printk
(
"%02x (%02x+%d)
\n
"
,
FPU_modrm
,
FPU_modrm
&
0xf8
,
FPU_modrm
&
7
);
...
@@ -98,7 +98,7 @@ void FPU_printall(void)
...
@@ -98,7 +98,7 @@ void FPU_printall(void)
#define MAX_PRINTED_BYTES 20
#define MAX_PRINTED_BYTES 20
for
(
i
=
0
;
i
<
MAX_PRINTED_BYTES
;
i
++
)
for
(
i
=
0
;
i
<
MAX_PRINTED_BYTES
;
i
++
)
{
{
FPU_get_user
(
byte1
,
(
u_char
*
)
address
);
FPU_get_user
(
byte1
,
(
u_char
__user
*
)
address
);
if
(
(
byte1
&
0xf8
)
==
0xd8
)
if
(
(
byte1
&
0xf8
)
==
0xd8
)
{
{
printk
(
" %02x"
,
byte1
);
printk
(
" %02x"
,
byte1
);
...
@@ -111,7 +111,7 @@ void FPU_printall(void)
...
@@ -111,7 +111,7 @@ void FPU_printall(void)
printk
(
" [more..]
\n
"
);
printk
(
" [more..]
\n
"
);
else
else
{
{
FPU_get_user
(
FPU_modrm
,
1
+
(
u_char
*
)
address
);
FPU_get_user
(
FPU_modrm
,
1
+
(
u_char
__user
*
)
address
);
if
(
FPU_modrm
>=
0300
)
if
(
FPU_modrm
>=
0300
)
printk
(
" %02x (%02x+%d)
\n
"
,
FPU_modrm
,
FPU_modrm
&
0xf8
,
FPU_modrm
&
7
);
printk
(
" %02x (%02x+%d)
\n
"
,
FPU_modrm
,
FPU_modrm
&
0xf8
,
FPU_modrm
&
7
);
...
...
arch/i386/math-emu/fpu_arith.c
View file @
56177d2a
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
#include "status_w.h"
#include "status_w.h"
void
fadd__
()
void
fadd__
(
void
)
{
{
/* fadd st,st(i) */
/* fadd st,st(i) */
int
i
=
FPU_rm
;
int
i
=
FPU_rm
;
...
@@ -25,7 +25,7 @@ void fadd__()
...
@@ -25,7 +25,7 @@ void fadd__()
}
}
void
fmul__
()
void
fmul__
(
void
)
{
{
/* fmul st,st(i) */
/* fmul st,st(i) */
int
i
=
FPU_rm
;
int
i
=
FPU_rm
;
...
@@ -35,7 +35,7 @@ void fmul__()
...
@@ -35,7 +35,7 @@ void fmul__()
void
fsub__
()
void
fsub__
(
void
)
{
{
/* fsub st,st(i) */
/* fsub st,st(i) */
clear_C1
();
clear_C1
();
...
@@ -43,7 +43,7 @@ void fsub__()
...
@@ -43,7 +43,7 @@ void fsub__()
}
}
void
fsubr_
()
void
fsubr_
(
void
)
{
{
/* fsubr st,st(i) */
/* fsubr st,st(i) */
clear_C1
();
clear_C1
();
...
@@ -51,7 +51,7 @@ void fsubr_()
...
@@ -51,7 +51,7 @@ void fsubr_()
}
}
void
fdiv__
()
void
fdiv__
(
void
)
{
{
/* fdiv st,st(i) */
/* fdiv st,st(i) */
clear_C1
();
clear_C1
();
...
@@ -59,7 +59,7 @@ void fdiv__()
...
@@ -59,7 +59,7 @@ void fdiv__()
}
}
void
fdivr_
()
void
fdivr_
(
void
)
{
{
/* fdivr st,st(i) */
/* fdivr st,st(i) */
clear_C1
();
clear_C1
();
...
@@ -68,7 +68,7 @@ void fdivr_()
...
@@ -68,7 +68,7 @@ void fdivr_()
void
fadd_i
()
void
fadd_i
(
void
)
{
{
/* fadd st(i),st */
/* fadd st(i),st */
int
i
=
FPU_rm
;
int
i
=
FPU_rm
;
...
@@ -77,7 +77,7 @@ void fadd_i()
...
@@ -77,7 +77,7 @@ void fadd_i()
}
}
void
fmul_i
()
void
fmul_i
(
void
)
{
{
/* fmul st(i),st */
/* fmul st(i),st */
clear_C1
();
clear_C1
();
...
@@ -85,7 +85,7 @@ void fmul_i()
...
@@ -85,7 +85,7 @@ void fmul_i()
}
}
void
fsubri
()
void
fsubri
(
void
)
{
{
/* fsubr st(i),st */
/* fsubr st(i),st */
clear_C1
();
clear_C1
();
...
@@ -93,7 +93,7 @@ void fsubri()
...
@@ -93,7 +93,7 @@ void fsubri()
}
}
void
fsub_i
()
void
fsub_i
(
void
)
{
{
/* fsub st(i),st */
/* fsub st(i),st */
clear_C1
();
clear_C1
();
...
@@ -101,7 +101,7 @@ void fsub_i()
...
@@ -101,7 +101,7 @@ void fsub_i()
}
}
void
fdivri
()
void
fdivri
(
void
)
{
{
/* fdivr st(i),st */
/* fdivr st(i),st */
clear_C1
();
clear_C1
();
...
@@ -109,7 +109,7 @@ void fdivri()
...
@@ -109,7 +109,7 @@ void fdivri()
}
}
void
fdiv_i
()
void
fdiv_i
(
void
)
{
{
/* fdiv st(i),st */
/* fdiv st(i),st */
clear_C1
();
clear_C1
();
...
@@ -118,7 +118,7 @@ void fdiv_i()
...
@@ -118,7 +118,7 @@ void fdiv_i()
void
faddp_
()
void
faddp_
(
void
)
{
{
/* faddp st(i),st */
/* faddp st(i),st */
int
i
=
FPU_rm
;
int
i
=
FPU_rm
;
...
@@ -128,7 +128,7 @@ void faddp_()
...
@@ -128,7 +128,7 @@ void faddp_()
}
}
void
fmulp_
()
void
fmulp_
(
void
)
{
{
/* fmulp st(i),st */
/* fmulp st(i),st */
clear_C1
();
clear_C1
();
...
@@ -138,7 +138,7 @@ void fmulp_()
...
@@ -138,7 +138,7 @@ void fmulp_()
void
fsubrp
()
void
fsubrp
(
void
)
{
{
/* fsubrp st(i),st */
/* fsubrp st(i),st */
clear_C1
();
clear_C1
();
...
@@ -147,7 +147,7 @@ void fsubrp()
...
@@ -147,7 +147,7 @@ void fsubrp()
}
}
void
fsubp_
()
void
fsubp_
(
void
)
{
{
/* fsubp st(i),st */
/* fsubp st(i),st */
clear_C1
();
clear_C1
();
...
@@ -156,7 +156,7 @@ void fsubp_()
...
@@ -156,7 +156,7 @@ void fsubp_()
}
}
void
fdivrp
()
void
fdivrp
(
void
)
{
{
/* fdivrp st(i),st */
/* fdivrp st(i),st */
clear_C1
();
clear_C1
();
...
@@ -165,7 +165,7 @@ void fdivrp()
...
@@ -165,7 +165,7 @@ void fdivrp()
}
}
void
fdivp_
()
void
fdivp_
(
void
)
{
{
/* fdivp st(i),st */
/* fdivp st(i),st */
clear_C1
();
clear_C1
();
...
...
arch/i386/math-emu/fpu_aux.c
View file @
56177d2a
...
@@ -30,7 +30,7 @@ void fclex(void)
...
@@ -30,7 +30,7 @@ void fclex(void)
}
}
/* Needs to be externally visible */
/* Needs to be externally visible */
void
finit
()
void
finit
(
void
)
{
{
control_word
=
0x037f
;
control_word
=
0x037f
;
partial_status
=
0
;
partial_status
=
0
;
...
@@ -58,7 +58,7 @@ static FUNC const finit_table[] = {
...
@@ -58,7 +58,7 @@ static FUNC const finit_table[] = {
fsetpm
,
FPU_illegal
,
FPU_illegal
,
FPU_illegal
fsetpm
,
FPU_illegal
,
FPU_illegal
,
FPU_illegal
};
};
void
finit_
()
void
finit_
(
void
)
{
{
(
finit_table
[
FPU_rm
])();
(
finit_table
[
FPU_rm
])();
}
}
...
@@ -75,7 +75,7 @@ static FUNC const fstsw_table[] = {
...
@@ -75,7 +75,7 @@ static FUNC const fstsw_table[] = {
FPU_illegal
,
FPU_illegal
,
FPU_illegal
,
FPU_illegal
FPU_illegal
,
FPU_illegal
,
FPU_illegal
,
FPU_illegal
};
};
void
fstsw_
()
void
fstsw_
(
void
)
{
{
(
fstsw_table
[
FPU_rm
])();
(
fstsw_table
[
FPU_rm
])();
}
}
...
@@ -86,13 +86,13 @@ static FUNC const fp_nop_table[] = {
...
@@ -86,13 +86,13 @@ static FUNC const fp_nop_table[] = {
FPU_illegal
,
FPU_illegal
,
FPU_illegal
,
FPU_illegal
FPU_illegal
,
FPU_illegal
,
FPU_illegal
,
FPU_illegal
};
};
void
fp_nop
()
void
fp_nop
(
void
)
{
{
(
fp_nop_table
[
FPU_rm
])();
(
fp_nop_table
[
FPU_rm
])();
}
}
void
fld_i_
()
void
fld_i_
(
void
)
{
{
FPU_REG
*
st_new_ptr
;
FPU_REG
*
st_new_ptr
;
int
i
;
int
i
;
...
@@ -124,7 +124,7 @@ void fld_i_()
...
@@ -124,7 +124,7 @@ void fld_i_()
}
}
void
fxch_i
()
void
fxch_i
(
void
)
{
{
/* fxch st(i) */
/* fxch st(i) */
FPU_REG
t
;
FPU_REG
t
;
...
@@ -173,14 +173,14 @@ void fxch_i()
...
@@ -173,14 +173,14 @@ void fxch_i()
}
}
void
ffree_
()
void
ffree_
(
void
)
{
{
/* ffree st(i) */
/* ffree st(i) */
FPU_settagi
(
FPU_rm
,
TAG_Empty
);
FPU_settagi
(
FPU_rm
,
TAG_Empty
);
}
}
void
ffreep
()
void
ffreep
(
void
)
{
{
/* ffree st(i) + pop - unofficial code */
/* ffree st(i) + pop - unofficial code */
FPU_settagi
(
FPU_rm
,
TAG_Empty
);
FPU_settagi
(
FPU_rm
,
TAG_Empty
);
...
@@ -188,14 +188,14 @@ void ffreep()
...
@@ -188,14 +188,14 @@ void ffreep()
}
}
void
fst_i_
()
void
fst_i_
(
void
)
{
{
/* fst st(i) */
/* fst st(i) */
FPU_copy_to_regi
(
&
st
(
0
),
FPU_gettag0
(),
FPU_rm
);
FPU_copy_to_regi
(
&
st
(
0
),
FPU_gettag0
(),
FPU_rm
);
}
}
void
fstp_i
()
void
fstp_i
(
void
)
{
{
/* fstp st(i) */
/* fstp st(i) */
FPU_copy_to_regi
(
&
st
(
0
),
FPU_gettag0
(),
FPU_rm
);
FPU_copy_to_regi
(
&
st
(
0
),
FPU_gettag0
(),
FPU_rm
);
...
...
arch/i386/math-emu/fpu_entry.c
View file @
56177d2a
...
@@ -128,7 +128,7 @@ static u_char const type_table[64] = {
...
@@ -128,7 +128,7 @@ static u_char const type_table[64] = {
u_char
emulating
=
0
;
u_char
emulating
=
0
;
#endif
/* RE_ENTRANT_CHECKING */
#endif
/* RE_ENTRANT_CHECKING */
static
int
valid_prefix
(
u_char
*
Byte
,
u_char
**
fpu_eip
,
static
int
valid_prefix
(
u_char
*
Byte
,
u_char
__user
**
fpu_eip
,
overrides
*
override
);
overrides
*
override
);
asmlinkage
void
math_emulate
(
long
arg
)
asmlinkage
void
math_emulate
(
long
arg
)
...
@@ -140,7 +140,7 @@ asmlinkage void math_emulate(long arg)
...
@@ -140,7 +140,7 @@ asmlinkage void math_emulate(long arg)
FPU_REG
loaded_data
;
FPU_REG
loaded_data
;
FPU_REG
*
st0_ptr
;
FPU_REG
*
st0_ptr
;
u_char
loaded_tag
,
st0_tag
;
u_char
loaded_tag
,
st0_tag
;
void
*
data_address
;
void
__user
*
data_address
;
struct
address
data_sel_off
;
struct
address
data_sel_off
;
struct
address
entry_sel_off
;
struct
address
entry_sel_off
;
unsigned
long
code_base
=
0
;
unsigned
long
code_base
=
0
;
...
@@ -192,7 +192,8 @@ asmlinkage void math_emulate(long arg)
...
@@ -192,7 +192,8 @@ asmlinkage void math_emulate(long arg)
math_abort
(
FPU_info
,
SIGILL
);
math_abort
(
FPU_info
,
SIGILL
);
}
}
if
(
SEG_D_SIZE
(
code_descriptor
=
LDT_DESCRIPTOR
(
FPU_CS
))
)
code_descriptor
=
LDT_DESCRIPTOR
(
FPU_CS
);
if
(
SEG_D_SIZE
(
code_descriptor
)
)
{
{
/* The above test may be wrong, the book is not clear */
/* The above test may be wrong, the book is not clear */
/* Segmented 32 bit protected mode */
/* Segmented 32 bit protected mode */
...
@@ -214,7 +215,7 @@ asmlinkage void math_emulate(long arg)
...
@@ -214,7 +215,7 @@ asmlinkage void math_emulate(long arg)
if
(
current
->
ptrace
&
PT_PTRACED
)
if
(
current
->
ptrace
&
PT_PTRACED
)
FPU_lookahead
=
0
;
FPU_lookahead
=
0
;
if
(
!
valid_prefix
(
&
byte1
,
(
u_char
**
)
&
FPU_EIP
,
if
(
!
valid_prefix
(
&
byte1
,
(
u_char
__user
**
)
&
FPU_EIP
,
&
addr_modes
.
override
)
)
&
addr_modes
.
override
)
)
{
{
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
...
@@ -257,7 +258,7 @@ asmlinkage void math_emulate(long arg)
...
@@ -257,7 +258,7 @@ asmlinkage void math_emulate(long arg)
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_code_verify_area
(
1
);
FPU_code_verify_area
(
1
);
FPU_get_user
(
FPU_modrm
,
(
u_char
*
)
FPU_EIP
);
FPU_get_user
(
FPU_modrm
,
(
u_char
__user
*
)
FPU_EIP
);
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
FPU_EIP
++
;
FPU_EIP
++
;
...
@@ -336,23 +337,23 @@ asmlinkage void math_emulate(long arg)
...
@@ -336,23 +337,23 @@ asmlinkage void math_emulate(long arg)
switch
(
(
byte1
>>
1
)
&
3
)
switch
(
(
byte1
>>
1
)
&
3
)
{
{
case
0
:
case
0
:
unmasked
=
FPU_load_single
((
float
*
)
data_address
,
unmasked
=
FPU_load_single
((
float
__user
*
)
data_address
,
&
loaded_data
);
&
loaded_data
);
loaded_tag
=
unmasked
&
0xff
;
loaded_tag
=
unmasked
&
0xff
;
unmasked
&=
~
0xff
;
unmasked
&=
~
0xff
;
break
;
break
;
case
1
:
case
1
:
loaded_tag
=
FPU_load_int32
((
long
*
)
data_address
,
&
loaded_data
);
loaded_tag
=
FPU_load_int32
((
long
__user
*
)
data_address
,
&
loaded_data
);
break
;
break
;
case
2
:
case
2
:
unmasked
=
FPU_load_double
((
double
*
)
data_address
,
unmasked
=
FPU_load_double
((
double
__user
*
)
data_address
,
&
loaded_data
);
&
loaded_data
);
loaded_tag
=
unmasked
&
0xff
;
loaded_tag
=
unmasked
&
0xff
;
unmasked
&=
~
0xff
;
unmasked
&=
~
0xff
;
break
;
break
;
case
3
:
case
3
:
default:
/* Used here to suppress gcc warnings. */
default:
/* Used here to suppress gcc warnings. */
loaded_tag
=
FPU_load_int16
((
short
*
)
data_address
,
&
loaded_data
);
loaded_tag
=
FPU_load_int16
((
short
__user
*
)
data_address
,
&
loaded_data
);
break
;
break
;
}
}
...
@@ -563,7 +564,7 @@ asmlinkage void math_emulate(long arg)
...
@@ -563,7 +564,7 @@ asmlinkage void math_emulate(long arg)
if
(
FPU_lookahead
&&
!
need_resched
())
if
(
FPU_lookahead
&&
!
need_resched
())
{
{
FPU_ORIG_EIP
=
FPU_EIP
-
code_base
;
FPU_ORIG_EIP
=
FPU_EIP
-
code_base
;
if
(
valid_prefix
(
&
byte1
,
(
u_char
**
)
&
FPU_EIP
,
if
(
valid_prefix
(
&
byte1
,
(
u_char
__user
**
)
&
FPU_EIP
,
&
addr_modes
.
override
)
)
&
addr_modes
.
override
)
)
goto
do_another_FPU_instruction
;
goto
do_another_FPU_instruction
;
}
}
...
@@ -579,11 +580,11 @@ asmlinkage void math_emulate(long arg)
...
@@ -579,11 +580,11 @@ asmlinkage void math_emulate(long arg)
all prefix bytes, further changes are needed in the emulator code
all prefix bytes, further changes are needed in the emulator code
which accesses user address space. Access to separate segments is
which accesses user address space. Access to separate segments is
important for msdos emulation. */
important for msdos emulation. */
static
int
valid_prefix
(
u_char
*
Byte
,
u_char
**
fpu_eip
,
static
int
valid_prefix
(
u_char
*
Byte
,
u_char
__user
**
fpu_eip
,
overrides
*
override
)
overrides
*
override
)
{
{
u_char
byte
;
u_char
byte
;
u_char
*
ip
=
*
fpu_eip
;
u_char
__user
*
ip
=
*
fpu_eip
;
*
override
=
(
overrides
)
{
0
,
0
,
PREFIX_DEFAULT
};
/* defaults */
*
override
=
(
overrides
)
{
0
,
0
,
PREFIX_DEFAULT
};
/* defaults */
...
@@ -679,9 +680,9 @@ void math_abort(struct info * info, unsigned int signal)
...
@@ -679,9 +680,9 @@ void math_abort(struct info * info, unsigned int signal)
#define sstatus_word() \
#define sstatus_word() \
((S387->swd & ~SW_Top & 0xffff) | ((S387->ftop << SW_Top_Shift) & SW_Top))
((S387->swd & ~SW_Top & 0xffff) | ((S387->ftop << SW_Top_Shift) & SW_Top))
int
restore_i387_soft
(
void
*
s387
,
struct
_fpstate
*
buf
)
int
restore_i387_soft
(
void
*
s387
,
struct
_fpstate
__user
*
buf
)
{
{
u_char
*
d
=
(
u_cha
r
*
)
buf
;
u_char
__user
*
d
=
(
u_char
__use
r
*
)
buf
;
int
offset
,
other
,
i
,
tags
,
regnr
,
tag
,
newtop
;
int
offset
,
other
,
i
,
tags
,
regnr
,
tag
,
newtop
;
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
...
@@ -725,9 +726,9 @@ int restore_i387_soft(void *s387, struct _fpstate *buf)
...
@@ -725,9 +726,9 @@ int restore_i387_soft(void *s387, struct _fpstate *buf)
}
}
int
save_i387_soft
(
void
*
s387
,
struct
_fpstate
*
buf
)
int
save_i387_soft
(
void
*
s387
,
struct
_fpstate
__user
*
buf
)
{
{
u_char
*
d
=
(
u_cha
r
*
)
buf
;
u_char
__user
*
d
=
(
u_char
__use
r
*
)
buf
;
int
offset
=
(
S387
->
ftop
&
7
)
*
10
,
other
=
80
-
offset
;
int
offset
=
(
S387
->
ftop
&
7
)
*
10
,
other
=
80
-
offset
;
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
...
...
arch/i386/math-emu/fpu_etc.c
View file @
56177d2a
...
@@ -137,7 +137,7 @@ static FUNC_ST0 const fp_etc_table[] = {
...
@@ -137,7 +137,7 @@ static FUNC_ST0 const fp_etc_table[] = {
ftst_
,
fxam
,
(
FUNC_ST0
)
FPU_illegal
,
(
FUNC_ST0
)
FPU_illegal
ftst_
,
fxam
,
(
FUNC_ST0
)
FPU_illegal
,
(
FUNC_ST0
)
FPU_illegal
};
};
void
FPU_etc
()
void
FPU_etc
(
void
)
{
{
(
fp_etc_table
[
FPU_rm
])(
&
st
(
0
),
FPU_gettag0
());
(
fp_etc_table
[
FPU_rm
])(
&
st
(
0
),
FPU_gettag0
());
}
}
arch/i386/math-emu/fpu_proto.h
View file @
56177d2a
...
@@ -77,13 +77,13 @@ extern void FPU_copy_to_reg0(FPU_REG const *r, u_char tag);
...
@@ -77,13 +77,13 @@ extern void FPU_copy_to_reg0(FPU_REG const *r, u_char tag);
extern
void
FPU_triga
(
void
);
extern
void
FPU_triga
(
void
);
extern
void
FPU_trigb
(
void
);
extern
void
FPU_trigb
(
void
);
/* get_address.c */
/* get_address.c */
extern
void
*
FPU_get_address
(
u_char
FPU_modrm
,
unsigned
long
*
fpu_eip
,
extern
void
__user
*
FPU_get_address
(
u_char
FPU_modrm
,
unsigned
long
*
fpu_eip
,
struct
address
*
addr
,
fpu_addr_modes
addr_modes
);
struct
address
*
addr
,
fpu_addr_modes
addr_modes
);
extern
void
*
FPU_get_address_16
(
u_char
FPU_modrm
,
unsigned
long
*
fpu_eip
,
extern
void
__user
*
FPU_get_address_16
(
u_char
FPU_modrm
,
unsigned
long
*
fpu_eip
,
struct
address
*
addr
,
fpu_addr_modes
addr_modes
);
struct
address
*
addr
,
fpu_addr_modes
addr_modes
);
/* load_store.c */
/* load_store.c */
extern
int
FPU_load_store
(
u_char
type
,
fpu_addr_modes
addr_modes
,
extern
int
FPU_load_store
(
u_char
type
,
fpu_addr_modes
addr_modes
,
void
*
data_address
);
void
__user
*
data_address
);
/* poly_2xm1.c */
/* poly_2xm1.c */
extern
int
poly_2xm1
(
u_char
sign
,
FPU_REG
*
arg
,
FPU_REG
*
result
);
extern
int
poly_2xm1
(
u_char
sign
,
FPU_REG
*
arg
,
FPU_REG
*
result
);
/* poly_atan.c */
/* poly_atan.c */
...
@@ -112,26 +112,26 @@ extern void fucompp(void);
...
@@ -112,26 +112,26 @@ extern void fucompp(void);
/* reg_constant.c */
/* reg_constant.c */
extern
void
fconst
(
void
);
extern
void
fconst
(
void
);
/* reg_ld_str.c */
/* reg_ld_str.c */
extern
int
FPU_load_extended
(
long
double
*
s
,
int
stnr
);
extern
int
FPU_load_extended
(
long
double
__user
*
s
,
int
stnr
);
extern
int
FPU_load_double
(
double
*
dfloat
,
FPU_REG
*
loaded_data
);
extern
int
FPU_load_double
(
double
__user
*
dfloat
,
FPU_REG
*
loaded_data
);
extern
int
FPU_load_single
(
float
*
single
,
FPU_REG
*
loaded_data
);
extern
int
FPU_load_single
(
float
__user
*
single
,
FPU_REG
*
loaded_data
);
extern
int
FPU_load_int64
(
long
long
*
_s
);
extern
int
FPU_load_int64
(
long
long
__user
*
_s
);
extern
int
FPU_load_int32
(
long
*
_s
,
FPU_REG
*
loaded_data
);
extern
int
FPU_load_int32
(
long
__user
*
_s
,
FPU_REG
*
loaded_data
);
extern
int
FPU_load_int16
(
short
*
_s
,
FPU_REG
*
loaded_data
);
extern
int
FPU_load_int16
(
short
__user
*
_s
,
FPU_REG
*
loaded_data
);
extern
int
FPU_load_bcd
(
u_char
*
s
);
extern
int
FPU_load_bcd
(
u_char
__user
*
s
);
extern
int
FPU_store_extended
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
extern
int
FPU_store_extended
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
long
double
*
d
);
long
double
__user
*
d
);
extern
int
FPU_store_double
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
double
*
dfloat
);
extern
int
FPU_store_double
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
double
__user
*
dfloat
);
extern
int
FPU_store_single
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
float
*
single
);
extern
int
FPU_store_single
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
float
__user
*
single
);
extern
int
FPU_store_int64
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
long
long
*
d
);
extern
int
FPU_store_int64
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
long
long
__user
*
d
);
extern
int
FPU_store_int32
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
long
*
d
);
extern
int
FPU_store_int32
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
long
__user
*
d
);
extern
int
FPU_store_int16
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
short
*
d
);
extern
int
FPU_store_int16
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
short
__user
*
d
);
extern
int
FPU_store_bcd
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
u_char
*
d
);
extern
int
FPU_store_bcd
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
u_char
__user
*
d
);
extern
int
FPU_round_to_int
(
FPU_REG
*
r
,
u_char
tag
);
extern
int
FPU_round_to_int
(
FPU_REG
*
r
,
u_char
tag
);
extern
u_char
*
fldenv
(
fpu_addr_modes
addr_modes
,
u_cha
r
*
s
);
extern
u_char
__user
*
fldenv
(
fpu_addr_modes
addr_modes
,
u_char
__use
r
*
s
);
extern
void
frstor
(
fpu_addr_modes
addr_modes
,
u_char
*
data_address
);
extern
void
frstor
(
fpu_addr_modes
addr_modes
,
u_char
__user
*
data_address
);
extern
u_char
*
fstenv
(
fpu_addr_modes
addr_modes
,
u_cha
r
*
d
);
extern
u_char
__user
*
fstenv
(
fpu_addr_modes
addr_modes
,
u_char
__use
r
*
d
);
extern
void
fsave
(
fpu_addr_modes
addr_modes
,
u_char
*
data_address
);
extern
void
fsave
(
fpu_addr_modes
addr_modes
,
u_char
__user
*
data_address
);
extern
int
FPU_tagof
(
FPU_REG
*
ptr
);
extern
int
FPU_tagof
(
FPU_REG
*
ptr
);
/* reg_mul.c */
/* reg_mul.c */
extern
int
FPU_mul
(
FPU_REG
const
*
b
,
u_char
tagb
,
int
deststnr
,
int
control_w
);
extern
int
FPU_mul
(
FPU_REG
const
*
b
,
u_char
tagb
,
int
deststnr
,
int
control_w
);
...
...
arch/i386/math-emu/fpu_system.h
View file @
56177d2a
...
@@ -80,7 +80,7 @@
...
@@ -80,7 +80,7 @@
/* A simpler test than verify_area() can probably be done for
/* A simpler test than verify_area() can probably be done for
FPU_code_verify_area() because the only possible error is to step
FPU_code_verify_area() because the only possible error is to step
past the upper boundary of a legal code area. */
past the upper boundary of a legal code area. */
#define FPU_code_verify_area(z) FPU_verify_area(VERIFY_READ,(void *)FPU_EIP,z)
#define FPU_code_verify_area(z) FPU_verify_area(VERIFY_READ,(void
__user
*)FPU_EIP,z)
#endif
#endif
#define FPU_get_user(x,y) get_user((x),(y))
#define FPU_get_user(x,y) get_user((x),(y))
...
...
arch/i386/math-emu/get_address.c
View file @
56177d2a
...
@@ -82,7 +82,7 @@ static int sib(int mod, unsigned long *fpu_eip)
...
@@ -82,7 +82,7 @@ static int sib(int mod, unsigned long *fpu_eip)
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_code_verify_area
(
1
);
FPU_code_verify_area
(
1
);
FPU_get_user
(
base
,
(
u_char
*
)
(
*
fpu_eip
));
/* The SIB byte */
FPU_get_user
(
base
,
(
u_char
__user
*
)
(
*
fpu_eip
));
/* The SIB byte */
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
(
*
fpu_eip
)
++
;
(
*
fpu_eip
)
++
;
ss
=
base
>>
6
;
ss
=
base
>>
6
;
...
@@ -112,7 +112,7 @@ static int sib(int mod, unsigned long *fpu_eip)
...
@@ -112,7 +112,7 @@ static int sib(int mod, unsigned long *fpu_eip)
long
displacement
;
long
displacement
;
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_code_verify_area
(
1
);
FPU_code_verify_area
(
1
);
FPU_get_user
(
displacement
,
(
signed
char
*
)
(
*
fpu_eip
));
FPU_get_user
(
displacement
,
(
signed
char
__user
*
)
(
*
fpu_eip
));
offset
+=
displacement
;
offset
+=
displacement
;
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
(
*
fpu_eip
)
++
;
(
*
fpu_eip
)
++
;
...
@@ -123,7 +123,7 @@ static int sib(int mod, unsigned long *fpu_eip)
...
@@ -123,7 +123,7 @@ static int sib(int mod, unsigned long *fpu_eip)
long
displacement
;
long
displacement
;
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_code_verify_area
(
4
);
FPU_code_verify_area
(
4
);
FPU_get_user
(
displacement
,
(
long
*
)
(
*
fpu_eip
));
FPU_get_user
(
displacement
,
(
long
__user
*
)
(
*
fpu_eip
));
offset
+=
displacement
;
offset
+=
displacement
;
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
(
*
fpu_eip
)
+=
4
;
(
*
fpu_eip
)
+=
4
;
...
@@ -241,7 +241,7 @@ static long pm_address(u_char FPU_modrm, u_char segment,
...
@@ -241,7 +241,7 @@ static long pm_address(u_char FPU_modrm, u_char segment,
*/
*/
void
*
FPU_get_address
(
u_char
FPU_modrm
,
unsigned
long
*
fpu_eip
,
void
__user
*
FPU_get_address
(
u_char
FPU_modrm
,
unsigned
long
*
fpu_eip
,
struct
address
*
addr
,
struct
address
*
addr
,
fpu_addr_modes
addr_modes
)
fpu_addr_modes
addr_modes
)
{
{
...
@@ -277,24 +277,24 @@ void *FPU_get_address(u_char FPU_modrm, unsigned long *fpu_eip,
...
@@ -277,24 +277,24 @@ void *FPU_get_address(u_char FPU_modrm, unsigned long *fpu_eip,
/* Special case: disp32 */
/* Special case: disp32 */
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_code_verify_area
(
4
);
FPU_code_verify_area
(
4
);
FPU_get_user
(
address
,
(
unsigned
long
*
)
(
*
fpu_eip
));
FPU_get_user
(
address
,
(
unsigned
long
__user
*
)
(
*
fpu_eip
));
(
*
fpu_eip
)
+=
4
;
(
*
fpu_eip
)
+=
4
;
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
addr
->
offset
=
address
;
addr
->
offset
=
address
;
return
(
void
*
)
address
;
return
(
void
__user
*
)
address
;
}
}
else
else
{
{
address
=
*
cpu_reg_ptr
;
/* Just return the contents
address
=
*
cpu_reg_ptr
;
/* Just return the contents
of the cpu register */
of the cpu register */
addr
->
offset
=
address
;
addr
->
offset
=
address
;
return
(
void
*
)
address
;
return
(
void
__user
*
)
address
;
}
}
case
1
:
case
1
:
/* 8 bit signed displacement */
/* 8 bit signed displacement */
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_code_verify_area
(
1
);
FPU_code_verify_area
(
1
);
FPU_get_user
(
address
,
(
signed
char
*
)
(
*
fpu_eip
));
FPU_get_user
(
address
,
(
signed
char
__user
*
)
(
*
fpu_eip
));
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
(
*
fpu_eip
)
++
;
(
*
fpu_eip
)
++
;
break
;
break
;
...
@@ -302,7 +302,7 @@ void *FPU_get_address(u_char FPU_modrm, unsigned long *fpu_eip,
...
@@ -302,7 +302,7 @@ void *FPU_get_address(u_char FPU_modrm, unsigned long *fpu_eip,
/* 32 bit displacement */
/* 32 bit displacement */
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_code_verify_area
(
4
);
FPU_code_verify_area
(
4
);
FPU_get_user
(
address
,
(
long
*
)
(
*
fpu_eip
));
FPU_get_user
(
address
,
(
long
__user
*
)
(
*
fpu_eip
));
(
*
fpu_eip
)
+=
4
;
(
*
fpu_eip
)
+=
4
;
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
break
;
break
;
...
@@ -331,11 +331,11 @@ void *FPU_get_address(u_char FPU_modrm, unsigned long *fpu_eip,
...
@@ -331,11 +331,11 @@ void *FPU_get_address(u_char FPU_modrm, unsigned long *fpu_eip,
EXCEPTION
(
EX_INTERNAL
|
0x133
);
EXCEPTION
(
EX_INTERNAL
|
0x133
);
}
}
return
(
void
*
)
address
;
return
(
void
__user
*
)
address
;
}
}
void
*
FPU_get_address_16
(
u_char
FPU_modrm
,
unsigned
long
*
fpu_eip
,
void
__user
*
FPU_get_address_16
(
u_char
FPU_modrm
,
unsigned
long
*
fpu_eip
,
struct
address
*
addr
,
struct
address
*
addr
,
fpu_addr_modes
addr_modes
)
fpu_addr_modes
addr_modes
)
{
{
...
@@ -363,7 +363,7 @@ void *FPU_get_address_16(u_char FPU_modrm, unsigned long *fpu_eip,
...
@@ -363,7 +363,7 @@ void *FPU_get_address_16(u_char FPU_modrm, unsigned long *fpu_eip,
/* Special case: disp16 */
/* Special case: disp16 */
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_code_verify_area
(
2
);
FPU_code_verify_area
(
2
);
FPU_get_user
(
address
,
(
unsigned
short
*
)
(
*
fpu_eip
));
FPU_get_user
(
address
,
(
unsigned
short
__user
*
)
(
*
fpu_eip
));
(
*
fpu_eip
)
+=
2
;
(
*
fpu_eip
)
+=
2
;
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
goto
add_segment
;
goto
add_segment
;
...
@@ -373,7 +373,7 @@ void *FPU_get_address_16(u_char FPU_modrm, unsigned long *fpu_eip,
...
@@ -373,7 +373,7 @@ void *FPU_get_address_16(u_char FPU_modrm, unsigned long *fpu_eip,
/* 8 bit signed displacement */
/* 8 bit signed displacement */
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_code_verify_area
(
1
);
FPU_code_verify_area
(
1
);
FPU_get_user
(
address
,
(
signed
char
*
)
(
*
fpu_eip
));
FPU_get_user
(
address
,
(
signed
char
__user
*
)
(
*
fpu_eip
));
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
(
*
fpu_eip
)
++
;
(
*
fpu_eip
)
++
;
break
;
break
;
...
@@ -381,7 +381,7 @@ void *FPU_get_address_16(u_char FPU_modrm, unsigned long *fpu_eip,
...
@@ -381,7 +381,7 @@ void *FPU_get_address_16(u_char FPU_modrm, unsigned long *fpu_eip,
/* 16 bit displacement */
/* 16 bit displacement */
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_code_verify_area
(
2
);
FPU_code_verify_area
(
2
);
FPU_get_user
(
address
,
(
unsigned
short
*
)
(
*
fpu_eip
));
FPU_get_user
(
address
,
(
unsigned
short
__user
*
)
(
*
fpu_eip
));
(
*
fpu_eip
)
+=
2
;
(
*
fpu_eip
)
+=
2
;
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
break
;
break
;
...
@@ -445,5 +445,5 @@ void *FPU_get_address_16(u_char FPU_modrm, unsigned long *fpu_eip,
...
@@ -445,5 +445,5 @@ void *FPU_get_address_16(u_char FPU_modrm, unsigned long *fpu_eip,
EXCEPTION
(
EX_INTERNAL
|
0x131
);
EXCEPTION
(
EX_INTERNAL
|
0x131
);
}
}
return
(
void
*
)
address
;
return
(
void
__user
*
)
address
;
}
}
arch/i386/math-emu/load_store.c
View file @
56177d2a
...
@@ -61,7 +61,7 @@ u_char const data_sizes_32[32] = {
...
@@ -61,7 +61,7 @@ u_char const data_sizes_32[32] = {
};
};
int
FPU_load_store
(
u_char
type
,
fpu_addr_modes
addr_modes
,
int
FPU_load_store
(
u_char
type
,
fpu_addr_modes
addr_modes
,
void
*
data_address
)
void
__user
*
data_address
)
{
{
FPU_REG
loaded_data
;
FPU_REG
loaded_data
;
FPU_REG
*
st0_ptr
;
FPU_REG
*
st0_ptr
;
...
@@ -119,7 +119,7 @@ int FPU_load_store(u_char type, fpu_addr_modes addr_modes,
...
@@ -119,7 +119,7 @@ int FPU_load_store(u_char type, fpu_addr_modes addr_modes,
{
{
case
000
:
/* fld m32real */
case
000
:
/* fld m32real */
clear_C1
();
clear_C1
();
loaded_tag
=
FPU_load_single
((
float
*
)
data_address
,
&
loaded_data
);
loaded_tag
=
FPU_load_single
((
float
__user
*
)
data_address
,
&
loaded_data
);
if
(
(
loaded_tag
==
TAG_Special
)
if
(
(
loaded_tag
==
TAG_Special
)
&&
isNaN
(
&
loaded_data
)
&&
isNaN
(
&
loaded_data
)
&&
(
real_1op_NaN
(
&
loaded_data
)
<
0
)
)
&&
(
real_1op_NaN
(
&
loaded_data
)
<
0
)
)
...
@@ -131,12 +131,12 @@ int FPU_load_store(u_char type, fpu_addr_modes addr_modes,
...
@@ -131,12 +131,12 @@ int FPU_load_store(u_char type, fpu_addr_modes addr_modes,
break
;
break
;
case
001
:
/* fild m32int */
case
001
:
/* fild m32int */
clear_C1
();
clear_C1
();
loaded_tag
=
FPU_load_int32
((
long
*
)
data_address
,
&
loaded_data
);
loaded_tag
=
FPU_load_int32
((
long
__user
*
)
data_address
,
&
loaded_data
);
FPU_copy_to_reg0
(
&
loaded_data
,
loaded_tag
);
FPU_copy_to_reg0
(
&
loaded_data
,
loaded_tag
);
break
;
break
;
case
002
:
/* fld m64real */
case
002
:
/* fld m64real */
clear_C1
();
clear_C1
();
loaded_tag
=
FPU_load_double
((
double
*
)
data_address
,
&
loaded_data
);
loaded_tag
=
FPU_load_double
((
double
__user
*
)
data_address
,
&
loaded_data
);
if
(
(
loaded_tag
==
TAG_Special
)
if
(
(
loaded_tag
==
TAG_Special
)
&&
isNaN
(
&
loaded_data
)
&&
isNaN
(
&
loaded_data
)
&&
(
real_1op_NaN
(
&
loaded_data
)
<
0
)
)
&&
(
real_1op_NaN
(
&
loaded_data
)
<
0
)
)
...
@@ -148,68 +148,68 @@ int FPU_load_store(u_char type, fpu_addr_modes addr_modes,
...
@@ -148,68 +148,68 @@ int FPU_load_store(u_char type, fpu_addr_modes addr_modes,
break
;
break
;
case
003
:
/* fild m16int */
case
003
:
/* fild m16int */
clear_C1
();
clear_C1
();
loaded_tag
=
FPU_load_int16
((
short
*
)
data_address
,
&
loaded_data
);
loaded_tag
=
FPU_load_int16
((
short
__user
*
)
data_address
,
&
loaded_data
);
FPU_copy_to_reg0
(
&
loaded_data
,
loaded_tag
);
FPU_copy_to_reg0
(
&
loaded_data
,
loaded_tag
);
break
;
break
;
case
010
:
/* fst m32real */
case
010
:
/* fst m32real */
clear_C1
();
clear_C1
();
FPU_store_single
(
st0_ptr
,
st0_tag
,
(
float
*
)
data_address
);
FPU_store_single
(
st0_ptr
,
st0_tag
,
(
float
__user
*
)
data_address
);
break
;
break
;
case
011
:
/* fist m32int */
case
011
:
/* fist m32int */
clear_C1
();
clear_C1
();
FPU_store_int32
(
st0_ptr
,
st0_tag
,
(
long
*
)
data_address
);
FPU_store_int32
(
st0_ptr
,
st0_tag
,
(
long
__user
*
)
data_address
);
break
;
break
;
case
012
:
/* fst m64real */
case
012
:
/* fst m64real */
clear_C1
();
clear_C1
();
FPU_store_double
(
st0_ptr
,
st0_tag
,
(
double
*
)
data_address
);
FPU_store_double
(
st0_ptr
,
st0_tag
,
(
double
__user
*
)
data_address
);
break
;
break
;
case
013
:
/* fist m16int */
case
013
:
/* fist m16int */
clear_C1
();
clear_C1
();
FPU_store_int16
(
st0_ptr
,
st0_tag
,
(
short
*
)
data_address
);
FPU_store_int16
(
st0_ptr
,
st0_tag
,
(
short
__user
*
)
data_address
);
break
;
break
;
case
014
:
/* fstp m32real */
case
014
:
/* fstp m32real */
clear_C1
();
clear_C1
();
if
(
FPU_store_single
(
st0_ptr
,
st0_tag
,
(
float
*
)
data_address
)
)
if
(
FPU_store_single
(
st0_ptr
,
st0_tag
,
(
float
__user
*
)
data_address
)
)
pop_0
();
/* pop only if the number was actually stored
pop_0
();
/* pop only if the number was actually stored
(see the 80486 manual p16-28) */
(see the 80486 manual p16-28) */
break
;
break
;
case
015
:
/* fistp m32int */
case
015
:
/* fistp m32int */
clear_C1
();
clear_C1
();
if
(
FPU_store_int32
(
st0_ptr
,
st0_tag
,
(
long
*
)
data_address
)
)
if
(
FPU_store_int32
(
st0_ptr
,
st0_tag
,
(
long
__user
*
)
data_address
)
)
pop_0
();
/* pop only if the number was actually stored
pop_0
();
/* pop only if the number was actually stored
(see the 80486 manual p16-28) */
(see the 80486 manual p16-28) */
break
;
break
;
case
016
:
/* fstp m64real */
case
016
:
/* fstp m64real */
clear_C1
();
clear_C1
();
if
(
FPU_store_double
(
st0_ptr
,
st0_tag
,
(
double
*
)
data_address
)
)
if
(
FPU_store_double
(
st0_ptr
,
st0_tag
,
(
double
__user
*
)
data_address
)
)
pop_0
();
/* pop only if the number was actually stored
pop_0
();
/* pop only if the number was actually stored
(see the 80486 manual p16-28) */
(see the 80486 manual p16-28) */
break
;
break
;
case
017
:
/* fistp m16int */
case
017
:
/* fistp m16int */
clear_C1
();
clear_C1
();
if
(
FPU_store_int16
(
st0_ptr
,
st0_tag
,
(
short
*
)
data_address
)
)
if
(
FPU_store_int16
(
st0_ptr
,
st0_tag
,
(
short
__user
*
)
data_address
)
)
pop_0
();
/* pop only if the number was actually stored
pop_0
();
/* pop only if the number was actually stored
(see the 80486 manual p16-28) */
(see the 80486 manual p16-28) */
break
;
break
;
case
020
:
/* fldenv m14/28byte */
case
020
:
/* fldenv m14/28byte */
fldenv
(
addr_modes
,
(
u_char
*
)
data_address
);
fldenv
(
addr_modes
,
(
u_char
__user
*
)
data_address
);
/* Ensure that the values just loaded are not changed by
/* Ensure that the values just loaded are not changed by
fix-up operations. */
fix-up operations. */
return
1
;
return
1
;
case
022
:
/* frstor m94/108byte */
case
022
:
/* frstor m94/108byte */
frstor
(
addr_modes
,
(
u_char
*
)
data_address
);
frstor
(
addr_modes
,
(
u_char
__user
*
)
data_address
);
/* Ensure that the values just loaded are not changed by
/* Ensure that the values just loaded are not changed by
fix-up operations. */
fix-up operations. */
return
1
;
return
1
;
case
023
:
/* fbld m80dec */
case
023
:
/* fbld m80dec */
clear_C1
();
clear_C1
();
loaded_tag
=
FPU_load_bcd
((
u_char
*
)
data_address
);
loaded_tag
=
FPU_load_bcd
((
u_char
__user
*
)
data_address
);
FPU_settag0
(
loaded_tag
);
FPU_settag0
(
loaded_tag
);
break
;
break
;
case
024
:
/* fldcw */
case
024
:
/* fldcw */
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_verify_area
(
VERIFY_READ
,
data_address
,
2
);
FPU_verify_area
(
VERIFY_READ
,
data_address
,
2
);
FPU_get_user
(
control_word
,
(
unsigned
short
*
)
data_address
);
FPU_get_user
(
control_word
,
(
unsigned
short
__user
*
)
data_address
);
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
if
(
partial_status
&
~
control_word
&
CW_Exceptions
)
if
(
partial_status
&
~
control_word
&
CW_Exceptions
)
partial_status
|=
(
SW_Summary
|
SW_Backward
);
partial_status
|=
(
SW_Summary
|
SW_Backward
);
...
@@ -221,47 +221,47 @@ int FPU_load_store(u_char type, fpu_addr_modes addr_modes,
...
@@ -221,47 +221,47 @@ int FPU_load_store(u_char type, fpu_addr_modes addr_modes,
return
1
;
return
1
;
case
025
:
/* fld m80real */
case
025
:
/* fld m80real */
clear_C1
();
clear_C1
();
loaded_tag
=
FPU_load_extended
((
long
double
*
)
data_address
,
0
);
loaded_tag
=
FPU_load_extended
((
long
double
__user
*
)
data_address
,
0
);
FPU_settag0
(
loaded_tag
);
FPU_settag0
(
loaded_tag
);
break
;
break
;
case
027
:
/* fild m64int */
case
027
:
/* fild m64int */
clear_C1
();
clear_C1
();
loaded_tag
=
FPU_load_int64
((
long
long
*
)
data_address
);
loaded_tag
=
FPU_load_int64
((
long
long
__user
*
)
data_address
);
FPU_settag0
(
loaded_tag
);
FPU_settag0
(
loaded_tag
);
break
;
break
;
case
030
:
/* fstenv m14/28byte */
case
030
:
/* fstenv m14/28byte */
fstenv
(
addr_modes
,
(
u_char
*
)
data_address
);
fstenv
(
addr_modes
,
(
u_char
__user
*
)
data_address
);
return
1
;
return
1
;
case
032
:
/* fsave */
case
032
:
/* fsave */
fsave
(
addr_modes
,
(
u_char
*
)
data_address
);
fsave
(
addr_modes
,
(
u_char
__user
*
)
data_address
);
return
1
;
return
1
;
case
033
:
/* fbstp m80dec */
case
033
:
/* fbstp m80dec */
clear_C1
();
clear_C1
();
if
(
FPU_store_bcd
(
st0_ptr
,
st0_tag
,
(
u_char
*
)
data_address
)
)
if
(
FPU_store_bcd
(
st0_ptr
,
st0_tag
,
(
u_char
__user
*
)
data_address
)
)
pop_0
();
/* pop only if the number was actually stored
pop_0
();
/* pop only if the number was actually stored
(see the 80486 manual p16-28) */
(see the 80486 manual p16-28) */
break
;
break
;
case
034
:
/* fstcw m16int */
case
034
:
/* fstcw m16int */
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_verify_area
(
VERIFY_WRITE
,
data_address
,
2
);
FPU_verify_area
(
VERIFY_WRITE
,
data_address
,
2
);
FPU_put_user
(
control_word
,
(
unsigned
short
*
)
data_address
);
FPU_put_user
(
control_word
,
(
unsigned
short
__user
*
)
data_address
);
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
return
1
;
return
1
;
case
035
:
/* fstp m80real */
case
035
:
/* fstp m80real */
clear_C1
();
clear_C1
();
if
(
FPU_store_extended
(
st0_ptr
,
st0_tag
,
(
long
double
*
)
data_address
)
)
if
(
FPU_store_extended
(
st0_ptr
,
st0_tag
,
(
long
double
__user
*
)
data_address
)
)
pop_0
();
/* pop only if the number was actually stored
pop_0
();
/* pop only if the number was actually stored
(see the 80486 manual p16-28) */
(see the 80486 manual p16-28) */
break
;
break
;
case
036
:
/* fstsw m2byte */
case
036
:
/* fstsw m2byte */
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_verify_area
(
VERIFY_WRITE
,
data_address
,
2
);
FPU_verify_area
(
VERIFY_WRITE
,
data_address
,
2
);
FPU_put_user
(
status_word
(),(
unsigned
short
*
)
data_address
);
FPU_put_user
(
status_word
(),(
unsigned
short
__user
*
)
data_address
);
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
return
1
;
return
1
;
case
037
:
/* fistp m64int */
case
037
:
/* fistp m64int */
clear_C1
();
clear_C1
();
if
(
FPU_store_int64
(
st0_ptr
,
st0_tag
,
(
long
long
*
)
data_address
)
)
if
(
FPU_store_int64
(
st0_ptr
,
st0_tag
,
(
long
long
__user
*
)
data_address
)
)
pop_0
();
/* pop only if the number was actually stored
pop_0
();
/* pop only if the number was actually stored
(see the 80486 manual p16-28) */
(see the 80486 manual p16-28) */
break
;
break
;
...
...
arch/i386/math-emu/reg_compare.c
View file @
56177d2a
...
@@ -324,14 +324,14 @@ static int compare_u_st_st(int nr)
...
@@ -324,14 +324,14 @@ static int compare_u_st_st(int nr)
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
void
fcom_st
()
void
fcom_st
(
void
)
{
{
/* fcom st(i) */
/* fcom st(i) */
compare_st_st
(
FPU_rm
);
compare_st_st
(
FPU_rm
);
}
}
void
fcompst
()
void
fcompst
(
void
)
{
{
/* fcomp st(i) */
/* fcomp st(i) */
if
(
!
compare_st_st
(
FPU_rm
)
)
if
(
!
compare_st_st
(
FPU_rm
)
)
...
@@ -339,7 +339,7 @@ void fcompst()
...
@@ -339,7 +339,7 @@ void fcompst()
}
}
void
fcompp
()
void
fcompp
(
void
)
{
{
/* fcompp */
/* fcompp */
if
(
FPU_rm
!=
1
)
if
(
FPU_rm
!=
1
)
...
@@ -352,7 +352,7 @@ void fcompp()
...
@@ -352,7 +352,7 @@ void fcompp()
}
}
void
fucom_
()
void
fucom_
(
void
)
{
{
/* fucom st(i) */
/* fucom st(i) */
compare_u_st_st
(
FPU_rm
);
compare_u_st_st
(
FPU_rm
);
...
@@ -360,7 +360,7 @@ void fucom_()
...
@@ -360,7 +360,7 @@ void fucom_()
}
}
void
fucomp
()
void
fucomp
(
void
)
{
{
/* fucomp st(i) */
/* fucomp st(i) */
if
(
!
compare_u_st_st
(
FPU_rm
)
)
if
(
!
compare_u_st_st
(
FPU_rm
)
)
...
@@ -368,7 +368,7 @@ void fucomp()
...
@@ -368,7 +368,7 @@ void fucomp()
}
}
void
fucompp
()
void
fucompp
(
void
)
{
{
/* fucompp */
/* fucompp */
if
(
FPU_rm
==
1
)
if
(
FPU_rm
==
1
)
...
...
arch/i386/math-emu/reg_ld_str.c
View file @
56177d2a
...
@@ -86,7 +86,7 @@ int FPU_tagof(FPU_REG *ptr)
...
@@ -86,7 +86,7 @@ int FPU_tagof(FPU_REG *ptr)
/* Get a long double from user memory */
/* Get a long double from user memory */
int
FPU_load_extended
(
long
double
*
s
,
int
stnr
)
int
FPU_load_extended
(
long
double
__user
*
s
,
int
stnr
)
{
{
FPU_REG
*
sti_ptr
=
&
st
(
stnr
);
FPU_REG
*
sti_ptr
=
&
st
(
stnr
);
...
@@ -100,15 +100,15 @@ int FPU_load_extended(long double *s, int stnr)
...
@@ -100,15 +100,15 @@ int FPU_load_extended(long double *s, int stnr)
/* Get a double from user memory */
/* Get a double from user memory */
int
FPU_load_double
(
double
*
dfloat
,
FPU_REG
*
loaded_data
)
int
FPU_load_double
(
double
__user
*
dfloat
,
FPU_REG
*
loaded_data
)
{
{
int
exp
,
tag
,
negative
;
int
exp
,
tag
,
negative
;
unsigned
m64
,
l64
;
unsigned
m64
,
l64
;
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_verify_area
(
VERIFY_READ
,
dfloat
,
8
);
FPU_verify_area
(
VERIFY_READ
,
dfloat
,
8
);
FPU_get_user
(
m64
,
1
+
(
unsigned
long
*
)
dfloat
);
FPU_get_user
(
m64
,
1
+
(
unsigned
long
__user
*
)
dfloat
);
FPU_get_user
(
l64
,
(
unsigned
long
*
)
dfloat
);
FPU_get_user
(
l64
,
(
unsigned
long
__user
*
)
dfloat
);
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
negative
=
(
m64
&
0x80000000
)
?
SIGN_Negative
:
SIGN_Positive
;
negative
=
(
m64
&
0x80000000
)
?
SIGN_Negative
:
SIGN_Positive
;
...
@@ -172,14 +172,14 @@ int FPU_load_double(double *dfloat, FPU_REG *loaded_data)
...
@@ -172,14 +172,14 @@ int FPU_load_double(double *dfloat, FPU_REG *loaded_data)
/* Get a float from user memory */
/* Get a float from user memory */
int
FPU_load_single
(
float
*
single
,
FPU_REG
*
loaded_data
)
int
FPU_load_single
(
float
__user
*
single
,
FPU_REG
*
loaded_data
)
{
{
unsigned
m32
;
unsigned
m32
;
int
exp
,
tag
,
negative
;
int
exp
,
tag
,
negative
;
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_verify_area
(
VERIFY_READ
,
single
,
4
);
FPU_verify_area
(
VERIFY_READ
,
single
,
4
);
FPU_get_user
(
m32
,
(
unsigned
long
*
)
single
);
FPU_get_user
(
m32
,
(
unsigned
long
__user
*
)
single
);
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
negative
=
(
m32
&
0x80000000
)
?
SIGN_Negative
:
SIGN_Positive
;
negative
=
(
m32
&
0x80000000
)
?
SIGN_Negative
:
SIGN_Positive
;
...
@@ -236,7 +236,7 @@ int FPU_load_single(float *single, FPU_REG *loaded_data)
...
@@ -236,7 +236,7 @@ int FPU_load_single(float *single, FPU_REG *loaded_data)
/* Get a long long from user memory */
/* Get a long long from user memory */
int
FPU_load_int64
(
long
long
*
_s
)
int
FPU_load_int64
(
long
long
__user
*
_s
)
{
{
long
long
s
;
long
long
s
;
int
sign
;
int
sign
;
...
@@ -268,7 +268,7 @@ int FPU_load_int64(long long *_s)
...
@@ -268,7 +268,7 @@ int FPU_load_int64(long long *_s)
/* Get a long from user memory */
/* Get a long from user memory */
int
FPU_load_int32
(
long
*
_s
,
FPU_REG
*
loaded_data
)
int
FPU_load_int32
(
long
__user
*
_s
,
FPU_REG
*
loaded_data
)
{
{
long
s
;
long
s
;
int
negative
;
int
negative
;
...
@@ -297,7 +297,7 @@ int FPU_load_int32(long *_s, FPU_REG *loaded_data)
...
@@ -297,7 +297,7 @@ int FPU_load_int32(long *_s, FPU_REG *loaded_data)
/* Get a short from user memory */
/* Get a short from user memory */
int
FPU_load_int16
(
short
*
_s
,
FPU_REG
*
loaded_data
)
int
FPU_load_int16
(
short
__user
*
_s
,
FPU_REG
*
loaded_data
)
{
{
int
s
,
negative
;
int
s
,
negative
;
...
@@ -326,7 +326,7 @@ int FPU_load_int16(short *_s, FPU_REG *loaded_data)
...
@@ -326,7 +326,7 @@ int FPU_load_int16(short *_s, FPU_REG *loaded_data)
/* Get a packed bcd array from user memory */
/* Get a packed bcd array from user memory */
int
FPU_load_bcd
(
u_char
*
s
)
int
FPU_load_bcd
(
u_char
__user
*
s
)
{
{
FPU_REG
*
st0_ptr
=
&
st
(
0
);
FPU_REG
*
st0_ptr
=
&
st
(
0
);
int
pos
;
int
pos
;
...
@@ -341,7 +341,7 @@ int FPU_load_bcd(u_char *s)
...
@@ -341,7 +341,7 @@ int FPU_load_bcd(u_char *s)
{
{
l
*=
10
;
l
*=
10
;
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_get_user
(
bcd
,
(
u_char
*
)
s
+
pos
);
FPU_get_user
(
bcd
,
s
+
pos
);
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
l
+=
bcd
>>
4
;
l
+=
bcd
>>
4
;
l
*=
10
;
l
*=
10
;
...
@@ -349,7 +349,7 @@ int FPU_load_bcd(u_char *s)
...
@@ -349,7 +349,7 @@ int FPU_load_bcd(u_char *s)
}
}
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_get_user
(
sign
,
(
u_char
*
)
s
+
9
);
FPU_get_user
(
sign
,
s
+
9
);
sign
=
sign
&
0x80
?
SIGN_Negative
:
SIGN_Positive
;
sign
=
sign
&
0x80
?
SIGN_Negative
:
SIGN_Positive
;
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
...
@@ -369,7 +369,7 @@ int FPU_load_bcd(u_char *s)
...
@@ -369,7 +369,7 @@ int FPU_load_bcd(u_char *s)
/*===========================================================================*/
/*===========================================================================*/
/* Put a long double into user memory */
/* Put a long double into user memory */
int
FPU_store_extended
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
long
double
*
d
)
int
FPU_store_extended
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
long
double
__user
*
d
)
{
{
/*
/*
The only exception raised by an attempt to store to an
The only exception raised by an attempt to store to an
...
@@ -382,9 +382,9 @@ int FPU_store_extended(FPU_REG *st0_ptr, u_char st0_tag, long double *d)
...
@@ -382,9 +382,9 @@ int FPU_store_extended(FPU_REG *st0_ptr, u_char st0_tag, long double *d)
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_verify_area
(
VERIFY_WRITE
,
d
,
10
);
FPU_verify_area
(
VERIFY_WRITE
,
d
,
10
);
FPU_put_user
(
st0_ptr
->
sigl
,
(
unsigned
long
*
)
d
);
FPU_put_user
(
st0_ptr
->
sigl
,
(
unsigned
long
__user
*
)
d
);
FPU_put_user
(
st0_ptr
->
sigh
,
(
unsigned
long
*
)
((
u_cha
r
*
)
d
+
4
));
FPU_put_user
(
st0_ptr
->
sigh
,
(
unsigned
long
__user
*
)
((
u_char
__use
r
*
)
d
+
4
));
FPU_put_user
(
exponent16
(
st0_ptr
),
(
unsigned
short
*
)
((
u_cha
r
*
)
d
+
8
));
FPU_put_user
(
exponent16
(
st0_ptr
),
(
unsigned
short
__user
*
)
((
u_char
__use
r
*
)
d
+
8
));
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
return
1
;
return
1
;
...
@@ -398,9 +398,9 @@ int FPU_store_extended(FPU_REG *st0_ptr, u_char st0_tag, long double *d)
...
@@ -398,9 +398,9 @@ int FPU_store_extended(FPU_REG *st0_ptr, u_char st0_tag, long double *d)
/* Put out the QNaN indefinite */
/* Put out the QNaN indefinite */
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_verify_area
(
VERIFY_WRITE
,
d
,
10
);
FPU_verify_area
(
VERIFY_WRITE
,
d
,
10
);
FPU_put_user
(
0
,
(
unsigned
long
*
)
d
);
FPU_put_user
(
0
,
(
unsigned
long
__user
*
)
d
);
FPU_put_user
(
0xc0000000
,
1
+
(
unsigned
long
*
)
d
);
FPU_put_user
(
0xc0000000
,
1
+
(
unsigned
long
__user
*
)
d
);
FPU_put_user
(
0xffff
,
4
+
(
short
*
)
d
);
FPU_put_user
(
0xffff
,
4
+
(
short
__user
*
)
d
);
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
return
1
;
return
1
;
}
}
...
@@ -411,7 +411,7 @@ int FPU_store_extended(FPU_REG *st0_ptr, u_char st0_tag, long double *d)
...
@@ -411,7 +411,7 @@ int FPU_store_extended(FPU_REG *st0_ptr, u_char st0_tag, long double *d)
/* Put a double into user memory */
/* Put a double into user memory */
int
FPU_store_double
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
double
*
dfloat
)
int
FPU_store_double
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
double
__user
*
dfloat
)
{
{
unsigned
long
l
[
2
];
unsigned
long
l
[
2
];
unsigned
long
increment
=
0
;
/* avoid gcc warnings */
unsigned
long
increment
=
0
;
/* avoid gcc warnings */
...
@@ -607,9 +607,9 @@ int FPU_store_double(FPU_REG *st0_ptr, u_char st0_tag, double *dfloat)
...
@@ -607,9 +607,9 @@ int FPU_store_double(FPU_REG *st0_ptr, u_char st0_tag, double *dfloat)
/* The masked response */
/* The masked response */
/* Put out the QNaN indefinite */
/* Put out the QNaN indefinite */
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_verify_area
(
VERIFY_WRITE
,
(
void
*
)
dfloat
,
8
);
FPU_verify_area
(
VERIFY_WRITE
,
dfloat
,
8
);
FPU_put_user
(
0
,
(
unsigned
long
*
)
dfloat
);
FPU_put_user
(
0
,
(
unsigned
long
__user
*
)
dfloat
);
FPU_put_user
(
0xfff80000
,
1
+
(
unsigned
long
*
)
dfloat
);
FPU_put_user
(
0xfff80000
,
1
+
(
unsigned
long
__user
*
)
dfloat
);
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
return
1
;
return
1
;
}
}
...
@@ -620,9 +620,9 @@ int FPU_store_double(FPU_REG *st0_ptr, u_char st0_tag, double *dfloat)
...
@@ -620,9 +620,9 @@ int FPU_store_double(FPU_REG *st0_ptr, u_char st0_tag, double *dfloat)
l
[
1
]
|=
0x80000000
;
l
[
1
]
|=
0x80000000
;
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_verify_area
(
VERIFY_WRITE
,
(
void
*
)
dfloat
,
8
);
FPU_verify_area
(
VERIFY_WRITE
,
dfloat
,
8
);
FPU_put_user
(
l
[
0
],
(
unsigned
long
*
)
dfloat
);
FPU_put_user
(
l
[
0
],
(
unsigned
long
__user
*
)
dfloat
);
FPU_put_user
(
l
[
1
],
1
+
(
unsigned
long
*
)
dfloat
);
FPU_put_user
(
l
[
1
],
1
+
(
unsigned
long
__user
*
)
dfloat
);
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
return
1
;
return
1
;
...
@@ -630,7 +630,7 @@ int FPU_store_double(FPU_REG *st0_ptr, u_char st0_tag, double *dfloat)
...
@@ -630,7 +630,7 @@ int FPU_store_double(FPU_REG *st0_ptr, u_char st0_tag, double *dfloat)
/* Put a float into user memory */
/* Put a float into user memory */
int
FPU_store_single
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
float
*
single
)
int
FPU_store_single
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
float
__user
*
single
)
{
{
long
templ
=
0
;
long
templ
=
0
;
unsigned
long
increment
=
0
;
/* avoid gcc warnings */
unsigned
long
increment
=
0
;
/* avoid gcc warnings */
...
@@ -826,8 +826,8 @@ int FPU_store_single(FPU_REG *st0_ptr, u_char st0_tag, float *single)
...
@@ -826,8 +826,8 @@ int FPU_store_single(FPU_REG *st0_ptr, u_char st0_tag, float *single)
/* The masked response */
/* The masked response */
/* Put out the QNaN indefinite */
/* Put out the QNaN indefinite */
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_verify_area
(
VERIFY_WRITE
,
(
void
*
)
single
,
4
);
FPU_verify_area
(
VERIFY_WRITE
,
single
,
4
);
FPU_put_user
(
0xffc00000
,
(
unsigned
long
*
)
single
);
FPU_put_user
(
0xffc00000
,
(
unsigned
long
__user
*
)
single
);
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
return
1
;
return
1
;
}
}
...
@@ -845,8 +845,8 @@ int FPU_store_single(FPU_REG *st0_ptr, u_char st0_tag, float *single)
...
@@ -845,8 +845,8 @@ int FPU_store_single(FPU_REG *st0_ptr, u_char st0_tag, float *single)
templ
|=
0x80000000
;
templ
|=
0x80000000
;
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_verify_area
(
VERIFY_WRITE
,
(
void
*
)
single
,
4
);
FPU_verify_area
(
VERIFY_WRITE
,
single
,
4
);
FPU_put_user
(
templ
,(
unsigned
long
*
)
single
);
FPU_put_user
(
templ
,(
unsigned
long
__user
*
)
single
);
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
return
1
;
return
1
;
...
@@ -854,7 +854,7 @@ int FPU_store_single(FPU_REG *st0_ptr, u_char st0_tag, float *single)
...
@@ -854,7 +854,7 @@ int FPU_store_single(FPU_REG *st0_ptr, u_char st0_tag, float *single)
/* Put a long long into user memory */
/* Put a long long into user memory */
int
FPU_store_int64
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
long
long
*
d
)
int
FPU_store_int64
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
long
long
__user
*
d
)
{
{
FPU_REG
t
;
FPU_REG
t
;
long
long
tll
;
long
long
tll
;
...
@@ -906,7 +906,7 @@ int FPU_store_int64(FPU_REG *st0_ptr, u_char st0_tag, long long *d)
...
@@ -906,7 +906,7 @@ int FPU_store_int64(FPU_REG *st0_ptr, u_char st0_tag, long long *d)
}
}
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_verify_area
(
VERIFY_WRITE
,
(
void
*
)
d
,
8
);
FPU_verify_area
(
VERIFY_WRITE
,
d
,
8
);
copy_to_user
(
d
,
&
tll
,
8
);
copy_to_user
(
d
,
&
tll
,
8
);
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
...
@@ -915,7 +915,7 @@ int FPU_store_int64(FPU_REG *st0_ptr, u_char st0_tag, long long *d)
...
@@ -915,7 +915,7 @@ int FPU_store_int64(FPU_REG *st0_ptr, u_char st0_tag, long long *d)
/* Put a long into user memory */
/* Put a long into user memory */
int
FPU_store_int32
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
long
*
d
)
int
FPU_store_int32
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
long
__user
*
d
)
{
{
FPU_REG
t
;
FPU_REG
t
;
int
precision_loss
;
int
precision_loss
;
...
@@ -964,7 +964,7 @@ int FPU_store_int32(FPU_REG *st0_ptr, u_char st0_tag, long *d)
...
@@ -964,7 +964,7 @@ int FPU_store_int32(FPU_REG *st0_ptr, u_char st0_tag, long *d)
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_verify_area
(
VERIFY_WRITE
,
d
,
4
);
FPU_verify_area
(
VERIFY_WRITE
,
d
,
4
);
FPU_put_user
(
t
.
sigl
,
(
unsigned
long
*
)
d
);
FPU_put_user
(
t
.
sigl
,
(
unsigned
long
__user
*
)
d
);
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
return
1
;
return
1
;
...
@@ -972,7 +972,7 @@ int FPU_store_int32(FPU_REG *st0_ptr, u_char st0_tag, long *d)
...
@@ -972,7 +972,7 @@ int FPU_store_int32(FPU_REG *st0_ptr, u_char st0_tag, long *d)
/* Put a short into user memory */
/* Put a short into user memory */
int
FPU_store_int16
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
short
*
d
)
int
FPU_store_int16
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
short
__user
*
d
)
{
{
FPU_REG
t
;
FPU_REG
t
;
int
precision_loss
;
int
precision_loss
;
...
@@ -1021,7 +1021,7 @@ int FPU_store_int16(FPU_REG *st0_ptr, u_char st0_tag, short *d)
...
@@ -1021,7 +1021,7 @@ int FPU_store_int16(FPU_REG *st0_ptr, u_char st0_tag, short *d)
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_verify_area
(
VERIFY_WRITE
,
d
,
2
);
FPU_verify_area
(
VERIFY_WRITE
,
d
,
2
);
FPU_put_user
((
short
)
t
.
sigl
,
(
short
*
)
d
);
FPU_put_user
((
short
)
t
.
sigl
,
d
);
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
return
1
;
return
1
;
...
@@ -1029,7 +1029,7 @@ int FPU_store_int16(FPU_REG *st0_ptr, u_char st0_tag, short *d)
...
@@ -1029,7 +1029,7 @@ int FPU_store_int16(FPU_REG *st0_ptr, u_char st0_tag, short *d)
/* Put a packed bcd array into user memory */
/* Put a packed bcd array into user memory */
int
FPU_store_bcd
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
u_char
*
d
)
int
FPU_store_bcd
(
FPU_REG
*
st0_ptr
,
u_char
st0_tag
,
u_char
__user
*
d
)
{
{
FPU_REG
t
;
FPU_REG
t
;
unsigned
long
long
ll
;
unsigned
long
long
ll
;
...
@@ -1071,10 +1071,10 @@ int FPU_store_bcd(FPU_REG *st0_ptr, u_char st0_tag, u_char *d)
...
@@ -1071,10 +1071,10 @@ int FPU_store_bcd(FPU_REG *st0_ptr, u_char st0_tag, u_char *d)
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_verify_area
(
VERIFY_WRITE
,
d
,
10
);
FPU_verify_area
(
VERIFY_WRITE
,
d
,
10
);
for
(
i
=
0
;
i
<
7
;
i
++
)
for
(
i
=
0
;
i
<
7
;
i
++
)
FPU_put_user
(
0
,
(
u_char
*
)
d
+
i
);
/* These bytes "undefined" */
FPU_put_user
(
0
,
d
+
i
);
/* These bytes "undefined" */
FPU_put_user
(
0xc0
,
(
u_char
*
)
d
+
7
);
/* This byte "undefined" */
FPU_put_user
(
0xc0
,
d
+
7
);
/* This byte "undefined" */
FPU_put_user
(
0xff
,
(
u_char
*
)
d
+
8
);
FPU_put_user
(
0xff
,
d
+
8
);
FPU_put_user
(
0xff
,
(
u_char
*
)
d
+
9
);
FPU_put_user
(
0xff
,
d
+
9
);
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
return
1
;
return
1
;
}
}
...
@@ -1095,11 +1095,11 @@ int FPU_store_bcd(FPU_REG *st0_ptr, u_char st0_tag, u_char *d)
...
@@ -1095,11 +1095,11 @@ int FPU_store_bcd(FPU_REG *st0_ptr, u_char st0_tag, u_char *d)
b
=
FPU_div_small
(
&
ll
,
10
);
b
=
FPU_div_small
(
&
ll
,
10
);
b
|=
(
FPU_div_small
(
&
ll
,
10
))
<<
4
;
b
|=
(
FPU_div_small
(
&
ll
,
10
))
<<
4
;
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_put_user
(
b
,
(
u_char
*
)
d
+
i
);
FPU_put_user
(
b
,
d
+
i
);
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
}
}
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_put_user
(
sign
,
(
u_char
*
)
d
+
9
);
FPU_put_user
(
sign
,
d
+
9
);
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
return
1
;
return
1
;
...
@@ -1175,7 +1175,7 @@ int FPU_round_to_int(FPU_REG *r, u_char tag)
...
@@ -1175,7 +1175,7 @@ int FPU_round_to_int(FPU_REG *r, u_char tag)
/*===========================================================================*/
/*===========================================================================*/
u_char
*
fldenv
(
fpu_addr_modes
addr_modes
,
u_cha
r
*
s
)
u_char
__user
*
fldenv
(
fpu_addr_modes
addr_modes
,
u_char
__use
r
*
s
)
{
{
unsigned
short
tag_word
=
0
;
unsigned
short
tag_word
=
0
;
u_char
tag
;
u_char
tag
;
...
@@ -1187,13 +1187,13 @@ u_char *fldenv(fpu_addr_modes addr_modes, u_char *s)
...
@@ -1187,13 +1187,13 @@ u_char *fldenv(fpu_addr_modes addr_modes, u_char *s)
{
{
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_verify_area
(
VERIFY_READ
,
s
,
0x0e
);
FPU_verify_area
(
VERIFY_READ
,
s
,
0x0e
);
FPU_get_user
(
control_word
,
(
unsigned
short
*
)
s
);
FPU_get_user
(
control_word
,
(
unsigned
short
__user
*
)
s
);
FPU_get_user
(
partial_status
,
(
unsigned
short
*
)
(
s
+
2
));
FPU_get_user
(
partial_status
,
(
unsigned
short
__user
*
)
(
s
+
2
));
FPU_get_user
(
tag_word
,
(
unsigned
short
*
)
(
s
+
4
));
FPU_get_user
(
tag_word
,
(
unsigned
short
__user
*
)
(
s
+
4
));
FPU_get_user
(
instruction_address
.
offset
,
(
unsigned
short
*
)
(
s
+
6
));
FPU_get_user
(
instruction_address
.
offset
,
(
unsigned
short
__user
*
)
(
s
+
6
));
FPU_get_user
(
instruction_address
.
selector
,
(
unsigned
short
*
)
(
s
+
8
));
FPU_get_user
(
instruction_address
.
selector
,
(
unsigned
short
__user
*
)
(
s
+
8
));
FPU_get_user
(
operand_address
.
offset
,
(
unsigned
short
*
)
(
s
+
0x0a
));
FPU_get_user
(
operand_address
.
offset
,
(
unsigned
short
__user
*
)
(
s
+
0x0a
));
FPU_get_user
(
operand_address
.
selector
,
(
unsigned
short
*
)
(
s
+
0x0c
));
FPU_get_user
(
operand_address
.
selector
,
(
unsigned
short
__user
*
)
(
s
+
0x0c
));
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
s
+=
0x0e
;
s
+=
0x0e
;
if
(
addr_modes
.
default_mode
==
VM86
)
if
(
addr_modes
.
default_mode
==
VM86
)
...
@@ -1207,14 +1207,14 @@ u_char *fldenv(fpu_addr_modes addr_modes, u_char *s)
...
@@ -1207,14 +1207,14 @@ u_char *fldenv(fpu_addr_modes addr_modes, u_char *s)
{
{
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_verify_area
(
VERIFY_READ
,
s
,
0x1c
);
FPU_verify_area
(
VERIFY_READ
,
s
,
0x1c
);
FPU_get_user
(
control_word
,
(
unsigned
short
*
)
s
);
FPU_get_user
(
control_word
,
(
unsigned
short
__user
*
)
s
);
FPU_get_user
(
partial_status
,
(
unsigned
short
*
)
(
s
+
4
));
FPU_get_user
(
partial_status
,
(
unsigned
short
__user
*
)
(
s
+
4
));
FPU_get_user
(
tag_word
,
(
unsigned
short
*
)
(
s
+
8
));
FPU_get_user
(
tag_word
,
(
unsigned
short
__user
*
)
(
s
+
8
));
FPU_get_user
(
instruction_address
.
offset
,
(
unsigned
long
*
)
(
s
+
0x0c
));
FPU_get_user
(
instruction_address
.
offset
,
(
unsigned
long
__user
*
)
(
s
+
0x0c
));
FPU_get_user
(
instruction_address
.
selector
,
(
unsigned
short
*
)
(
s
+
0x10
));
FPU_get_user
(
instruction_address
.
selector
,
(
unsigned
short
__user
*
)
(
s
+
0x10
));
FPU_get_user
(
instruction_address
.
opcode
,
(
unsigned
short
*
)
(
s
+
0x12
));
FPU_get_user
(
instruction_address
.
opcode
,
(
unsigned
short
__user
*
)
(
s
+
0x12
));
FPU_get_user
(
operand_address
.
offset
,
(
unsigned
long
*
)
(
s
+
0x14
));
FPU_get_user
(
operand_address
.
offset
,
(
unsigned
long
__user
*
)
(
s
+
0x14
));
FPU_get_user
(
operand_address
.
selector
,
(
unsigned
long
*
)
(
s
+
0x18
));
FPU_get_user
(
operand_address
.
selector
,
(
unsigned
long
__user
*
)
(
s
+
0x18
));
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
s
+=
0x1c
;
s
+=
0x1c
;
}
}
...
@@ -1266,10 +1266,10 @@ u_char *fldenv(fpu_addr_modes addr_modes, u_char *s)
...
@@ -1266,10 +1266,10 @@ u_char *fldenv(fpu_addr_modes addr_modes, u_char *s)
}
}
void
frstor
(
fpu_addr_modes
addr_modes
,
u_char
*
data_address
)
void
frstor
(
fpu_addr_modes
addr_modes
,
u_char
__user
*
data_address
)
{
{
int
i
,
regnr
;
int
i
,
regnr
;
u_char
*
s
=
fldenv
(
addr_modes
,
data_address
);
u_char
__user
*
s
=
fldenv
(
addr_modes
,
data_address
);
int
offset
=
(
top
&
7
)
*
10
,
other
=
80
-
offset
;
int
offset
=
(
top
&
7
)
*
10
,
other
=
80
-
offset
;
/* Copy all registers in stack order. */
/* Copy all registers in stack order. */
...
@@ -1291,7 +1291,7 @@ void frstor(fpu_addr_modes addr_modes, u_char *data_address)
...
@@ -1291,7 +1291,7 @@ void frstor(fpu_addr_modes addr_modes, u_char *data_address)
}
}
u_char
*
fstenv
(
fpu_addr_modes
addr_modes
,
u_cha
r
*
d
)
u_char
__user
*
fstenv
(
fpu_addr_modes
addr_modes
,
u_char
__use
r
*
d
)
{
{
if
(
(
addr_modes
.
default_mode
==
VM86
)
||
if
(
(
addr_modes
.
default_mode
==
VM86
)
||
((
addr_modes
.
default_mode
==
PM16
)
((
addr_modes
.
default_mode
==
PM16
)
...
@@ -1300,25 +1300,25 @@ u_char *fstenv(fpu_addr_modes addr_modes, u_char *d)
...
@@ -1300,25 +1300,25 @@ u_char *fstenv(fpu_addr_modes addr_modes, u_char *d)
RE_ENTRANT_CHECK_OFF
;
RE_ENTRANT_CHECK_OFF
;
FPU_verify_area
(
VERIFY_WRITE
,
d
,
14
);
FPU_verify_area
(
VERIFY_WRITE
,
d
,
14
);
#ifdef PECULIAR_486
#ifdef PECULIAR_486
FPU_put_user
(
control_word
&
~
0xe080
,
(
unsigned
long
*
)
d
);
FPU_put_user
(
control_word
&
~
0xe080
,
(
unsigned
long
__user
*
)
d
);
#else
#else
FPU_put_user
(
control_word
,
(
unsigned
short
*
)
d
);
FPU_put_user
(
control_word
,
(
unsigned
short
__user
*
)
d
);
#endif
/* PECULIAR_486 */
#endif
/* PECULIAR_486 */
FPU_put_user
(
status_word
(),
(
unsigned
short
*
)
(
d
+
2
));
FPU_put_user
(
status_word
(),
(
unsigned
short
__user
*
)
(
d
+
2
));
FPU_put_user
(
fpu_tag_word
,
(
unsigned
short
*
)
(
d
+
4
));
FPU_put_user
(
fpu_tag_word
,
(
unsigned
short
__user
*
)
(
d
+
4
));
FPU_put_user
(
instruction_address
.
offset
,
(
unsigned
short
*
)
(
d
+
6
));
FPU_put_user
(
instruction_address
.
offset
,
(
unsigned
short
__user
*
)
(
d
+
6
));
FPU_put_user
(
operand_address
.
offset
,
(
unsigned
short
*
)
(
d
+
0x0a
));
FPU_put_user
(
operand_address
.
offset
,
(
unsigned
short
__user
*
)
(
d
+
0x0a
));
if
(
addr_modes
.
default_mode
==
VM86
)
if
(
addr_modes
.
default_mode
==
VM86
)
{
{
FPU_put_user
((
instruction_address
.
offset
&
0xf0000
)
>>
4
,
FPU_put_user
((
instruction_address
.
offset
&
0xf0000
)
>>
4
,
(
unsigned
short
*
)
(
d
+
8
));
(
unsigned
short
__user
*
)
(
d
+
8
));
FPU_put_user
((
operand_address
.
offset
&
0xf0000
)
>>
4
,
FPU_put_user
((
operand_address
.
offset
&
0xf0000
)
>>
4
,
(
unsigned
short
*
)
(
d
+
0x0c
));
(
unsigned
short
__user
*
)
(
d
+
0x0c
));
}
}
else
else
{
{
FPU_put_user
(
instruction_address
.
selector
,
(
unsigned
short
*
)
(
d
+
8
));
FPU_put_user
(
instruction_address
.
selector
,
(
unsigned
short
__user
*
)
(
d
+
8
));
FPU_put_user
(
operand_address
.
selector
,
(
unsigned
short
*
)
(
d
+
0x0c
));
FPU_put_user
(
operand_address
.
selector
,
(
unsigned
short
__user
*
)
(
d
+
0x0c
));
}
}
RE_ENTRANT_CHECK_ON
;
RE_ENTRANT_CHECK_ON
;
d
+=
0x0e
;
d
+=
0x0e
;
...
@@ -1348,9 +1348,9 @@ u_char *fstenv(fpu_addr_modes addr_modes, u_char *d)
...
@@ -1348,9 +1348,9 @@ u_char *fstenv(fpu_addr_modes addr_modes, u_char *d)
}
}
void
fsave
(
fpu_addr_modes
addr_modes
,
u_char
*
data_address
)
void
fsave
(
fpu_addr_modes
addr_modes
,
u_char
__user
*
data_address
)
{
{
u_char
*
d
;
u_char
__user
*
d
;
int
offset
=
(
top
&
7
)
*
10
,
other
=
80
-
offset
;
int
offset
=
(
top
&
7
)
*
10
,
other
=
80
-
offset
;
d
=
fstenv
(
addr_modes
,
data_address
);
d
=
fstenv
(
addr_modes
,
data_address
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment