PageRenderTime 43ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/nx-3.5.0/nx-X11/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h

#
C Header | 277 lines | 147 code | 29 blank | 101 comment | 2 complexity | ffccbd8117d522717ed85317ec2c39fa MD5 | raw file
Possible License(s): BSD-3-Clause, GPL-2.0, LGPL-2.0
  1. /*
  2. * Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany
  3. * Copyright 1992 by David Dawes <dawes@XFree86.org>
  4. * Copyright 1992 by Jim Tsillas <jtsilla@damon.ccs.northeastern.edu>
  5. * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
  6. * Copyright 1992 by Robert Baron <Robert.Baron@ernst.mach.cs.cmu.edu>
  7. * Copyright 1992 by Orest Zborowski <obz@eskimo.com>
  8. * Copyright 1993 by Vrije Universiteit, The Netherlands
  9. * Copyright 1993 by David Wexelblat <dwex@XFree86.org>
  10. * Copyright 1994, 1996 by Holger Veit <Holger.Veit@gmd.de>
  11. * Copyright 1994-2003 by The XFree86 Project, Inc
  12. *
  13. * Permission to use, copy, modify, distribute, and sell this software and its
  14. * documentation for any purpose is hereby granted without fee, provided that
  15. * the above copyright notice appear in all copies and that both that
  16. * copyright notice and this permission notice appear in supporting
  17. * documentation, and that the names of the above listed copyright holders
  18. * not be used in advertising or publicity pertaining to distribution of
  19. * the software without specific, written prior permission. The above listed
  20. * copyright holders make no representations about the suitability of this
  21. * software for any purpose. It is provided "as is" without express or
  22. * implied warranty.
  23. *
  24. * THE ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD
  25. * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  26. * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDERS BE
  27. * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
  28. * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
  29. * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
  30. * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  31. *
  32. */
  33. /*
  34. * The ARM32 code here carries the following copyright:
  35. *
  36. * Copyright 1997
  37. * Digital Equipment Corporation. All rights reserved.
  38. * This software is furnished under license and may be used and copied only in
  39. * accordance with the following terms and conditions. Subject to these
  40. * conditions, you may download, copy, install, use, modify and distribute
  41. * this software in source and/or binary form. No title or ownership is
  42. * transferred hereby.
  43. *
  44. * 1) Any source code used, modified or distributed must reproduce and retain
  45. * this copyright notice and list of conditions as they appear in the
  46. * source file.
  47. *
  48. * 2) No right is granted to use any trade name, trademark, or logo of Digital
  49. * Equipment Corporation. Neither the "Digital Equipment Corporation"
  50. * name nor any trademark or logo of Digital Equipment Corporation may be
  51. * used to endorse or promote products derived from this software without
  52. * the prior written permission of Digital Equipment Corporation.
  53. *
  54. * 3) This software is provided "AS-IS" and any express or implied warranties,
  55. * including but not limited to, any implied warranties of merchantability,
  56. * fitness for a particular purpose, or non-infringement are disclaimed.
  57. * In no event shall DIGITAL be liable for any damages whatsoever, and in
  58. * particular, DIGITAL shall not be liable for special, indirect,
  59. * consequential, or incidental damages or damages for lost profits, loss
  60. * of revenue or loss of use, whether such damages arise in contract,
  61. * negligence, tort, under statute, in equity, at law or otherwise, even
  62. * if advised of the possibility of such damage.
  63. *
  64. */
  65. /* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h,v 3.56 2003/08/24 17:37:03 dawes Exp $ */
  66. #ifndef _XF86_OSPROC_H
  67. #define _XF86_OSPROC_H
  68. #ifdef XF86_OS_PRIVS
  69. #include "xf86Pci.h"
  70. #endif
  71. /*
  72. * The actual prototypes have been pulled into this seperate file so
  73. * that they can can be used without pulling in all of the OS specific
  74. * stuff like sys/stat.h, etc. This casues problem for loadable modules.
  75. */
  76. /*
  77. * Flags for xf86MapVidMem(). Multiple flags can be or'd together. The
  78. * flags may be used as hints. For example it would be permissible to
  79. * enable write combining for memory marked only for framebuffer use.
  80. */
  81. #define VIDMEM_FRAMEBUFFER 0x01 /* memory for framebuffer use */
  82. #define VIDMEM_MMIO 0x02 /* memory for I/O use */
  83. #define VIDMEM_MMIO_32BIT 0x04 /* memory accesses >= 32bit */
  84. #define VIDMEM_READSIDEEFFECT 0x08 /* reads can have side-effects */
  85. #define VIDMEM_SPARSE 0x10 /* sparse mapping required
  86. * assumed when VIDMEM_MMIO is
  87. * set. May be used with
  88. * VIDMEM_FRAMEBUFFER) */
  89. #define VIDMEM_READONLY 0x20 /* read-only mapping
  90. * used when reading BIOS images
  91. * through xf86MapVidMem() */
  92. /*
  93. * OS-independent modem state flags for xf86SetSerialModemState() and
  94. * xf86GetSerialModemState().
  95. */
  96. #define XF86_M_LE 0x001 /* line enable */
  97. #define XF86_M_DTR 0x002 /* data terminal ready */
  98. #define XF86_M_RTS 0x004 /* request to send */
  99. #define XF86_M_ST 0x008 /* secondary transmit */
  100. #define XF86_M_SR 0x010 /* secondary receive */
  101. #define XF86_M_CTS 0x020 /* clear to send */
  102. #define XF86_M_CAR 0x040 /* carrier detect */
  103. #define XF86_M_RNG 0x080 /* ring */
  104. #define XF86_M_DSR 0x100 /* data set ready */
  105. #ifdef XF86_OS_PRIVS
  106. extern void xf86WrapperInit(void);
  107. #endif
  108. #ifndef NO_OSLIB_PROTOTYPES
  109. /*
  110. * This is to prevent re-entrancy to FatalError() when aborting.
  111. * Anything that can be called as a result of AbortDDX() should use this
  112. * instead of FatalError().
  113. */
  114. #define xf86FatalError(a, b) \
  115. if (dispatchException & DE_TERMINATE) { \
  116. ErrorF(a, b); \
  117. ErrorF("\n"); \
  118. return; \
  119. } else FatalError(a, b)
  120. /***************************************************************************/
  121. /* Prototypes */
  122. /***************************************************************************/
  123. #include <X11/Xfuncproto.h>
  124. #include "opaque.h"
  125. #if defined(XQUEUE)
  126. #include "input.h" /* for DeviceIntPtr */
  127. #endif
  128. _XFUNCPROTOBEGIN
  129. /* public functions */
  130. extern Bool xf86LinearVidMem(void);
  131. extern Bool xf86CheckMTRR(int);
  132. extern pointer xf86MapVidMem(int, int, unsigned long, unsigned long);
  133. extern void xf86UnMapVidMem(int, pointer, unsigned long);
  134. extern void xf86MapReadSideEffects(int, int, pointer, unsigned long);
  135. extern int xf86ReadBIOS(unsigned long, unsigned long, unsigned char *, int);
  136. extern Bool xf86EnableIO(void);
  137. extern void xf86DisableIO(void);
  138. extern Bool xf86DisableInterrupts(void);
  139. extern void xf86EnableInterrupts(void);
  140. extern void xf86SetTVOut(int);
  141. extern void xf86SetRGBOut(void);
  142. extern void xf86SoundKbdBell(int, int, int);
  143. #if defined(QNX4)
  144. #pragma aux xf86BusToMem modify [eax ebx ecx edx esi edi];
  145. #pragma aux xf86MemToBus modify [eax ebx ecx edx esi edi];
  146. #endif
  147. extern void xf86BusToMem(unsigned char *, unsigned char *, int);
  148. extern void xf86MemToBus(unsigned char *, unsigned char *, int);
  149. extern void xf86IODelay(void);
  150. extern void xf86UDelay(long usec);
  151. extern void xf86SlowBcopy(unsigned char *, unsigned char *, int);
  152. extern int xf86OpenSerial(pointer options);
  153. extern int xf86SetSerial(int fd, pointer options);
  154. extern int xf86SetSerialSpeed(int fd, int speed);
  155. extern int xf86ReadSerial(int fd, void *buf, int count);
  156. extern int xf86WriteSerial(int fd, const void *buf, int count);
  157. extern int xf86CloseSerial(int fd);
  158. extern int xf86FlushInput(int fd);
  159. extern int xf86WaitForInput(int fd, int timeout);
  160. extern int xf86SerialSendBreak(int fd, int duration);
  161. extern int xf86SetSerialModemState(int fd, int state);
  162. extern int xf86GetSerialModemState(int fd);
  163. extern int xf86SerialModemSetBits(int fd, int bits);
  164. extern int xf86SerialModemClearBits(int fd, int bits);
  165. extern int xf86LoadKernelModule(const char *pathname);
  166. /* AGP GART interface */
  167. typedef struct _AgpInfo {
  168. CARD32 bridgeId;
  169. CARD32 agpMode;
  170. unsigned long base;
  171. unsigned long size;
  172. unsigned long totalPages;
  173. unsigned long systemPages;
  174. unsigned long usedPages;
  175. } AgpInfo, *AgpInfoPtr;
  176. extern Bool xf86AgpGARTSupported(void);
  177. extern AgpInfoPtr xf86GetAGPInfo(int screenNum);
  178. extern Bool xf86AcquireGART(int screenNum);
  179. extern Bool xf86ReleaseGART(int screenNum);
  180. extern int xf86AllocateGARTMemory(int screenNum, unsigned long size, int type,
  181. unsigned long *physical);
  182. extern Bool xf86DeallocateGARTMemory(int screenNum, int key);
  183. extern Bool xf86BindGARTMemory(int screenNum, int key, unsigned long offset);
  184. extern Bool xf86UnbindGARTMemory(int screenNum, int key);
  185. extern Bool xf86EnableAGP(int screenNum, CARD32 mode);
  186. extern Bool xf86GARTCloseScreen(int screenNum);
  187. /* These routines are in shared/sigio.c and are not loaded as part of the
  188. module. These routines are small, and the code if very POSIX-signal (or
  189. OS-signal) specific, so it seemed better to provide more complex
  190. wrappers than to wrap each individual function called. */
  191. extern int xf86InstallSIGIOHandler(int fd, void (*f)(int, void *), void *);
  192. extern int xf86RemoveSIGIOHandler(int fd);
  193. extern int xf86BlockSIGIO (void);
  194. extern void xf86UnblockSIGIO (int);
  195. #ifdef XFree86Server
  196. extern void xf86AssertBlockedSIGIO (char *);
  197. #endif
  198. extern Bool xf86SIGIOSupported (void);
  199. #ifdef XF86_OS_PRIVS
  200. typedef void (*PMClose)(void);
  201. extern void xf86OpenConsole(void);
  202. extern void xf86CloseConsole(void);
  203. extern Bool xf86VTSwitchPending(void);
  204. extern Bool xf86VTSwitchAway(void);
  205. extern Bool xf86VTSwitchTo(void);
  206. extern void xf86VTRequest(int sig);
  207. extern int xf86ProcessArgument(int, char **, int);
  208. extern void xf86UseMsg(void);
  209. extern void xf86SetKbdLeds(int);
  210. extern int xf86GetKbdLeds(void);
  211. extern void xf86SetKbdRepeat(char);
  212. extern void xf86KbdInit(void);
  213. extern int xf86KbdOn(void);
  214. extern int xf86KbdOff(void);
  215. extern void xf86KbdEvents(void);
  216. #ifdef XQUEUE
  217. extern int xf86XqueKbdProc(DeviceIntPtr, int);
  218. extern void xf86XqueEvents(void);
  219. #endif
  220. extern void xf86ReloadInputDevs(int sig);
  221. #ifdef WSCONS_SUPPORT
  222. extern void xf86WSKbdEvents(void);
  223. #endif
  224. extern PMClose xf86OSPMOpen(void);
  225. #ifdef NEED_OS_RAC_PROTOS
  226. /* RAC-related privs */
  227. /* internal to os-support layer */
  228. resPtr xf86StdBusAccWindowsFromOS(void);
  229. resPtr xf86StdPciAccWindowsFromOS(void);
  230. resPtr xf86StdIsaAccWindowsFromOS(void);
  231. resPtr xf86StdAccResFromOS(resPtr ret);
  232. /* available to the common layer */
  233. resPtr xf86BusAccWindowsFromOS(void);
  234. resPtr xf86PciBusAccWindowsFromOS(void);
  235. #ifdef INCLUDE_UNUSED
  236. resPtr xf86IsaBusAccWindowsFromOS(void);
  237. #endif
  238. resPtr xf86AccResFromOS(resPtr ret);
  239. #endif /* NEED_OS_RAC_PROTOS */
  240. extern Bool xf86GetPciSizeFromOS(PCITAG tag, int indx, int* bits);
  241. extern Bool xf86GetPciOffsetFromOS(PCITAG tag, int indx, unsigned long* bases);
  242. extern unsigned long xf86GetOSOffsetFromPCI(PCITAG tag, int space, unsigned long base);
  243. extern void xf86MakeNewMapping(int, int, unsigned long, unsigned long, pointer);
  244. extern void xf86InitVidMem(void);
  245. #endif /* XF86_OS_PRIVS */
  246. _XFUNCPROTOEND
  247. #endif /* NO_OSLIB_PROTOTYPES */
  248. #endif /* _XF86_OSPROC_H */