home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / UNIX3862.ZIP / U386-06.ZIP / U386-6.TD0 / usr / include / sys / weitek.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-26  |  2.7 KB  |  88 lines

  1. /*    Copyright (c) 1984, 1986, 1987, 1988 AT&T    */
  2. /*      All Rights Reserved      */
  3.  
  4. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T    */
  5. /*    The copyright notice above does not evidence any       */
  6. /*    actual or intended publication of such source code.    */
  7.  
  8.  
  9. #ident    "@(#)head.sys:weitek.h    1.4"
  10.  
  11. /*
  12.  * Weitek floating point processor definitions
  13.  */
  14.  
  15. #define WEITEK_VADDR 0xFFC00000
  16. #define WEITEK_ADDRS 0xFFFF0000
  17. #define WEITEK_SIZE  0x00010000
  18. #define WEITEK_MAXADDR (WEITEK_VADDR + WEITEK_SIZE - 1)
  19.  
  20. /*
  21.  * masks for accumulated exception byte
  22.  */
  23. #define    WFPDE    0x00000080    /* data chain exception            */
  24. #define    WFPUOE    0x00000040    /* unimplemented opcode            */
  25. #define    WFPPE    0x00000020    /* precision                */
  26. #define    WFPUE    0x00000010    /* underflow                */
  27. #define    WFPOE    0x00000008    /* overflow                */
  28. #define    WFPZE    0x00000004    /* zero divide                */
  29. #define    WFPEE    0x00000002    /* enabled exception            */
  30. #define WFPIE    0x00000001    /* invalid operation            */
  31.  
  32. /*
  33.  * Define all of the execption bits and the number of bits to left-shift
  34.  * to turn exception bits into exception mask bits.
  35.  */
  36. #define    WFPAE        0x000000FD
  37. #define    WFPAEEM_SHFT    16
  38.  
  39. /*
  40.  *  masks for process context register exception mask byte
  41.  */
  42. #define    WFPDM    0x00800000    /* data chain exception    */
  43. #define    WFPUOM    0x00400000    /* unimplemented opcode    */
  44. #define    WFPPM    0x00200000    /* precision        */
  45. #define    WFPUM    0x00100000    /* underflow        */
  46. #define    WFPOM    0x00080000    /* overflow        */
  47. #define    WFPZM    0x00040000    /* zero divide        */
  48. #define    WFPIM    0x00010000    /* invalid operation    */
  49. #define WFPB17    0x00020000    /* bit 17 always set    */
  50.  
  51. /*
  52.  *  rounding modes for process context register
  53.  */
  54. #define    WFPRN    0x00000000    /* round to nearest value        */
  55. #define    WFPRZ    0x04000000    /* round toward zero            */
  56. #define    WFPRP    0x08000000    /* round toward positive infinity    */
  57. #define    WFPRM    0x0C000000    /* round toward negative infinity    */
  58. #define WFPRIS    0x00000000    /* round to integer based on RND    */
  59. #define WFPRIZ    0x02000000    /* round integer to zero always        */
  60. #define WFPB24    0x01000000      /* bit 24 always set                    */
  61.  
  62. extern char        weitek_kind;
  63. #define    WEITEK_NO    0    /* no chip support    */
  64. #define    WEITEK_HW    1    /* chip present        */
  65. #define    WEITEK_SW    2    /* emulator present    */
  66.  
  67. extern struct proc    *weitek_proc;
  68. extern unsigned long    weitek_paddr;
  69. extern void        save_weitek();
  70. extern void        restore_weitek();
  71. extern int        weitek_debug;
  72.  
  73. /* Definitions for the Weitek emulator */
  74.  
  75. #define PCR_INTR  0x00000002l
  76.  
  77. struct ctxt_type {
  78.    long REGISTERS[32]; /* The 1167 register file */
  79.    long PCR;           /* The current PCR register */
  80. };
  81.  
  82. /* Short hand defines to access the registers and pcr from the structure */
  83. #define registers ctxt -> REGISTERS
  84. #define pcr       ctxt -> PCR
  85.  
  86. /* global mapping to weitek physical space */
  87. extern struct region *weitek_reg;
  88.