xref: /OK3568_Linux_fs/external/xserver/hw/xfree86/os-support/xf86_OSlib.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany
3*4882a593Smuzhiyun  * Copyright 1992 by David Dawes <dawes@XFree86.org>
4*4882a593Smuzhiyun  * Copyright 1992 by Jim Tsillas <jtsilla@damon.ccs.northeastern.edu>
5*4882a593Smuzhiyun  * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
6*4882a593Smuzhiyun  * Copyright 1992 by Robert Baron <Robert.Baron@ernst.mach.cs.cmu.edu>
7*4882a593Smuzhiyun  * Copyright 1992 by Orest Zborowski <obz@eskimo.com>
8*4882a593Smuzhiyun  * Copyright 1993 by Vrije Universiteit, The Netherlands
9*4882a593Smuzhiyun  * Copyright 1993 by David Wexelblat <dwex@XFree86.org>
10*4882a593Smuzhiyun  * Copyright 1994, 1996 by Holger Veit <Holger.Veit@gmd.de>
11*4882a593Smuzhiyun  * Copyright 1997 by Takis Psarogiannakopoulos <takis@dpmms.cam.ac.uk>
12*4882a593Smuzhiyun  * Copyright 1994-2003 by The XFree86 Project, Inc
13*4882a593Smuzhiyun  *
14*4882a593Smuzhiyun  * Permission to use, copy, modify, distribute, and sell this software and its
15*4882a593Smuzhiyun  * documentation for any purpose is hereby granted without fee, provided that
16*4882a593Smuzhiyun  * the above copyright notice appear in all copies and that both that
17*4882a593Smuzhiyun  * copyright notice and this permission notice appear in supporting
18*4882a593Smuzhiyun  * documentation, and that the names of the above listed copyright holders
19*4882a593Smuzhiyun  * not be used in advertising or publicity pertaining to distribution of
20*4882a593Smuzhiyun  * the software without specific, written prior permission.  The above listed
21*4882a593Smuzhiyun  * copyright holders make no representations about the suitability of this
22*4882a593Smuzhiyun  * software for any purpose.  It is provided "as is" without express or
23*4882a593Smuzhiyun  * implied warranty.
24*4882a593Smuzhiyun  *
25*4882a593Smuzhiyun  * THE ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD
26*4882a593Smuzhiyun  * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
27*4882a593Smuzhiyun  * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDERS BE
28*4882a593Smuzhiyun  * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
29*4882a593Smuzhiyun  * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
30*4882a593Smuzhiyun  * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
31*4882a593Smuzhiyun  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
32*4882a593Smuzhiyun  *
33*4882a593Smuzhiyun  */
34*4882a593Smuzhiyun 
35*4882a593Smuzhiyun /*
36*4882a593Smuzhiyun  * The ARM32 code here carries the following copyright:
37*4882a593Smuzhiyun  *
38*4882a593Smuzhiyun  * Copyright 1997
39*4882a593Smuzhiyun  * Digital Equipment Corporation. All rights reserved.
40*4882a593Smuzhiyun  * This software is furnished under license and may be used and copied only in
41*4882a593Smuzhiyun  * accordance with the following terms and conditions.  Subject to these
42*4882a593Smuzhiyun  * conditions, you may download, copy, install, use, modify and distribute
43*4882a593Smuzhiyun  * this software in source and/or binary form. No title or ownership is
44*4882a593Smuzhiyun  * transferred hereby.
45*4882a593Smuzhiyun  *
46*4882a593Smuzhiyun  * 1) Any source code used, modified or distributed must reproduce and retain
47*4882a593Smuzhiyun  *    this copyright notice and list of conditions as they appear in the
48*4882a593Smuzhiyun  *    source file.
49*4882a593Smuzhiyun  *
50*4882a593Smuzhiyun  * 2) No right is granted to use any trade name, trademark, or logo of Digital
51*4882a593Smuzhiyun  *    Equipment Corporation. Neither the "Digital Equipment Corporation"
52*4882a593Smuzhiyun  *    name nor any trademark or logo of Digital Equipment Corporation may be
53*4882a593Smuzhiyun  *    used to endorse or promote products derived from this software without
54*4882a593Smuzhiyun  *    the prior written permission of Digital Equipment Corporation.
55*4882a593Smuzhiyun  *
56*4882a593Smuzhiyun  * 3) This software is provided "AS-IS" and any express or implied warranties,
57*4882a593Smuzhiyun  *    including but not limited to, any implied warranties of merchantability,
58*4882a593Smuzhiyun  *    fitness for a particular purpose, or non-infringement are disclaimed.
59*4882a593Smuzhiyun  *    In no event shall DIGITAL be liable for any damages whatsoever, and in
60*4882a593Smuzhiyun  *    particular, DIGITAL shall not be liable for special, indirect,
61*4882a593Smuzhiyun  *    consequential, or incidental damages or damages for lost profits, loss
62*4882a593Smuzhiyun  *    of revenue or loss of use, whether such damages arise in contract,
63*4882a593Smuzhiyun  *    negligence, tort, under statute, in equity, at law or otherwise, even
64*4882a593Smuzhiyun  *    if advised of the possibility of such damage.
65*4882a593Smuzhiyun  *
66*4882a593Smuzhiyun  */
67*4882a593Smuzhiyun 
68*4882a593Smuzhiyun /*
69*4882a593Smuzhiyun  * This is private, and should not be included by any drivers.  Drivers
70*4882a593Smuzhiyun  * may include xf86_OSproc.h to get prototypes for public interfaces.
71*4882a593Smuzhiyun  */
72*4882a593Smuzhiyun 
73*4882a593Smuzhiyun #ifndef _XF86_OSLIB_H
74*4882a593Smuzhiyun #define _XF86_OSLIB_H
75*4882a593Smuzhiyun 
76*4882a593Smuzhiyun #include <X11/Xos.h>
77*4882a593Smuzhiyun #include <X11/Xfuncproto.h>
78*4882a593Smuzhiyun 
79*4882a593Smuzhiyun #include <stdio.h>
80*4882a593Smuzhiyun #include <ctype.h>
81*4882a593Smuzhiyun #include <stddef.h>
82*4882a593Smuzhiyun 
83*4882a593Smuzhiyun /**************************************************************************/
84*4882a593Smuzhiyun /* SYSV386 (SVR3, SVR4), including Solaris                                */
85*4882a593Smuzhiyun /**************************************************************************/
86*4882a593Smuzhiyun #if (defined(SYSV) || defined(SVR4)) && \
87*4882a593Smuzhiyun     (defined(__sun) || defined(__i386__))
88*4882a593Smuzhiyun #include <sys/ioctl.h>
89*4882a593Smuzhiyun #include <signal.h>
90*4882a593Smuzhiyun #include <termio.h>
91*4882a593Smuzhiyun #include <sys/stat.h>
92*4882a593Smuzhiyun #include <sys/types.h>
93*4882a593Smuzhiyun 
94*4882a593Smuzhiyun #include <errno.h>
95*4882a593Smuzhiyun 
96*4882a593Smuzhiyun #if defined(_NEED_SYSI86)
97*4882a593Smuzhiyun #if !(defined (__sun) && defined (SVR4))
98*4882a593Smuzhiyun #include <sys/immu.h>
99*4882a593Smuzhiyun #include <sys/region.h>
100*4882a593Smuzhiyun #include <sys/proc.h>
101*4882a593Smuzhiyun #endif
102*4882a593Smuzhiyun #include <sys/tss.h>
103*4882a593Smuzhiyun #include <sys/sysi86.h>
104*4882a593Smuzhiyun #if defined(SVR4) && !defined(__sun)
105*4882a593Smuzhiyun #include <sys/seg.h>
106*4882a593Smuzhiyun #endif                          /* SVR4 && !__sun */
107*4882a593Smuzhiyun /* V86SC_IOPL was moved to <sys/sysi86.h> on Solaris 7 and later */
108*4882a593Smuzhiyun #if !defined(V86SC_IOPL)        /* Solaris 7 or later? */
109*4882a593Smuzhiyun #include <sys/v86.h>            /* Nope */
110*4882a593Smuzhiyun #endif
111*4882a593Smuzhiyun #if defined(__sun) && (defined (__i386__) || defined(__i386) || defined(__x86))  && defined (SVR4)
112*4882a593Smuzhiyun #include <sys/psw.h>
113*4882a593Smuzhiyun #endif
114*4882a593Smuzhiyun #endif                          /* _NEED_SYSI86 */
115*4882a593Smuzhiyun 
116*4882a593Smuzhiyun #if defined(HAS_SVR3_MMAPDRV)
117*4882a593Smuzhiyun #include <sys/sysmacros.h>
118*4882a593Smuzhiyun #if !defined(_NEED_SYSI86)
119*4882a593Smuzhiyun #include <sys/immu.h>
120*4882a593Smuzhiyun #include <sys/region.h>
121*4882a593Smuzhiyun #endif
122*4882a593Smuzhiyun #include <sys/mmap.h>           /* MMAP driver header */
123*4882a593Smuzhiyun #endif
124*4882a593Smuzhiyun 
125*4882a593Smuzhiyun #if !defined(__sun) || defined(HAVE_SYS_VT_H)
126*4882a593Smuzhiyun #define HAS_USL_VTS
127*4882a593Smuzhiyun #endif
128*4882a593Smuzhiyun #if !defined(__sun)
129*4882a593Smuzhiyun #include <sys/emap.h>
130*4882a593Smuzhiyun #endif
131*4882a593Smuzhiyun #if   defined(HAS_USL_VTS)
132*4882a593Smuzhiyun #if !defined(__sun)
133*4882a593Smuzhiyun #include <sys/at_ansi.h>
134*4882a593Smuzhiyun #endif
135*4882a593Smuzhiyun #include <sys/kd.h>
136*4882a593Smuzhiyun #include <sys/vt.h>
137*4882a593Smuzhiyun 
138*4882a593Smuzhiyun extern _X_HIDDEN void xf86VTAcquire(int);
139*4882a593Smuzhiyun extern _X_HIDDEN void xf86VTRelease(int);
140*4882a593Smuzhiyun #endif
141*4882a593Smuzhiyun 
142*4882a593Smuzhiyun #if defined(__sun)
143*4882a593Smuzhiyun #include <sys/fbio.h>
144*4882a593Smuzhiyun extern _X_HIDDEN char xf86SolarisFbDev[PATH_MAX];
145*4882a593Smuzhiyun 
146*4882a593Smuzhiyun #include <sys/kbd.h>
147*4882a593Smuzhiyun #include <sys/kbio.h>
148*4882a593Smuzhiyun 
149*4882a593Smuzhiyun /* undefine symbols from <sys/kbd.h> we don't need that conflict with enum
150*4882a593Smuzhiyun    definitions in parser/xf86tokens.h */
151*4882a593Smuzhiyun #undef STRING
152*4882a593Smuzhiyun #undef LEFTALT
153*4882a593Smuzhiyun #undef RIGHTALT
154*4882a593Smuzhiyun 
155*4882a593Smuzhiyun #define LED_CAP LED_CAPS_LOCK
156*4882a593Smuzhiyun #define LED_NUM LED_NUM_LOCK
157*4882a593Smuzhiyun #define LED_SCR LED_SCROLL_LOCK
158*4882a593Smuzhiyun #define LED_COMP LED_COMPOSE
159*4882a593Smuzhiyun #endif                          /* __sun */
160*4882a593Smuzhiyun 
161*4882a593Smuzhiyun #if !defined(VT_ACKACQ)
162*4882a593Smuzhiyun #define VT_ACKACQ 2
163*4882a593Smuzhiyun #endif                          /* !VT_ACKACQ */
164*4882a593Smuzhiyun 
165*4882a593Smuzhiyun #if defined(SVR4)
166*4882a593Smuzhiyun #include <sys/mman.h>
167*4882a593Smuzhiyun #if !(defined(__sun) && defined (SVR4))
168*4882a593Smuzhiyun #define DEV_MEM "/dev/pmem"
169*4882a593Smuzhiyun #endif
170*4882a593Smuzhiyun #define CLEARDTR_SUPPORT
171*4882a593Smuzhiyun #define POSIX_TTY
172*4882a593Smuzhiyun #endif                          /* SVR4 */
173*4882a593Smuzhiyun 
174*4882a593Smuzhiyun #endif                          /* (SYSV || SVR4) */
175*4882a593Smuzhiyun 
176*4882a593Smuzhiyun /**************************************************************************/
177*4882a593Smuzhiyun /* Linux or Glibc-based system                                            */
178*4882a593Smuzhiyun /**************************************************************************/
179*4882a593Smuzhiyun #if defined(__linux__) || defined(__GLIBC__) || defined(__CYGWIN__)
180*4882a593Smuzhiyun #include <sys/ioctl.h>
181*4882a593Smuzhiyun #include <signal.h>
182*4882a593Smuzhiyun #include <stdlib.h>
183*4882a593Smuzhiyun #include <sys/types.h>
184*4882a593Smuzhiyun #include <assert.h>
185*4882a593Smuzhiyun 
186*4882a593Smuzhiyun #include <termios.h>
187*4882a593Smuzhiyun #ifdef __sparc__
188*4882a593Smuzhiyun #include <sys/param.h>
189*4882a593Smuzhiyun #endif
190*4882a593Smuzhiyun 
191*4882a593Smuzhiyun #include <errno.h>
192*4882a593Smuzhiyun 
193*4882a593Smuzhiyun #include <sys/stat.h>
194*4882a593Smuzhiyun 
195*4882a593Smuzhiyun #include <sys/mman.h>
196*4882a593Smuzhiyun #ifdef __linux__
197*4882a593Smuzhiyun #define HAS_USL_VTS
198*4882a593Smuzhiyun #include <sys/kd.h>
199*4882a593Smuzhiyun #include <sys/vt.h>
200*4882a593Smuzhiyun #define LDGMAP GIO_SCRNMAP
201*4882a593Smuzhiyun #define LDSMAP PIO_SCRNMAP
202*4882a593Smuzhiyun #define LDNMAP LDSMAP
203*4882a593Smuzhiyun #define CLEARDTR_SUPPORT
204*4882a593Smuzhiyun #endif
205*4882a593Smuzhiyun 
206*4882a593Smuzhiyun #define POSIX_TTY
207*4882a593Smuzhiyun 
208*4882a593Smuzhiyun #endif                          /* __linux__ || __GLIBC__ */
209*4882a593Smuzhiyun 
210*4882a593Smuzhiyun /**************************************************************************/
211*4882a593Smuzhiyun /* System is BSD-like                                                     */
212*4882a593Smuzhiyun /**************************************************************************/
213*4882a593Smuzhiyun 
214*4882a593Smuzhiyun #ifdef CSRG_BASED
215*4882a593Smuzhiyun #include <sys/ioctl.h>
216*4882a593Smuzhiyun #include <signal.h>
217*4882a593Smuzhiyun 
218*4882a593Smuzhiyun #include <termios.h>
219*4882a593Smuzhiyun #define termio termios
220*4882a593Smuzhiyun #define POSIX_TTY
221*4882a593Smuzhiyun 
222*4882a593Smuzhiyun #include <errno.h>
223*4882a593Smuzhiyun 
224*4882a593Smuzhiyun #include <sys/types.h>
225*4882a593Smuzhiyun #include <sys/mman.h>
226*4882a593Smuzhiyun #include <sys/stat.h>
227*4882a593Smuzhiyun 
228*4882a593Smuzhiyun #endif                          /* CSRG_BASED */
229*4882a593Smuzhiyun 
230*4882a593Smuzhiyun /**************************************************************************/
231*4882a593Smuzhiyun /* Kernel of *BSD                                                         */
232*4882a593Smuzhiyun /**************************************************************************/
233*4882a593Smuzhiyun #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
234*4882a593Smuzhiyun  defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
235*4882a593Smuzhiyun 
236*4882a593Smuzhiyun #include <sys/param.h>
237*4882a593Smuzhiyun #if defined(__FreeBSD_version) && !defined(__FreeBSD_kernel_version)
238*4882a593Smuzhiyun #define __FreeBSD_kernel_version __FreeBSD_version
239*4882a593Smuzhiyun #endif
240*4882a593Smuzhiyun 
241*4882a593Smuzhiyun #ifdef SYSCONS_SUPPORT
242*4882a593Smuzhiyun #define COMPAT_SYSCONS
243*4882a593Smuzhiyun #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
244*4882a593Smuzhiyun #if defined(__DragonFly__)  || (__FreeBSD_kernel_version >= 410000)
245*4882a593Smuzhiyun #include <sys/consio.h>
246*4882a593Smuzhiyun #include <sys/kbio.h>
247*4882a593Smuzhiyun #else
248*4882a593Smuzhiyun #include <machine/console.h>
249*4882a593Smuzhiyun #endif                          /* FreeBSD 4.1 RELEASE or lator */
250*4882a593Smuzhiyun #else
251*4882a593Smuzhiyun #include <sys/console.h>
252*4882a593Smuzhiyun #endif
253*4882a593Smuzhiyun #endif                          /* SYSCONS_SUPPORT */
254*4882a593Smuzhiyun #if defined(PCVT_SUPPORT) && !defined(__NetBSD__) && !defined(__OpenBSD__)
255*4882a593Smuzhiyun #if !defined(SYSCONS_SUPPORT)
256*4882a593Smuzhiyun       /* no syscons, so include pcvt specific header file */
257*4882a593Smuzhiyun #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
258*4882a593Smuzhiyun #include <machine/pcvt_ioctl.h>
259*4882a593Smuzhiyun #else
260*4882a593Smuzhiyun #include <sys/pcvt_ioctl.h>
261*4882a593Smuzhiyun #endif                          /* __FreeBSD_kernel__ */
262*4882a593Smuzhiyun #else                           /* pcvt and syscons: hard-code the ID magic */
263*4882a593Smuzhiyun #define VGAPCVTID _IOWR('V',113, struct pcvtid)
264*4882a593Smuzhiyun struct pcvtid {
265*4882a593Smuzhiyun     char name[16];
266*4882a593Smuzhiyun     int rmajor, rminor;
267*4882a593Smuzhiyun };
268*4882a593Smuzhiyun #endif                          /* PCVT_SUPPORT && SYSCONS_SUPPORT */
269*4882a593Smuzhiyun #endif                          /* PCVT_SUPPORT */
270*4882a593Smuzhiyun #ifdef WSCONS_SUPPORT
271*4882a593Smuzhiyun #include <dev/wscons/wsconsio.h>
272*4882a593Smuzhiyun #include <dev/wscons/wsdisplay_usl_io.h>
273*4882a593Smuzhiyun #endif                          /* WSCONS_SUPPORT */
274*4882a593Smuzhiyun #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
275*4882a593Smuzhiyun #include <sys/mouse.h>
276*4882a593Smuzhiyun #endif
277*4882a593Smuzhiyun     /* Include these definitions in case ioctl_pc.h didn't get included */
278*4882a593Smuzhiyun #ifndef CONSOLE_X_MODE_ON
279*4882a593Smuzhiyun #define CONSOLE_X_MODE_ON _IO('t',121)
280*4882a593Smuzhiyun #endif
281*4882a593Smuzhiyun #ifndef CONSOLE_X_MODE_OFF
282*4882a593Smuzhiyun #define CONSOLE_X_MODE_OFF _IO('t',122)
283*4882a593Smuzhiyun #endif
284*4882a593Smuzhiyun #ifndef CONSOLE_X_BELL
285*4882a593Smuzhiyun #define CONSOLE_X_BELL _IOW('t',123,int[2])
286*4882a593Smuzhiyun #endif
287*4882a593Smuzhiyun #ifndef CONSOLE_X_TV_ON
288*4882a593Smuzhiyun #define CONSOLE_X_TV_ON _IOW('t',155,int)
289*4882a593Smuzhiyun #define XMODE_RGB   0
290*4882a593Smuzhiyun #define XMODE_NTSC  1
291*4882a593Smuzhiyun #define XMODE_PAL   2
292*4882a593Smuzhiyun #define XMODE_SECAM 3
293*4882a593Smuzhiyun #endif
294*4882a593Smuzhiyun #ifndef CONSOLE_X_TV_OFF
295*4882a593Smuzhiyun #define CONSOLE_X_TV_OFF _IO('t',156)
296*4882a593Smuzhiyun #endif
297*4882a593Smuzhiyun #ifndef CONSOLE_GET_LINEAR_INFO
298*4882a593Smuzhiyun #define CONSOLE_GET_LINEAR_INFO         _IOR('t',157,struct map_info)
299*4882a593Smuzhiyun #endif
300*4882a593Smuzhiyun #ifndef CONSOLE_GET_IO_INFO
301*4882a593Smuzhiyun #define CONSOLE_GET_IO_INFO             _IOR('t',158,struct map_info)
302*4882a593Smuzhiyun #endif
303*4882a593Smuzhiyun #ifndef CONSOLE_GET_MEM_INFO
304*4882a593Smuzhiyun #define CONSOLE_GET_MEM_INFO            _IOR('t',159,struct map_info)
305*4882a593Smuzhiyun #endif
306*4882a593Smuzhiyun 
307*4882a593Smuzhiyun #if defined(USE_I386_IOPL) || defined(USE_AMD64_IOPL)
308*4882a593Smuzhiyun #include <machine/sysarch.h>
309*4882a593Smuzhiyun #endif
310*4882a593Smuzhiyun 
311*4882a593Smuzhiyun #define CLEARDTR_SUPPORT
312*4882a593Smuzhiyun 
313*4882a593Smuzhiyun #endif                          /* __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__ */
314*4882a593Smuzhiyun 
315*4882a593Smuzhiyun /**************************************************************************/
316*4882a593Smuzhiyun /* IRIX                                                                   */
317*4882a593Smuzhiyun /**************************************************************************/
318*4882a593Smuzhiyun 
319*4882a593Smuzhiyun /**************************************************************************/
320*4882a593Smuzhiyun /* Generic                                                                */
321*4882a593Smuzhiyun /**************************************************************************/
322*4882a593Smuzhiyun 
323*4882a593Smuzhiyun #include <sys/wait.h>           /* May need to adjust this for other OSs */
324*4882a593Smuzhiyun 
325*4882a593Smuzhiyun /* For PATH_MAX */
326*4882a593Smuzhiyun #include "misc.h"
327*4882a593Smuzhiyun 
328*4882a593Smuzhiyun /*
329*4882a593Smuzhiyun  * Hack originally for ISC 2.2 POSIX headers, but may apply elsewhere,
330*4882a593Smuzhiyun  * and it's safe, so just do it.
331*4882a593Smuzhiyun  */
332*4882a593Smuzhiyun #if !defined(O_NDELAY) && defined(O_NONBLOCK)
333*4882a593Smuzhiyun #define O_NDELAY O_NONBLOCK
334*4882a593Smuzhiyun #endif                          /* !O_NDELAY && O_NONBLOCK */
335*4882a593Smuzhiyun 
336*4882a593Smuzhiyun #if !defined(MAXHOSTNAMELEN)
337*4882a593Smuzhiyun #define MAXHOSTNAMELEN 32
338*4882a593Smuzhiyun #endif                          /* !MAXHOSTNAMELEN */
339*4882a593Smuzhiyun 
340*4882a593Smuzhiyun #include <limits.h>
341*4882a593Smuzhiyun 
342*4882a593Smuzhiyun #ifndef DEV_MEM
343*4882a593Smuzhiyun #define DEV_MEM "/dev/mem"
344*4882a593Smuzhiyun #endif
345*4882a593Smuzhiyun 
346*4882a593Smuzhiyun #ifndef MAP_FAILED
347*4882a593Smuzhiyun #define MAP_FAILED ((void *)-1)
348*4882a593Smuzhiyun #endif
349*4882a593Smuzhiyun 
350*4882a593Smuzhiyun #define SYSCALL(call) while(((call) == -1) && (errno == EINTR))
351*4882a593Smuzhiyun 
352*4882a593Smuzhiyun #define XF86_OS_PRIVS
353*4882a593Smuzhiyun #include "xf86_OSproc.h"
354*4882a593Smuzhiyun 
355*4882a593Smuzhiyun #endif                          /* _XF86_OSLIB_H */
356