1
2
3
4
5
6
7
8
9
10 #ifndef _FPU_SYSTEM_H
11 #define _FPU_SYSTEM_H
12
13
14
15 #include <linux/sched.h>
16 #include <linux/kernel.h>
17
18
19
20 #define SETUP_DATA_AREA(arg) FPU_info = (struct info *) &arg
21
22 #define I387 (current->tss.i387)
23 #define FPU_info (I387.soft.info)
24
25 #define FPU_CS (*(unsigned short *) &(FPU_info->___cs))
26 #define FPU_SS (*(unsigned short *) &(FPU_info->___ss))
27 #define FPU_DS (*(unsigned short *) &(FPU_info->___ds))
28 #define FPU_EAX (FPU_info->___eax)
29 #define FPU_EFLAGS (FPU_info->___eflags)
30 #define FPU_EIP (FPU_info->___eip)
31 #define FPU_ORIG_EIP (FPU_info->___orig_eip)
32
33 #define FPU_lookahead (I387.soft.lookahead)
34 #define FPU_entry_eip (I387.soft.entry_eip)
35
36 #define partial_status (I387.soft.swd)
37 #define control_word (I387.soft.cwd)
38 #define regs (I387.soft.regs)
39 #define top (I387.soft.top)
40
41 #define ip_offset (I387.soft.fip)
42 #define cs_selector (I387.soft.fcs)
43 #define data_operand_offset (I387.soft.foo)
44 #define operand_selector (I387.soft.fos)
45
46 #define FPU_verify_area(x,y,z) if ( verify_area(x,y,z) ) \
47 math_abort(FPU_info,SIGSEGV)
48
49 #undef FPU_IGNORE_CODE_SEGV
50 #ifdef FPU_IGNORE_CODE_SEGV
51
52
53
54
55 #define FPU_code_verify_area(z)
56 #else
57
58
59
60 #define FPU_code_verify_area(z) FPU_verify_area(VERIFY_READ,(void *)FPU_EIP,z)
61 #endif
62
63
64 #define FPU_data_address ((void *)(I387.soft.twd))
65
66 #endif