(file) Return to atiio.h CVS log (file) (dir) Up to [XFree86 CVS] / xc / programs / Xserver / hw / xfree86 / drivers / ati

 1 tsi   1.15 /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiio.h,v 1.14 2003/01/01 19:16:32 tsi Exp $ */
 2 hohndel 1.1  /*
 3 tsi     1.15  * Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
 4 hohndel 1.1   *
 5               * Permission to use, copy, modify, distribute, and sell this software and its
 6               * documentation for any purpose is hereby granted without fee, provided that
 7               * the above copyright notice appear in all copies and that both that copyright
 8               * notice and this permission notice appear in supporting documentation, and
 9               * that the name of Marc Aurele La France not be used in advertising or
10               * publicity pertaining to distribution of the software without specific,
11               * written prior permission.  Marc Aurele La France makes no representations
12               * about the suitability of this software for any purpose.  It is provided
13               * "as-is" without express or implied warranty.
14               *
15               * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16               * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO
17               * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18               * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
19               * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
20               * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
21               * PERFORMANCE OF THIS SOFTWARE.
22               */
23              
24              #ifndef ___ATIIO_H___
25 tsi     1.8  
26              #if !defined(___ATI_H___) && defined(XFree86Module)
27              # error missing #include "ati.h" before #include "atiio.h"
28              # undef XFree86Module
29              #endif
30              
31 hohndel 1.1  #define ___ATIIO_H___ 1
32              
33 tsi     1.10 #include "atiregs.h"
34 tsi     1.8  
35 hohndel 1.1  #include "compiler.h"
36              
37              /* I/O decoding definitions */
38 dawes   1.3  typedef enum
39              {
40                  SPARSE_IO,
41                  BLOCK_IO
42              } ATIIODecodingType;
43              
44 tsi     1.8  #ifndef AVOID_CPIO
45 dawes   1.3  
46 hohndel 1.1  /* Wait until "n" queue entries are free */
47 dawes   1.3  #define ibm8514WaitQueue(_n)                      \
48                  {                                             \
49                      while (inw(GP_STAT) & (0x0100U >> (_n))); \
50                  }
51 dawes   1.4  #define ATIWaitQueue(_n)                                    \
52                  {                                                       \
53                      while (inw(EXT_FIFO_STATUS) & (0x010000U >> (_n))); \
54 dawes   1.3      }
55 hohndel 1.1  
56              /* Wait until GP is idle and queue is empty */
57 dawes   1.3  #define WaitIdleEmpty()                      \
58                  {                                        \
59                      while (inw(GP_STAT) & (GPBUSY | 1)); \
60                  }
61 tsi     1.6  #define ProbeWaitIdleEmpty()              \
62                  {                                     \
63                      int _i;                           \
64                      CARD16 _value;                    \
65                      for (_i = 0;  _i < 100000;  _i++) \
66                      {                                 \
67                          _value = inw(GP_STAT);        \
68                          if (_value == (CARD16)(-1))   \
69                              break;                    \
70                          if (!(_value & (GPBUSY | 1))) \
71                              break;                    \
72                      }                                 \
73 dawes   1.3      }
74 hohndel 1.1  
75              /* Wait until GP has data available */
76 dawes   1.3  #define WaitDataReady()                    \
77                  {                                      \
78                      while (!(inw(GP_STAT) & DATARDY)); \
79                  }
80 tsi     1.10 
81              #endif /* AVOID_CPIO */
82 hohndel 1.1  
83              #endif /* ___ATIIO_H___ */

Powered by
ViewCVS 0.9.2