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_DS                  (*(unsigned short *) &(FPU_info->___ds))
  27 #define FPU_EAX                 (FPU_info->___eax)
  28 #define FPU_EFLAGS              (FPU_info->___eflags)
  29 #define FPU_EIP                 (FPU_info->___eip)
  30 #define FPU_ORIG_EIP            (FPU_info->___orig_eip)
  31 
  32 #define FPU_lookahead           (I387.soft.lookahead)
  33 #define FPU_entry_eip           (I387.soft.entry_eip)
  34 
  35 #define partial_status          (I387.soft.swd)
  36 #define control_word            (I387.soft.cwd)
  37 #define regs                    (I387.soft.regs)
  38 #define top                     (I387.soft.top)
  39 
  40 #define ip_offset               (I387.soft.fip)
  41 #define cs_selector             (I387.soft.fcs)
  42 #define data_operand_offset     (I387.soft.foo)
  43 #define operand_selector        (I387.soft.fos)
  44 
  45 #define FPU_verify_area(x,y,z)  if ( verify_area(x,y,z) ) \
  46                                 math_abort(FPU_info,SIGSEGV)
  47 
  48 #undef FPU_IGNORE_CODE_SEGV
  49 #ifdef FPU_IGNORE_CODE_SEGV
  50 /* verify_area() is very expensive, and causes the emulator to run
  51    about 20% slower if applied to the code. Anyway, errors due to bad
  52    code addresses should be much rarer than errors due to bad data
  53    addresses. */
  54 #define FPU_code_verify_area(z)
  55 #else
  56 /* A simpler test than verify_area() can probably be done for
  57    FPU_code_verify_area() because the only possible error is to step
  58    past the upper boundary of a legal code area. */
  59 #define FPU_code_verify_area(z) FPU_verify_area(VERIFY_READ,(void *)FPU_EIP,z)
  60 #endif
  61 
  62 /* ######## temporary and ugly ;-) */
  63 #define FPU_data_address        ((void *)(I387.soft.twd))
  64 
  65 #endif

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