root/drivers/FPU-emu/fpu_system.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*---------------------------------------------------------------------------+
   2  |  fpu_system.h                                                             |
   3  |                                                                           |
   4  | Copyright (C) 1992,1994                                                   |
   5  |                       W. Metzenthen, 22 Parker St, Ormond, Vic 3163,      |
   6  |                       Australia.  E-mail   billm@vaxc.cc.monash.edu.au    |
   7  |                                                                           |
   8  +---------------------------------------------------------------------------*/
   9 
  10 #ifndef _FPU_SYSTEM_H
  11 #define _FPU_SYSTEM_H
  12 
  13 /* system dependent definitions */
  14 
  15 #include <linux/sched.h>
  16 #include <linux/kernel.h>
  17 
  18 /* This sets the pointer FPU_info to point to the argument part
  19    of the stack frame of math_emulate() */
  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 /* verify_area() is very expensive, and causes the emulator to run
  52    about 20% slower if applied to the code. Anyway, errors due to bad
  53    code addresses should be much rarer than errors due to bad data
  54    addresses. */
  55 #define FPU_code_verify_area(z)
  56 #else
  57 /* A simpler test than verify_area() can probably be done for
  58    FPU_code_verify_area() because the only possible error is to step
  59    past the upper boundary of a legal code area. */
  60 #define FPU_code_verify_area(z) FPU_verify_area(VERIFY_READ,(void *)FPU_EIP,z)
  61 #endif
  62 
  63 /* ######## temporary and ugly ;-) */
  64 #define FPU_data_address        ((void *)(I387.soft.twd))
  65 
  66 #endif

/* [previous][next][first][last][top][bottom][index][help] */