VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.6.5/xf86_OSlib.h@ 78293

Last change on this file since 78293 was 49174, checked in by vboxsync, 11 years ago

Additions/x11: replace header files for X.Org Server 1.6.0 with those for version 1.6.5 due to an ABI bump in-between.

  • Property svn:eol-style set to native
File size: 13.9 KB
Line 
1/*
2 * Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany
3 * Copyright 1992 by David Dawes <[email protected]>
4 * Copyright 1992 by Jim Tsillas <[email protected]>
5 * Copyright 1992 by Rich Murphey <[email protected]>
6 * Copyright 1992 by Robert Baron <[email protected]>
7 * Copyright 1992 by Orest Zborowski <[email protected]>
8 * Copyright 1993 by Vrije Universiteit, The Netherlands
9 * Copyright 1993 by David Wexelblat <[email protected]>
10 * Copyright 1994, 1996 by Holger Veit <[email protected]>
11 * Copyright 1997 by Takis Psarogiannakopoulos <[email protected]>
12 * Copyright 1994-2003 by The XFree86 Project, Inc
13 *
14 * Permission to use, copy, modify, distribute, and sell this software and its
15 * documentation for any purpose is hereby granted without fee, provided that
16 * the above copyright notice appear in all copies and that both that
17 * copyright notice and this permission notice appear in supporting
18 * documentation, and that the names of the above listed copyright holders
19 * not be used in advertising or publicity pertaining to distribution of
20 * the software without specific, written prior permission. The above listed
21 * copyright holders make no representations about the suitability of this
22 * software for any purpose. It is provided "as is" without express or
23 * implied warranty.
24 *
25 * THE ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD
26 * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
27 * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDERS BE
28 * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
29 * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
30 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
31 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
32 *
33 */
34
35/*
36 * The ARM32 code here carries the following copyright:
37 *
38 * Copyright 1997
39 * Digital Equipment Corporation. All rights reserved.
40 * This software is furnished under license and may be used and copied only in
41 * accordance with the following terms and conditions. Subject to these
42 * conditions, you may download, copy, install, use, modify and distribute
43 * this software in source and/or binary form. No title or ownership is
44 * transferred hereby.
45 *
46 * 1) Any source code used, modified or distributed must reproduce and retain
47 * this copyright notice and list of conditions as they appear in the
48 * source file.
49 *
50 * 2) No right is granted to use any trade name, trademark, or logo of Digital
51 * Equipment Corporation. Neither the "Digital Equipment Corporation"
52 * name nor any trademark or logo of Digital Equipment Corporation may be
53 * used to endorse or promote products derived from this software without
54 * the prior written permission of Digital Equipment Corporation.
55 *
56 * 3) This software is provided "AS-IS" and any express or implied warranties,
57 * including but not limited to, any implied warranties of merchantability,
58 * fitness for a particular purpose, or non-infringement are disclaimed.
59 * In no event shall DIGITAL be liable for any damages whatsoever, and in
60 * particular, DIGITAL shall not be liable for special, indirect,
61 * consequential, or incidental damages or damages for lost profits, loss
62 * of revenue or loss of use, whether such damages arise in contract,
63 * negligence, tort, under statute, in equity, at law or otherwise, even
64 * if advised of the possibility of such damage.
65 *
66 */
67
68/*
69 * This is private, and should not be included by any drivers. Drivers
70 * may include xf86_OSproc.h to get prototypes for public interfaces.
71 */
72
73#ifndef _XF86_OSLIB_H
74#define _XF86_OSLIB_H
75
76#include <X11/Xos.h>
77#include <X11/Xfuncproto.h>
78
79#include <stdio.h>
80#include <ctype.h>
81#include <stddef.h>
82
83/**************************************************************************/
84/* SYSV386 (SVR3, SVR4), including Solaris */
85/**************************************************************************/
86#if (defined(SYSV) || defined(SVR4)) && \
87 (defined(sun) || defined(__i386__))
88# ifdef SCO325
89# ifndef _SVID3
90# define _SVID3
91# endif
92# ifndef _NO_STATIC
93# define _NO_STATIC
94# endif
95# endif
96# include <sys/ioctl.h>
97# include <signal.h>
98# include <termio.h>
99# include <sys/stat.h>
100# include <sys/types.h>
101# if defined(__SCO__)
102# include <sys/param.h>
103# endif
104
105
106# include <errno.h>
107
108# if defined(_NEED_SYSI86)
109# if !(defined (sun) && defined (SVR4))
110# include <sys/immu.h>
111# include <sys/region.h>
112# endif
113# include <sys/proc.h>
114# include <sys/tss.h>
115# include <sys/sysi86.h>
116# if defined(SVR4) && !defined(sun)
117# include <sys/seg.h>
118# endif /* SVR4 && !sun */
119/* V86SC_IOPL was moved to <sys/sysi86.h> on Solaris 7 and later */
120# if defined(sun) && defined (SVR4) /* Solaris? */
121# if defined(__i386__) || defined(__i386) || defined(__x86) /* on x86 or x64? */
122# if !defined(V86SC_IOPL) /* Solaris 7 or later? */
123# include <sys/v86.h> /* Nope */
124# endif
125# endif /* V86SC_IOPL */
126# else
127# include <sys/v86.h> /* Not solaris */
128# endif /* sun && i386 && SVR4 */
129# if defined(sun) && (defined (__i386__) || defined(__i386) || defined(__x86)) && defined (SVR4)
130# include <sys/psw.h>
131# endif
132# endif /* _NEED_SYSI86 */
133
134# if defined(HAS_SVR3_MMAPDRV)
135# include <sys/sysmacros.h>
136# if !defined(_NEED_SYSI86)
137# include <sys/immu.h>
138# include <sys/region.h>
139# endif
140# include <sys/mmap.h> /* MMAP driver header */
141# endif
142
143# if !defined(sun) || (!defined(sparc) && !defined(__SOL8__))
144# define HAS_USL_VTS
145# endif
146# if !defined(sun)
147# include <sys/emap.h>
148# endif
149# if defined(SCO325)
150# include <sys/vtkd.h>
151# include <sys/console.h>
152# include <sys/scankbd.h>
153# include <sys/vid.h>
154# define LED_CAP CLKED
155# define LED_NUM NLKED
156# define LED_SCR SLKED
157# elif defined(HAS_USL_VTS)
158# include <sys/at_ansi.h>
159# include <sys/kd.h>
160# include <sys/vt.h>
161# elif defined(sun)
162# include <sys/fbio.h>
163# include <sys/kbd.h>
164# include <sys/kbio.h>
165
166/* undefine symbols from <sys/kbd.h> we don't need that conflict with enum
167 definitions in parser/xf86tokens.h */
168# undef STRING
169# undef LEFTALT
170# undef RIGHTALT
171
172# define LED_CAP LED_CAPS_LOCK
173# define LED_NUM LED_NUM_LOCK
174# define LED_SCR LED_SCROLL_LOCK
175# define LED_COMP LED_COMPOSE
176# endif /* sun */
177
178# if !defined(VT_ACKACQ)
179# define VT_ACKACQ 2
180# endif /* !VT_ACKACQ */
181
182# if defined(__SCO__)
183# include <sys/sysmacros.h>
184# define POSIX_TTY
185# endif /* __SCO__ */
186
187# if defined(SVR4) || defined(SCO325)
188# include <sys/mman.h>
189# if !(defined(sun) && defined (SVR4))
190# define DEV_MEM "/dev/pmem"
191# endif
192# ifdef SCO325
193# undef DEV_MEM
194# define DEV_MEM "/dev/mem"
195# endif
196# define CLEARDTR_SUPPORT
197# define POSIX_TTY
198# endif /* SVR4 */
199
200
201# if defined(sun) && (defined (__i386__) || defined(__i386)) && defined (SVR4) && !defined(__SOL8__)
202# define USE_VT_SYSREQ
203# define VT_SYSREQ_DEFAULT TRUE
204# endif
205
206#endif /* (SYSV || SVR4) */
207
208/**************************************************************************/
209/* Linux or Glibc-based system */
210/**************************************************************************/
211#if defined(__linux__) || defined(__GLIBC__)
212# include <sys/ioctl.h>
213# include <signal.h>
214# include <stdlib.h>
215# include <sys/types.h>
216# include <assert.h>
217
218# ifdef __linux__
219# include <termio.h>
220# else /* __GLIBC__ */
221# include <termios.h>
222# endif
223# ifdef __sparc__
224# include <sys/param.h>
225# endif
226
227# include <errno.h>
228
229# include <sys/stat.h>
230
231# include <sys/mman.h>
232# ifdef __linux__
233# define HAS_USL_VTS
234# include <sys/kd.h>
235# include <sys/vt.h>
236# define LDGMAP GIO_SCRNMAP
237# define LDSMAP PIO_SCRNMAP
238# define LDNMAP LDSMAP
239# define CLEARDTR_SUPPORT
240# define USE_VT_SYSREQ
241# endif
242
243# define POSIX_TTY
244
245#endif /* __linux__ || __GLIBC__ */
246
247/**************************************************************************/
248/* 386BSD and derivatives, BSD/386 */
249/**************************************************************************/
250
251#if defined(__386BSD__) && (defined(__FreeBSD__) || defined(__NetBSD__))
252# undef __386BSD__
253#endif
254
255#ifdef CSRG_BASED
256# include <sys/ioctl.h>
257# include <signal.h>
258
259# include <termios.h>
260# define termio termios
261# define POSIX_TTY
262
263# include <errno.h>
264
265# include <sys/types.h>
266# include <sys/mman.h>
267# include <sys/stat.h>
268
269# if defined(__bsdi__)
270# include <sys/param.h>
271# if (_BSDI_VERSION < 199510)
272# include <i386/isa/vgaioctl.h>
273# endif
274# endif /* __bsdi__ */
275
276#endif /* CSRG_BASED */
277
278/**************************************************************************/
279/* Kernel of *BSD */
280/**************************************************************************/
281#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
282 defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__)
283
284# include <sys/param.h>
285# if defined(__FreeBSD_version) && !defined(__FreeBSD_kernel_version)
286# define __FreeBSD_kernel_version __FreeBSD_version
287# endif
288
289# if !defined(LINKKIT)
290 /* Don't need this stuff for the Link Kit */
291# if defined(__bsdi__)
292# include <i386/isa/pcconsioctl.h>
293# define CONSOLE_X_MODE_ON PCCONIOCRAW
294# define CONSOLE_X_MODE_OFF PCCONIOCCOOK
295# define CONSOLE_X_BELL PCCONIOCBEEP
296# else /* __bsdi__ */
297# if defined(__OpenBSD__)
298# ifdef PCCONS_SUPPORT
299# include <machine/pccons.h>
300# undef CONSOLE_X_MODE_ON
301# undef CONSOLE_X_MODE_OFF
302# undef CONSOLE_X_BELL
303# endif
304# endif
305# ifdef SYSCONS_SUPPORT
306# define COMPAT_SYSCONS
307# if defined(__NetBSD__) || defined(__OpenBSD__)
308# include <machine/console.h>
309# else
310# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
311# if defined(__DragonFly__) || (__FreeBSD_kernel_version >= 410000)
312# include <sys/consio.h>
313# include <sys/kbio.h>
314# else
315# include <machine/console.h>
316# endif /* FreeBSD 4.1 RELEASE or lator */
317# else
318# include <sys/console.h>
319# endif
320# endif
321# endif /* SYSCONS_SUPPORT */
322# if defined(PCVT_SUPPORT)
323# if !defined(SYSCONS_SUPPORT)
324 /* no syscons, so include pcvt specific header file */
325# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
326# include <machine/pcvt_ioctl.h>
327# else
328# if defined(__NetBSD__) || defined(__OpenBSD__)
329# if !defined(WSCONS_SUPPORT)
330# include <machine/pcvt_ioctl.h>
331# endif /* WSCONS_SUPPORT */
332# else
333# include <sys/pcvt_ioctl.h>
334# endif /* __NetBSD__ */
335# endif /* __FreeBSD_kernel__ || __OpenBSD__ */
336# else /* pcvt and syscons: hard-code the ID magic */
337# define VGAPCVTID _IOWR('V',113, struct pcvtid)
338 struct pcvtid {
339 char name[16];
340 int rmajor, rminor;
341 };
342# endif /* PCVT_SUPPORT && SYSCONS_SUPPORT */
343# endif /* PCVT_SUPPORT */
344# ifdef WSCONS_SUPPORT
345# include <dev/wscons/wsconsio.h>
346# include <dev/wscons/wsdisplay_usl_io.h>
347# endif /* WSCONS_SUPPORT */
348# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
349# if defined(__FreeBSD_kernel_version) && (__FreeBSD_kernel_version >= 500013)
350# include <sys/mouse.h>
351# else
352# undef MOUSE_GETINFO
353# include <machine/mouse.h>
354# endif
355# endif
356 /* Include these definitions in case ioctl_pc.h didn't get included */
357# ifndef CONSOLE_X_MODE_ON
358# define CONSOLE_X_MODE_ON _IO('t',121)
359# endif
360# ifndef CONSOLE_X_MODE_OFF
361# define CONSOLE_X_MODE_OFF _IO('t',122)
362# endif
363# ifndef CONSOLE_X_BELL
364# define CONSOLE_X_BELL _IOW('t',123,int[2])
365# endif
366# ifndef CONSOLE_X_TV_ON
367# define CONSOLE_X_TV_ON _IOW('t',155,int)
368# define XMODE_RGB 0
369# define XMODE_NTSC 1
370# define XMODE_PAL 2
371# define XMODE_SECAM 3
372# endif
373# ifndef CONSOLE_X_TV_OFF
374# define CONSOLE_X_TV_OFF _IO('t',156)
375# endif
376#ifndef CONSOLE_GET_LINEAR_INFO
377# define CONSOLE_GET_LINEAR_INFO _IOR('t',157,struct map_info)
378#endif
379#ifndef CONSOLE_GET_IO_INFO
380# define CONSOLE_GET_IO_INFO _IOR('t',158,struct map_info)
381#endif
382#ifndef CONSOLE_GET_MEM_INFO
383# define CONSOLE_GET_MEM_INFO _IOR('t',159,struct map_info)
384#endif
385# endif /* __bsdi__ */
386# endif /* !LINKKIT */
387
388#if defined(USE_I386_IOPL) || defined(USE_AMD64_IOPL)
389#include <machine/sysarch.h>
390#endif
391
392# define CLEARDTR_SUPPORT
393
394# if defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
395# define USE_VT_SYSREQ
396# endif
397
398#endif
399/* __FreeBSD_kernel__ || __NetBSD__ || __OpenBSD__ || __bsdi__ */
400
401/**************************************************************************/
402/* IRIX */
403/**************************************************************************/
404
405/**************************************************************************/
406/* Generic */
407/**************************************************************************/
408
409#include <sys/wait.h> /* May need to adjust this for other OSs */
410
411/*
412 * Hack originally for ISC 2.2 POSIX headers, but may apply elsewhere,
413 * and it's safe, so just do it.
414 */
415#if !defined(O_NDELAY) && defined(O_NONBLOCK)
416# define O_NDELAY O_NONBLOCK
417#endif /* !O_NDELAY && O_NONBLOCK */
418
419#if !defined(MAXHOSTNAMELEN)
420# define MAXHOSTNAMELEN 32
421#endif /* !MAXHOSTNAMELEN */
422
423#if defined(_POSIX_SOURCE)
424# include <limits.h>
425#else
426# define _POSIX_SOURCE
427# include <limits.h>
428# undef _POSIX_SOURCE
429#endif /* _POSIX_SOURCE */
430
431#if !defined(PATH_MAX)
432# if defined(MAXPATHLEN)
433# define PATH_MAX MAXPATHLEN
434# else
435# define PATH_MAX 1024
436# endif /* MAXPATHLEN */
437#endif /* !PATH_MAX */
438
439
440#ifndef DEV_MEM
441#define DEV_MEM "/dev/mem"
442#endif
443
444#ifndef VT_SYSREQ_DEFAULT
445#define VT_SYSREQ_DEFAULT FALSE
446#endif
447
448#define SYSCALL(call) while(((call) == -1) && (errno == EINTR))
449
450#define XF86_OS_PRIVS
451#include "xf86_OSproc.h"
452
453#ifndef NO_COMPILER_H
454#include "compiler.h"
455#endif
456
457#endif /* _XF86_OSLIB_H */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette