home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / x / xibm.zip / mpel / mpelHdwr.h < prev    next >
C/C++ Source or Header  |  1990-11-19  |  9KB  |  259 lines

  1. /*
  2.  * Copyright IBM Corporation 1987,1988,1989
  3.  *
  4.  * All Rights Reserved
  5.  *
  6.  * Permission to use, copy, modify, and distribute this software and its
  7.  * documentation for any purpose and without fee is hereby granted,
  8.  * provided that the above copyright notice appear in all copies and that 
  9.  * both that copyright notice and this permission notice appear in
  10.  * supporting documentation, and that the name of IBM not be
  11.  * used in advertising or publicity pertaining to distribution of the
  12.  * software without specific, written prior permission.
  13.  *
  14.  * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  15.  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  16.  * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  17.  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  18.  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  19.  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  20.  * SOFTWARE.
  21.  *
  22. */
  23. #ifndef MPEL_HDWR_SEEN
  24. #define    MPEL_HDWR_SEEN 1
  25. /***********************************************************
  26.         Copyright IBM Corporation 1987,1988
  27.  
  28.                       All Rights Reserved
  29.  
  30. Permission to use, copy, modify, and distribute this software and its 
  31. documentation for any purpose and without fee is hereby granted, 
  32. provided that the above copyright notice appear in all copies and that
  33. both that copyright notice and this permission notice appear in 
  34. supporting documentation, and that the name of IBM not be
  35. used in advertising or publicity pertaining to distribution of the
  36. software without specific, written prior permission.  
  37.  
  38. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  39. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  40. IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  41. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  42. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  43. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  44. SOFTWARE.
  45.  
  46. ******************************************************************/
  47.  
  48. /* $Header: /afs/rel-eng.athena.mit.edu/project/x11r4/src/mit/server/ddx/ibm/mpel/RCS/mpelHdwr.h,v 1.4 90/11/19 15:40:33 probe Exp $ */
  49. /* $Source: /afs/rel-eng.athena.mit.edu/project/x11r4/src/mit/server/ddx/ibm/mpel/RCS/mpelHdwr.h,v $ */
  50.  
  51. #if defined(RCS_HDRS) && !defined(lint)
  52. static char *rcsidmpelhdwr = "$Header: /afs/rel-eng.athena.mit.edu/project/x11r4/src/mit/server/ddx/ibm/mpel/RCS/mpelHdwr.h,v 1.4 90/11/19 15:40:33 probe Exp $";
  53. #endif
  54.  
  55.  
  56.     /*
  57.      * System addresses of bounds of adapter data and program areas
  58.      */
  59.  
  60. #define    MPEL_LOWDATA        ((volatile unsigned short int *)0xf4c00000)
  61. #define    MPEL_HIGHDATA        ((volatile unsigned short int *)0xf4c3ffff)
  62.  
  63. #define MPEL_MMAP        0xf4000000
  64.  
  65. #define BANK2START        0xf4c20000
  66. #define BANK3START        0xf4c30000
  67. #define BANK2MPEL        0x02008000
  68. #define BANK3MPEL        0x03008000
  69.  
  70. #define    MPEL_LOWPROGRAM        ((volatile unsigned short int *)0xf4d60000)
  71. #define    MPEL_HIGHPROGRAM    ((volatile unsigned short int *)0xf4d7ffff)
  72.  
  73.     /*
  74.      * system addresses of:
  75.      *    PCR= Primary Control Register
  76.      *    PSR= Primary Status Register
  77.      *      CA_PTR=  Communications Area Pointer
  78.      *    COMM_REQ= Communications Area Request Field
  79.      *    COMM_REASON= Communications Area Reason Field
  80.      *    COMM_PARM_ADDR= Communications Area Parameter Field Address
  81.      *    FIFO= Command Fifo
  82.      *    IPR= Interrupt Pending Register
  83.      */
  84.  
  85. #define    MPEL_PCR        (*((volatile unsigned short int *)0xf0000948))
  86. #define    MPEL_PSR        (*((volatile unsigned short int *)0xf000094a))
  87. #define    MPEL_CA_PTR        (*((volatile unsigned long int *)0xf4c008e0))
  88. #define MPEL_COMM_REQ        (*((volatile unsigned short int *)0xf4c00902))
  89. #define MPEL_COMM_REASON    (*((volatile unsigned short int *)0xf4c00904))
  90. #define MPEL_COMM_PARM_ADDR    ((volatile unsigned short int *)0xf4c00954)
  91. #define    MPEL_ATF_LOC_PTR    (*((volatile unsigned long int *)0xf4c00920))
  92. #define MPEL_STATE_LIST_PTR    (*((volatile unsigned long int *)0xf4c00908))
  93. #define MPEL_FIFO        (*((volatile unsigned short int *)0xf000094e))
  94. #define MPEL_IPR        (*((volatile unsigned short int *)0xf0000940))
  95.  
  96.     /*
  97.      * Masks for fields in PCR and PSR:
  98.      */
  99.  
  100. #define    PCR_HOLD        0x0100
  101. #define    PCR_RESET_TMS        0x0200
  102. #define PCR_INTR_TMS        0x0400
  103. #define    PCR_BYTE_ORDER        0x0800
  104. #define    PCR_DMA_LVL0        0x1000
  105. #define    PCR_DMA_LVL1        0x2000
  106. #define    PCR_DMA_ENABLE        0x4000
  107. #define PCR_ENABLE_TMS_INTR    0x0001
  108. #define    PCR_ENABLE_PP_INTR    0x0002
  109. #define    PCR_ENABLE_OVFLW_INTR    0x0004
  110. #define    PCR_ENABLE_HE_INTR    0x0008
  111. #define    PCR_ENABLE_HF_INTR    0x0010
  112.  
  113. #define    PSR_NOT_HOLD_ACK    0x0100
  114. #define    PSR_INTR_PENDING    0x0200
  115. #define    PSR_FIFO_NOT_FULL    0x2000
  116. #define    PSR_FIFO_NOT_HALF_FULL    0x4000
  117. #define    PSR_FIFO_NOT_EMPTY    0x8000
  118. #define    PSR_FIFO_FLAGS        0xe000
  119.  
  120.     /*
  121.      * Data/microcode files, and where (on the adapter) to load them
  122.      */
  123.  
  124. #ifdef ATHENA
  125. #define    MPEL_UCODE_FILE        "/usr/mpel/mcr1v001.bin"
  126. #define    MPEL_CIRCLE_FILE    "/usr/mpel/cirtab.dat"
  127. #define    MPEL_SINE_FILE        "/usr/mpel/sintab.dat"
  128. #define    MPEL_MARKER_LOC_FILE    "/usr/mpel/markid.dat"
  129. #define    MPEL_HATCH_FILE        "/usr/mpel/hchtab.dat"
  130. #define    MPEL_MARKER_FNT_FILE    "/usr/mpel/marker.dat"
  131. #endif
  132.  
  133. #define    MPEL_UCODE_ADDR        ((volatile unsigned short int *)0xf4d60000)
  134. #ifndef MPEL_UCODE_FILE
  135. #define    MPEL_UCODE_FILE        "/usr/lib/mpel/mcr1v001.bin"
  136. #endif
  137.  
  138. #define    MPEL_CIRCLE_ADDR    ((volatile unsigned short int *)0xf4c01e00)
  139. #ifndef MPEL_CIRCLE_FILE
  140. #define    MPEL_CIRCLE_FILE    "/usr/lib/mpel/cirtab.dat"
  141. #endif
  142.  
  143. #define    MPEL_SINE_ADDR        ((volatile unsigned short int *)0xf4c02e00)
  144. #ifndef MPEL_SINE_FILE
  145. #define    MPEL_SINE_FILE        "/usr/lib/mpel/sintab.dat"
  146. #endif
  147.  
  148. #define    MPEL_MARKER_LOC_ADDR    ((volatile unsigned short int *)0xf4c07360)
  149. #ifndef MPEL_MARKER_LOC_FILE
  150. #define    MPEL_MARKER_LOC_FILE    "/usr/lib/mpel/markid.dat"
  151. #endif
  152.  
  153. #define    MPEL_HATCH_ADDR        ((volatile unsigned short int *)0xf4c07ca0)
  154. #ifndef MPEL_HATCH_FILE
  155. #define    MPEL_HATCH_FILE        "/usr/lib/mpel/hchtab.dat"
  156. #endif
  157.  
  158. #define    MPEL_MARKER_FNT_ADDR    ((volatile unsigned short int *)0xf4c04f00)
  159. #ifndef MPEL_MARKER_FNT_FILE
  160. #define    MPEL_MARKER_FNT_FILE    "/usr/lib/mpel/marker.dat"
  161. #endif
  162.  
  163.  
  164. /*
  165.  * This macro converts an RT address of the form 0xf4c????? and 
  166.  * converts it to a megapel address.  For constants all of this
  167.  * should get done at compile time.
  168.  * WARNING: this macro evaluates its argument several times, 
  169.  *   beware args with side effects.
  170.  */
  171.  
  172. #define mpelAddr(x) \
  173.     ( ( ( ( ( (unsigned long int) (x) ) & 0x00030000 ) << 8 ) \
  174.     | ( ( ( (unsigned long int) (x) ) >> 1 ) & 0x00007fff ) ) \
  175.     + ( ( ( (unsigned long int) (x) ) & 0x00030000 ) ? 0x8000 : 0 ) )
  176.  
  177. #define rtAddr(x) \
  178.     ( (volatile unsigned short int *)( ( ( (unsigned long )(x) & 0x03000000 ) >> 8 ) \
  179.     | ( ( (unsigned long )(x) & 0x00007fff ) << 1 ) \
  180.     | ( 0xf4c00000 ) ) )
  181.  
  182.  
  183. /*
  184.  * Megapel offscreen memory usage for bank 1
  185.  */
  186.  
  187. /* 256 bytes for each Pattern area */
  188. #define MPEL_PAT1        ((volatile unsigned short int *)0xf4c10000)
  189. #define MPEL_PAT2        ((volatile unsigned short int *)0xf4c10100)
  190. #define MPEL_PAT3        ((volatile unsigned short int *)0xf4c10200)
  191. #define MPEL_PAT4        ((volatile unsigned short int *)0xf4c10300)
  192. /* 1024 bytes for each the cursor save area */
  193. #define MPEL_CURSOR_SAVE    ((volatile unsigned short int *)0xf4c10400)
  194. /* 1028 bytes for each the color table area */
  195. #define MPEL_COLOR_TABLE    ((volatile unsigned short int *)0xf4c10800)
  196. /* 36 bytes for each the pattern table area */
  197. #define MPEL_PAT_TABLE        ((volatile unsigned short int *)0xf4c10c04)
  198. /* 61440 bytes for each the blit staging area */
  199. #define MPEL_BLIT_STAGE        ((volatile unsigned short int *)0xf4c11000)
  200. #define MPEL_BLIT_STAGE_SIZE    0xf000
  201.  
  202. /*
  203.  * Megapel offscreen memory usage for bank 2
  204.  */
  205.  
  206. #define    MPEL_ATF_REGION        BANK2START
  207.  
  208. /*
  209.  * Megapel command definitions
  210.  */
  211.  
  212. #define MPELCMD_ENTER_FIFO      0x02
  213. #define MPELCMD_SET_PICK        0x06
  214. #define MPELCMD_STOP_FIFO       0x0a
  215. #define MPELCMD_CONT_FIFO       0x0c
  216. #define MPELCMD_ACT_CUR         0x10
  217. #define MPELCMD_DEF_CUR         0x12
  218. #define MPELCMD_REM_CUR         0x14
  219. #define MPELCMD_CLEAR_FB        0x16
  220. #define MPELCMD_LOAD_CMAP       0x20
  221. #define MPELCMD_FLUSH_FIFO      0x22
  222. #define MPELCMD_SET_PICK_WIN    0x26
  223. #define MPELCMD_RESET_PICK      0x28
  224. #define MPELCMD_SET_BLINK       0x2c
  225. #define MPELCMD_RESET_BLINK     0x2e
  226.  
  227. /*
  228.  * Megapel reason codes
  229.  */
  230.  
  231. #define    MPELRSN_RESET        0x00
  232. #define    MPELRSN_INIT_DONE    0x01
  233. #define MPELRSN_ENTER_FIFO_DONE    0x03
  234. #define    MPELRSN_SET_PICK_DONE    0x07
  235. #define    MPELRSN_STOP_FIFO_DONE    0x0b
  236. #define    MPELRSN_CONT_FIFO_DONE    0x0d
  237. #define    MPELRSN_ACT_CUR_DONE    0x11
  238. #define    MPELRSN_DEF_CUR_DONE    0x13
  239. #define    MPELRSN_REM_CUR_DONE    0x15
  240. #define    MPELRSN_CLEAR_FB_DONE    0x17
  241. #define    MPELRSN_LOAD_CMAP_DONE    0x21
  242. #define    MPELRSN_FLUSH_FIFO_DONE    0x23
  243. #define    MPELRSN_SET_PICK_WIN_DONE    0x27
  244. #define    MPELRSN_RESET_PICK_DONE    0x29
  245. #define    MPELRSN_SET_BLINK_DONE    0x2d
  246. #define    MPELRSN_RESET_BLINK_DONE    0x2f
  247. #define    MPELRSN_PICK_OCCURRED    0x43
  248. #define    MPELRSN_ILLEGAL_REQUEST    0x53
  249. #define    MPELRSN_ILLEGAL_ELEMENT    0x55
  250. #define    MPELRSN_SYNC_ELEMENT    0x57
  251. #define    MPELRSN_FIFO_FLUSH_ERR    0x200
  252. #define    MPELRSN_BAD_STR_LEN    0x201
  253. #define    MPELRSN_NO_FONT        0x203
  254.  
  255. #define    DRAW_EDGE    1
  256. #define    DONT_DRAW_EDGE    2
  257.  
  258. #endif /* ndef MPEL_HDWR_SEEN */
  259.