Annotation of linux/kernel/math/math_emulate.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * linux/kernel/math/math_emulate.c
        !             3:  *
        !             4:  * (C) 1991 Linus Torvalds
        !             5:  */
        !             6: 
        !             7: /*
        !             8:  * This directory should contain the math-emulation code.
        !             9:  * Currently only results in a signal.
        !            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: /* 0x0007 means user code space */
        !            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: }

unix.superglobalmegacorp.com