home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 9.ddi / usr / include / sys / weitek.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  2.9 KB  |  94 lines

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