This source file includes following definitions.
- math_emulate
- math_error
1
2
3
4
5
6
7
8
9
10
11
12 #include <signal.h>
13
14 #include <linux/sched.h>
15 #include <linux/kernel.h>
16 #include <asm/segment.h>
17
18 void math_emulate(long edi, long esi, long ebp, long sys_call_ret,
19 long eax,long ebx,long ecx,long edx,
20 unsigned short fs,unsigned short es,unsigned short ds,
21 unsigned long eip,unsigned short cs,unsigned long eflags,
22 unsigned short ss, unsigned long esp)
23 {
24 unsigned char first, second;
25
26
27 if (cs != 0x000F) {
28 printk("math_emulate: %04x:%08x\n\r",cs,eip);
29 panic("Math emulation needed in kernel");
30 }
31 first = get_fs_byte((char *)((*&eip)++));
32 second = get_fs_byte((char *)((*&eip)++));
33 printk("%04x:%08x %02x %02x\n\r",cs,eip-2,first,second);
34 current->signal |= 1<<(SIGFPE-1);
35 }
36
37 void math_error(void)
38 {
39 __asm__("fnclex");
40 if (last_task_used_math)
41 last_task_used_math->signal |= 1<<(SIGFPE-1);
42 }