PageRenderTime 44ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/hw/xfree86/os-support/xf86_OSproc.h

https://github.com/cubanismo/xserver
C Header | 231 lines | 111 code | 23 blank | 97 comment | 2 complexity | db23217c979325fc0698c62159087a62 MD5 | raw file
Possible License(s): MIT
  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. #ifndef _XF86_OSPROC_H
  66. #define _XF86_OSPROC_H
  67. /*
  68. * The actual prototypes have been pulled into this seperate file so
  69. * that they can can be used without pulling in all of the OS specific
  70. * stuff like sys/stat.h, etc. This casues problem for loadable modules.
  71. */
  72. /*
  73. * Flags for xf86MapVidMem(). Multiple flags can be or'd together. The
  74. * flags may be used as hints. For example it would be permissible to
  75. * enable write combining for memory marked only for framebuffer use.
  76. */
  77. #define VIDMEM_FRAMEBUFFER 0x01 /* memory for framebuffer use */
  78. #define VIDMEM_MMIO 0x02 /* memory for I/O use */
  79. #define VIDMEM_MMIO_32BIT 0x04 /* memory accesses >= 32bit */
  80. #define VIDMEM_READSIDEEFFECT 0x08 /* reads can have side-effects */
  81. #define VIDMEM_SPARSE 0x10 /* sparse mapping required
  82. * assumed when VIDMEM_MMIO is
  83. * set. May be used with
  84. * VIDMEM_FRAMEBUFFER) */
  85. #define VIDMEM_READONLY 0x20 /* read-only mapping
  86. * used when reading BIOS images
  87. * through xf86MapVidMem() */
  88. /*
  89. * OS-independent modem state flags for xf86SetSerialModemState() and
  90. * xf86GetSerialModemState().
  91. */
  92. #define XF86_M_LE 0x001 /* line enable */
  93. #define XF86_M_DTR 0x002 /* data terminal ready */
  94. #define XF86_M_RTS 0x004 /* request to send */
  95. #define XF86_M_ST 0x008 /* secondary transmit */
  96. #define XF86_M_SR 0x010 /* secondary receive */
  97. #define XF86_M_CTS 0x020 /* clear to send */
  98. #define XF86_M_CAR 0x040 /* carrier detect */
  99. #define XF86_M_RNG 0x080 /* ring */
  100. #define XF86_M_DSR 0x100 /* data set ready */
  101. #ifndef NO_OSLIB_PROTOTYPES
  102. /*
  103. * This is to prevent re-entrancy to FatalError() when aborting.
  104. * Anything that can be called as a result of AbortDDX() should use this
  105. * instead of FatalError().
  106. */
  107. #define xf86FatalError(a, b) \
  108. if (dispatchException & DE_TERMINATE) { \
  109. ErrorF(a, b); \
  110. ErrorF("\n"); \
  111. return; \
  112. } else FatalError(a, b)
  113. /***************************************************************************/
  114. /* Prototypes */
  115. /***************************************************************************/
  116. #include <X11/Xfuncproto.h>
  117. #include "opaque.h"
  118. #include "xf86Optionstr.h"
  119. _XFUNCPROTOBEGIN
  120. /* public functions */
  121. extern _X_EXPORT Bool xf86LinearVidMem(void);
  122. extern _X_EXPORT _X_DEPRECATED Bool xf86CheckMTRR(int);
  123. extern _X_EXPORT _X_DEPRECATED void *xf86MapVidMem(int, int, unsigned long,
  124. unsigned long);
  125. extern _X_EXPORT _X_DEPRECATED void xf86UnMapVidMem(int, void *,
  126. unsigned long);
  127. extern _X_EXPORT int xf86ReadBIOS(unsigned long, unsigned long, unsigned char *,
  128. int);
  129. extern _X_EXPORT Bool xf86EnableIO(void);
  130. extern _X_EXPORT void xf86DisableIO(void);
  131. #ifdef __NetBSD__
  132. extern _X_EXPORT void xf86SetTVOut(int);
  133. extern _X_EXPORT void xf86SetRGBOut(void);
  134. #endif
  135. extern _X_EXPORT void xf86OSRingBell(int, int, int);
  136. extern _X_EXPORT void xf86SetReallySlowBcopy(void);
  137. extern _X_EXPORT void xf86SlowBcopy(unsigned char *, unsigned char *, int);
  138. extern _X_EXPORT int xf86OpenSerial(XF86OptionPtr options);
  139. extern _X_EXPORT int xf86SetSerial(int fd, XF86OptionPtr options);
  140. extern _X_EXPORT int xf86SetSerialSpeed(int fd, int speed);
  141. extern _X_EXPORT int xf86ReadSerial(int fd, void *buf, int count);
  142. extern _X_EXPORT int xf86WriteSerial(int fd, const void *buf, int count);
  143. extern _X_EXPORT int xf86CloseSerial(int fd);
  144. extern _X_EXPORT int xf86FlushInput(int fd);
  145. extern _X_EXPORT int xf86WaitForInput(int fd, int timeout);
  146. extern _X_EXPORT int xf86SerialSendBreak(int fd, int duration);
  147. extern _X_EXPORT int xf86SetSerialModemState(int fd, int state);
  148. extern _X_EXPORT int xf86GetSerialModemState(int fd);
  149. extern _X_EXPORT int xf86SerialModemSetBits(int fd, int bits);
  150. extern _X_EXPORT int xf86SerialModemClearBits(int fd, int bits);
  151. extern _X_EXPORT int xf86LoadKernelModule(const char *pathname);
  152. /* AGP GART interface */
  153. typedef struct _AgpInfo {
  154. CARD32 bridgeId;
  155. CARD32 agpMode;
  156. unsigned long base;
  157. unsigned long size;
  158. unsigned long totalPages;
  159. unsigned long systemPages;
  160. unsigned long usedPages;
  161. } AgpInfo, *AgpInfoPtr;
  162. extern _X_EXPORT Bool xf86AgpGARTSupported(void);
  163. extern _X_EXPORT AgpInfoPtr xf86GetAGPInfo(int screenNum);
  164. extern _X_EXPORT Bool xf86AcquireGART(int screenNum);
  165. extern _X_EXPORT Bool xf86ReleaseGART(int screenNum);
  166. extern _X_EXPORT int xf86AllocateGARTMemory(int screenNum, unsigned long size,
  167. int type, unsigned long *physical);
  168. extern _X_EXPORT Bool xf86DeallocateGARTMemory(int screenNum, int key);
  169. extern _X_EXPORT Bool xf86BindGARTMemory(int screenNum, int key,
  170. unsigned long offset);
  171. extern _X_EXPORT Bool xf86UnbindGARTMemory(int screenNum, int key);
  172. extern _X_EXPORT Bool xf86EnableAGP(int screenNum, CARD32 mode);
  173. extern _X_EXPORT Bool xf86GARTCloseScreen(int screenNum);
  174. /* These routines are in shared/sigio.c and are not loaded as part of the
  175. module. These routines are small, and the code if very POSIX-signal (or
  176. OS-signal) specific, so it seemed better to provide more complex
  177. wrappers than to wrap each individual function called. */
  178. extern _X_EXPORT int xf86InstallSIGIOHandler(int fd, void (*f) (int, void *),
  179. void *);
  180. extern _X_EXPORT int xf86RemoveSIGIOHandler(int fd);
  181. extern _X_EXPORT int xf86BlockSIGIO(void);
  182. extern _X_EXPORT void xf86UnblockSIGIO(int);
  183. extern _X_EXPORT void xf86AssertBlockedSIGIO(char *);
  184. extern _X_EXPORT Bool xf86SIGIOSupported(void);
  185. #ifdef XF86_OS_PRIVS
  186. typedef void (*PMClose) (void);
  187. extern _X_EXPORT void xf86OpenConsole(void);
  188. extern _X_EXPORT void xf86CloseConsole(void);
  189. extern _X_HIDDEN Bool xf86VTActivate(int vtno);
  190. extern _X_EXPORT Bool xf86VTSwitchPending(void);
  191. extern _X_EXPORT Bool xf86VTSwitchAway(void);
  192. extern _X_EXPORT Bool xf86VTSwitchTo(void);
  193. extern _X_EXPORT void xf86VTRequest(int sig);
  194. extern _X_EXPORT int xf86ProcessArgument(int, char **, int);
  195. extern _X_EXPORT void xf86UseMsg(void);
  196. extern _X_EXPORT PMClose xf86OSPMOpen(void);
  197. extern _X_EXPORT void xf86InitVidMem(void);
  198. #endif /* XF86_OS_PRIVS */
  199. #ifdef XSERVER_PLATFORM_BUS
  200. #include "hotplug.h"
  201. void
  202. xf86PlatformDeviceProbe(struct OdevAttributes *attribs);
  203. void
  204. xf86PlatformReprobeDevice(int index, struct OdevAttributes *attribs);
  205. #endif
  206. _XFUNCPROTOEND
  207. #endif /* NO_OSLIB_PROTOTYPES */
  208. #endif /* _XF86_OSPROC_H */