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(DGUX) && !defined(sgi) && \
|
---|
88 | (defined(sun) || defined(__i386__))
|
---|
89 | # ifdef SCO325
|
---|
90 | # ifndef _SVID3
|
---|
91 | # define _SVID3
|
---|
92 | # endif
|
---|
93 | # ifndef _NO_STATIC
|
---|
94 | # define _NO_STATIC
|
---|
95 | # endif
|
---|
96 | # endif
|
---|
97 | # include <sys/ioctl.h>
|
---|
98 | # include <signal.h>
|
---|
99 | # include <termio.h>
|
---|
100 | # include <sys/stat.h>
|
---|
101 | # include <sys/types.h>
|
---|
102 | # if defined(__SCO__) || defined(ISC)
|
---|
103 | # include <sys/param.h>
|
---|
104 | # endif
|
---|
105 |
|
---|
106 | # ifdef ISC
|
---|
107 | # define TIOCMSET (TIOC|26) /* set all modem bits */
|
---|
108 | # define TIOCMBIS (TIOC|27) /* bis modem bits */
|
---|
109 | # define TIOCMBIC (TIOC|28) /* bic modem bits */
|
---|
110 | # define TIOCMGET (TIOC|29) /* get all modem bits */
|
---|
111 | # endif
|
---|
112 |
|
---|
113 | # include <errno.h>
|
---|
114 |
|
---|
115 | # if defined(_NEED_SYSI86)
|
---|
116 | # if !(defined (sun) && defined (SVR4))
|
---|
117 | # include <sys/immu.h>
|
---|
118 | # include <sys/region.h>
|
---|
119 | # endif
|
---|
120 | # include <sys/proc.h>
|
---|
121 | # include <sys/tss.h>
|
---|
122 | # include <sys/sysi86.h>
|
---|
123 | # if defined(SVR4) && !defined(sun)
|
---|
124 | # include <sys/seg.h>
|
---|
125 | # endif /* SVR4 && !sun */
|
---|
126 | /* V86SC_IOPL was moved to <sys/sysi86.h> on Solaris 7 and later */
|
---|
127 | # if defined(sun) && defined (SVR4) /* Solaris? */
|
---|
128 | # if defined(__i386__) || defined(__i386) || defined(__x86) /* on x86 or x64? */
|
---|
129 | # if !defined(V86SC_IOPL) /* Solaris 7 or later? */
|
---|
130 | # include <sys/v86.h> /* Nope */
|
---|
131 | # endif
|
---|
132 | # endif /* V86SC_IOPL */
|
---|
133 | # else
|
---|
134 | # include <sys/v86.h> /* Not solaris */
|
---|
135 | # endif /* sun && i386 && SVR4 */
|
---|
136 | # if defined(sun) && (defined (__i386__) || defined(__i386) || defined(__x86)) && defined (SVR4)
|
---|
137 | # include <sys/psw.h>
|
---|
138 | # endif
|
---|
139 | # endif /* _NEED_SYSI86 */
|
---|
140 |
|
---|
141 | # if defined(HAS_SVR3_MMAPDRV)
|
---|
142 | # include <sys/sysmacros.h>
|
---|
143 | # if !defined(_NEED_SYSI86)
|
---|
144 | # include <sys/immu.h>
|
---|
145 | # include <sys/region.h>
|
---|
146 | # endif
|
---|
147 | # include <sys/mmap.h> /* MMAP driver header */
|
---|
148 | # endif
|
---|
149 |
|
---|
150 | # if !defined(sun) || (!defined(sparc) && !defined(__SOL8__))
|
---|
151 | # define HAS_USL_VTS
|
---|
152 | # endif
|
---|
153 | # if !defined(sun)
|
---|
154 | # include <sys/emap.h>
|
---|
155 | # endif
|
---|
156 | # if defined(SCO325)
|
---|
157 | # include <sys/vtkd.h>
|
---|
158 | # include <sys/console.h>
|
---|
159 | # include <sys/scankbd.h>
|
---|
160 | # include <sys/vid.h>
|
---|
161 | # define LED_CAP CLKED
|
---|
162 | # define LED_NUM NLKED
|
---|
163 | # define LED_SCR SLKED
|
---|
164 | # elif defined(HAS_USL_VTS)
|
---|
165 | # include <sys/at_ansi.h>
|
---|
166 | # include <sys/kd.h>
|
---|
167 | # include <sys/vt.h>
|
---|
168 | # elif defined(sun)
|
---|
169 | # include <sys/fbio.h>
|
---|
170 | # include <sys/kbd.h>
|
---|
171 | # include <sys/kbio.h>
|
---|
172 |
|
---|
173 | /* undefine symbols from <sys/kbd.h> we don't need that conflict with enum
|
---|
174 | definitions in parser/xf86tokens.h */
|
---|
175 | # undef STRING
|
---|
176 | # undef LEFTALT
|
---|
177 | # undef RIGHTALT
|
---|
178 |
|
---|
179 | # define LED_CAP LED_CAPS_LOCK
|
---|
180 | # define LED_NUM LED_NUM_LOCK
|
---|
181 | # define LED_SCR LED_SCROLL_LOCK
|
---|
182 | # define LED_COMP LED_COMPOSE
|
---|
183 | # endif /* sun */
|
---|
184 |
|
---|
185 | # if !defined(VT_ACKACQ)
|
---|
186 | # define VT_ACKACQ 2
|
---|
187 | # endif /* !VT_ACKACQ */
|
---|
188 |
|
---|
189 | # if defined(__SCO__)
|
---|
190 | # include <sys/sysmacros.h>
|
---|
191 | # define POSIX_TTY
|
---|
192 | # endif /* __SCO__ */
|
---|
193 |
|
---|
194 | # if defined(SVR4) || defined(SCO325)
|
---|
195 | # include <sys/mman.h>
|
---|
196 | # if !(defined(sun) && defined (SVR4))
|
---|
197 | # define DEV_MEM "/dev/pmem"
|
---|
198 | # endif
|
---|
199 | # ifdef SCO325
|
---|
200 | # undef DEV_MEM
|
---|
201 | # define DEV_MEM "/dev/mem"
|
---|
202 | # endif
|
---|
203 | # define CLEARDTR_SUPPORT
|
---|
204 | # define POSIX_TTY
|
---|
205 | # endif /* SVR4 */
|
---|
206 |
|
---|
207 | # ifdef ISC
|
---|
208 | # include <termios.h>
|
---|
209 | # define POSIX_TTY
|
---|
210 | # endif
|
---|
211 |
|
---|
212 | # if defined(sun) && (defined (__i386__) || defined(__i386)) && defined (SVR4) && !defined(__SOL8__)
|
---|
213 | # define USE_VT_SYSREQ
|
---|
214 | # define VT_SYSREQ_DEFAULT TRUE
|
---|
215 | # endif
|
---|
216 |
|
---|
217 | # ifdef SYSV
|
---|
218 | # if !defined(ISC) || defined(ISC202) || defined(ISC22)
|
---|
219 | # define NEED_STRERROR
|
---|
220 | # endif
|
---|
221 | # endif
|
---|
222 |
|
---|
223 | #endif /* (SYSV || SVR4) && !DGUX */
|
---|
224 |
|
---|
225 |
|
---|
226 |
|
---|
227 | /**************************************************************************/
|
---|
228 | /* DG/ux R4.20MU03 Intel AViion Machines */
|
---|
229 | /**************************************************************************/
|
---|
230 | #if defined(DGUX) && defined(SVR4)
|
---|
231 | #include <sys/ioctl.h>
|
---|
232 | #include <signal.h>
|
---|
233 | #include <ctype.h>
|
---|
234 | #include <termios.h> /* Use termios for BSD Flavor ttys */
|
---|
235 | #include <sys/termios.h>
|
---|
236 | #include <sys/stat.h>
|
---|
237 | #include <sys/types.h>
|
---|
238 | #include <sys/param.h>
|
---|
239 | #include <errno.h>
|
---|
240 | #include <sys/sysi86.h>
|
---|
241 | #include <unistd.h>
|
---|
242 | #include <sys/proc.h>
|
---|
243 | #include <sys/map.h>
|
---|
244 | #include <sys/sysmacros.h>
|
---|
245 | #include <sys/mman.h> /* Memory handling */
|
---|
246 | #include <sys/kd.h> /* definitios for KDENABIO KDDISABIO needed for IOPL s */
|
---|
247 | #include <sys/kbd.h>
|
---|
248 | #include <fcntl.h>
|
---|
249 | #include <time.h>
|
---|
250 | #include <sys/stream.h>
|
---|
251 | #include <sys/ptms.h>
|
---|
252 |
|
---|
253 | #include <sys/socket.h>
|
---|
254 | #include <sys/utsname.h>
|
---|
255 | #include <sys/stropts.h>
|
---|
256 | #include <sys/sockio.h>
|
---|
257 |
|
---|
258 |
|
---|
259 | #define POSIX_TTY
|
---|
260 |
|
---|
261 | #undef HAS_USL_VTS
|
---|
262 | #undef USE_VT_SYSREQ
|
---|
263 | #undef VT_ACKACQ
|
---|
264 |
|
---|
265 | #define LED_CAP KBD_LED_CAPS_LOCK
|
---|
266 | #define LED_NUM KBD_LED_NUM_LOCK
|
---|
267 | #define LED_SCR KBD_LED_SCROLL_LOCK
|
---|
268 |
|
---|
269 | #define KDGKBTYPE KBD_GET_LANGUAGE
|
---|
270 |
|
---|
271 |
|
---|
272 | /* General keyboard types */
|
---|
273 | # define KB_84 2
|
---|
274 | # define KB_101 1 /* Because ioctl(dgkeybdFd,KBD_GET_LANGUAGE,&type) gives 1=US keyboard */
|
---|
275 | # define KB_OTHER 3
|
---|
276 |
|
---|
277 | #define KDSETLED KBD_SET_LED
|
---|
278 | #define KDGETLED KBD_GET_STATE
|
---|
279 | #undef KDMKTONE
|
---|
280 | #define KDMKTONE KBD_TONE_HIGH
|
---|
281 |
|
---|
282 |
|
---|
283 | #undef DEV_MEM
|
---|
284 | #define DEV_MEM "/dev/mem"
|
---|
285 | #define CLEARDTR_SUPPORT
|
---|
286 |
|
---|
287 | #undef VT_SYSREQ_DEFAULT
|
---|
288 | #define VT_SYSREQ_DEFAULT FALSE /* Make sure that we dont define any VTs since DG/ux has none */
|
---|
289 |
|
---|
290 | #endif /* DGUX && SVR4 */
|
---|
291 |
|
---|
292 | /**************************************************************************/
|
---|
293 | /* Linux or Glibc-based system */
|
---|
294 | /**************************************************************************/
|
---|
295 | #if defined(__linux__) || defined(__GLIBC__)
|
---|
296 | # include <sys/ioctl.h>
|
---|
297 | # include <signal.h>
|
---|
298 | # include <stdlib.h>
|
---|
299 | # include <sys/types.h>
|
---|
300 | # include <assert.h>
|
---|
301 |
|
---|
302 | #ifdef __GNU__ /* GNU/Hurd */
|
---|
303 | # define USE_OSMOUSE
|
---|
304 | #endif
|
---|
305 |
|
---|
306 | # ifdef __linux__
|
---|
307 | # include <termio.h>
|
---|
308 | # else /* __GLIBC__ */
|
---|
309 | # include <termios.h>
|
---|
310 | # endif
|
---|
311 | # ifdef __sparc__
|
---|
312 | # include <sys/param.h>
|
---|
313 | # endif
|
---|
314 |
|
---|
315 | # include <errno.h>
|
---|
316 |
|
---|
317 | # include <sys/stat.h>
|
---|
318 |
|
---|
319 | # include <sys/mman.h>
|
---|
320 | # ifdef __linux__
|
---|
321 | # define HAS_USL_VTS
|
---|
322 | # include <sys/kd.h>
|
---|
323 | # include <sys/vt.h>
|
---|
324 | # define LDGMAP GIO_SCRNMAP
|
---|
325 | # define LDSMAP PIO_SCRNMAP
|
---|
326 | # define LDNMAP LDSMAP
|
---|
327 | # define CLEARDTR_SUPPORT
|
---|
328 | # define USE_VT_SYSREQ
|
---|
329 | # endif
|
---|
330 |
|
---|
331 | # define POSIX_TTY
|
---|
332 |
|
---|
333 | #endif /* __linux__ || __GLIBC__ */
|
---|
334 |
|
---|
335 | /**************************************************************************/
|
---|
336 | /* LynxOS AT */
|
---|
337 | /**************************************************************************/
|
---|
338 | #if defined(Lynx)
|
---|
339 |
|
---|
340 | # include <termio.h>
|
---|
341 | # include <sys/ioctl.h>
|
---|
342 | # include <param.h>
|
---|
343 | # include <signal.h>
|
---|
344 | # include <kd.h>
|
---|
345 | # include <vt.h>
|
---|
346 | # include <sys/stat.h>
|
---|
347 |
|
---|
348 | # include <errno.h>
|
---|
349 | extern int errno;
|
---|
350 |
|
---|
351 | /* smem_create et.al. to access physical memory */
|
---|
352 | # include <smem.h>
|
---|
353 |
|
---|
354 | /* keyboard types */
|
---|
355 | # define KB_84 1
|
---|
356 | # define KB_101 2
|
---|
357 | # define KB_OTHER 3
|
---|
358 |
|
---|
359 | /* atc drivers ignores argument to VT_RELDISP ioctl */
|
---|
360 | # define VT_ACKACQ 2
|
---|
361 |
|
---|
362 | # include <termios.h>
|
---|
363 | # define POSIX_TTY
|
---|
364 | # define CLEARDTR_SUPPORT
|
---|
365 |
|
---|
366 | /* LynxOS 2.5.1 has these */
|
---|
367 | # ifdef LED_NUMLOCK
|
---|
368 | # define LED_CAP LED_CAPSLOCK
|
---|
369 | # define LED_NUM LED_NUMLOCK
|
---|
370 | # define LED_SCR LED_SCROLLOCK
|
---|
371 | # endif
|
---|
372 |
|
---|
373 | #endif /* Lynx */
|
---|
374 |
|
---|
375 | /**************************************************************************/
|
---|
376 | /* 386BSD and derivatives, BSD/386 */
|
---|
377 | /**************************************************************************/
|
---|
378 |
|
---|
379 | #if defined(__386BSD__) && (defined(__FreeBSD__) || defined(__NetBSD__))
|
---|
380 | # undef __386BSD__
|
---|
381 | #endif
|
---|
382 |
|
---|
383 | #ifdef CSRG_BASED
|
---|
384 | # include <sys/ioctl.h>
|
---|
385 | # include <signal.h>
|
---|
386 |
|
---|
387 | # include <termios.h>
|
---|
388 | # define termio termios
|
---|
389 | # define POSIX_TTY
|
---|
390 |
|
---|
391 | # include <errno.h>
|
---|
392 |
|
---|
393 | # include <sys/types.h>
|
---|
394 | # include <sys/mman.h>
|
---|
395 | # include <sys/stat.h>
|
---|
396 |
|
---|
397 | # if defined(__bsdi__)
|
---|
398 | # include <sys/param.h>
|
---|
399 | # if (_BSDI_VERSION < 199510)
|
---|
400 | # include <i386/isa/vgaioctl.h>
|
---|
401 | # endif
|
---|
402 | # endif /* __bsdi__ */
|
---|
403 |
|
---|
404 | #endif /* CSRG_BASED */
|
---|
405 |
|
---|
406 | /**************************************************************************/
|
---|
407 | /* Kernel of *BSD */
|
---|
408 | /**************************************************************************/
|
---|
409 | #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
|
---|
410 | defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__)
|
---|
411 |
|
---|
412 | # include <sys/param.h>
|
---|
413 | # if defined(__FreeBSD_version) && !defined(__FreeBSD_kernel_version)
|
---|
414 | # define __FreeBSD_kernel_version __FreeBSD_version
|
---|
415 | # endif
|
---|
416 |
|
---|
417 | # if !defined(LINKKIT)
|
---|
418 | /* Don't need this stuff for the Link Kit */
|
---|
419 | # if defined(__bsdi__)
|
---|
420 | # include <i386/isa/pcconsioctl.h>
|
---|
421 | # define CONSOLE_X_MODE_ON PCCONIOCRAW
|
---|
422 | # define CONSOLE_X_MODE_OFF PCCONIOCCOOK
|
---|
423 | # define CONSOLE_X_BELL PCCONIOCBEEP
|
---|
424 | # else /* __bsdi__ */
|
---|
425 | # if defined(__OpenBSD__)
|
---|
426 | # ifdef PCCONS_SUPPORT
|
---|
427 | # include <machine/pccons.h>
|
---|
428 | # undef CONSOLE_X_MODE_ON
|
---|
429 | # undef CONSOLE_X_MODE_OFF
|
---|
430 | # undef CONSOLE_X_BELL
|
---|
431 | # endif
|
---|
432 | # endif
|
---|
433 | # ifdef SYSCONS_SUPPORT
|
---|
434 | # define COMPAT_SYSCONS
|
---|
435 | # if defined(__NetBSD__) || defined(__OpenBSD__)
|
---|
436 | # include <machine/console.h>
|
---|
437 | # else
|
---|
438 | # if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
|
---|
439 | # if defined(__DragonFly__) || (__FreeBSD_kernel_version >= 410000)
|
---|
440 | # include <sys/consio.h>
|
---|
441 | # include <sys/kbio.h>
|
---|
442 | # else
|
---|
443 | # include <machine/console.h>
|
---|
444 | # endif /* FreeBSD 4.1 RELEASE or lator */
|
---|
445 | # else
|
---|
446 | # include <sys/console.h>
|
---|
447 | # endif
|
---|
448 | # endif
|
---|
449 | # endif /* SYSCONS_SUPPORT */
|
---|
450 | # if defined(PCVT_SUPPORT)
|
---|
451 | # if !defined(SYSCONS_SUPPORT)
|
---|
452 | /* no syscons, so include pcvt specific header file */
|
---|
453 | # if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
---|
454 | # include <machine/pcvt_ioctl.h>
|
---|
455 | # else
|
---|
456 | # if defined(__NetBSD__) || defined(__OpenBSD__)
|
---|
457 | # if !defined(WSCONS_SUPPORT)
|
---|
458 | # include <machine/pcvt_ioctl.h>
|
---|
459 | # endif /* WSCONS_SUPPORT */
|
---|
460 | # else
|
---|
461 | # include <sys/pcvt_ioctl.h>
|
---|
462 | # endif /* __NetBSD__ */
|
---|
463 | # endif /* __FreeBSD_kernel__ || __OpenBSD__ */
|
---|
464 | # else /* pcvt and syscons: hard-code the ID magic */
|
---|
465 | # define VGAPCVTID _IOWR('V',113, struct pcvtid)
|
---|
466 | struct pcvtid {
|
---|
467 | char name[16];
|
---|
468 | int rmajor, rminor;
|
---|
469 | };
|
---|
470 | # endif /* PCVT_SUPPORT && SYSCONS_SUPPORT */
|
---|
471 | # endif /* PCVT_SUPPORT */
|
---|
472 | # ifdef WSCONS_SUPPORT
|
---|
473 | # include <dev/wscons/wsconsio.h>
|
---|
474 | # include <dev/wscons/wsdisplay_usl_io.h>
|
---|
475 | # endif /* WSCONS_SUPPORT */
|
---|
476 | # if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
|
---|
477 | # if defined(__FreeBSD_kernel_version) && (__FreeBSD_kernel_version >= 500013)
|
---|
478 | # include <sys/mouse.h>
|
---|
479 | # else
|
---|
480 | # undef MOUSE_GETINFO
|
---|
481 | # include <machine/mouse.h>
|
---|
482 | # endif
|
---|
483 | # endif
|
---|
484 | /* Include these definitions in case ioctl_pc.h didn't get included */
|
---|
485 | # ifndef CONSOLE_X_MODE_ON
|
---|
486 | # define CONSOLE_X_MODE_ON _IO('t',121)
|
---|
487 | # endif
|
---|
488 | # ifndef CONSOLE_X_MODE_OFF
|
---|
489 | # define CONSOLE_X_MODE_OFF _IO('t',122)
|
---|
490 | # endif
|
---|
491 | # ifndef CONSOLE_X_BELL
|
---|
492 | # define CONSOLE_X_BELL _IOW('t',123,int[2])
|
---|
493 | # endif
|
---|
494 | # ifndef CONSOLE_X_TV_ON
|
---|
495 | # define CONSOLE_X_TV_ON _IOW('t',155,int)
|
---|
496 | # define XMODE_RGB 0
|
---|
497 | # define XMODE_NTSC 1
|
---|
498 | # define XMODE_PAL 2
|
---|
499 | # define XMODE_SECAM 3
|
---|
500 | # endif
|
---|
501 | # ifndef CONSOLE_X_TV_OFF
|
---|
502 | # define CONSOLE_X_TV_OFF _IO('t',156)
|
---|
503 | # endif
|
---|
504 | #ifndef CONSOLE_GET_LINEAR_INFO
|
---|
505 | # define CONSOLE_GET_LINEAR_INFO _IOR('t',157,struct map_info)
|
---|
506 | #endif
|
---|
507 | #ifndef CONSOLE_GET_IO_INFO
|
---|
508 | # define CONSOLE_GET_IO_INFO _IOR('t',158,struct map_info)
|
---|
509 | #endif
|
---|
510 | #ifndef CONSOLE_GET_MEM_INFO
|
---|
511 | # define CONSOLE_GET_MEM_INFO _IOR('t',159,struct map_info)
|
---|
512 | #endif
|
---|
513 | # endif /* __bsdi__ */
|
---|
514 | # endif /* !LINKKIT */
|
---|
515 |
|
---|
516 | #if defined(USE_I386_IOPL) || defined(USE_AMD64_IOPL)
|
---|
517 | #include <machine/sysarch.h>
|
---|
518 | #endif
|
---|
519 |
|
---|
520 | # define CLEARDTR_SUPPORT
|
---|
521 |
|
---|
522 | # if defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
|
---|
523 | # define USE_VT_SYSREQ
|
---|
524 | # endif
|
---|
525 |
|
---|
526 | #endif
|
---|
527 | /* __FreeBSD_kernel__ || __NetBSD__ || __OpenBSD__ || __bsdi__ */
|
---|
528 |
|
---|
529 | /**************************************************************************/
|
---|
530 | /* QNX4 */
|
---|
531 | /**************************************************************************/
|
---|
532 | /* This is the QNX code for Watcom 10.6 and QNX 4.x */
|
---|
533 | #if defined(QNX4)
|
---|
534 | #include <signal.h>
|
---|
535 | #include <errno.h>
|
---|
536 | #include <sys/stat.h>
|
---|
537 | #include <termios.h>
|
---|
538 | #include <ioctl.h>
|
---|
539 | #include <sys/param.h>
|
---|
540 |
|
---|
541 | /* Warning: by default, the fd_set size is 32 in QNX! */
|
---|
542 | #define FD_SETSIZE 256
|
---|
543 | #include <sys/select.h>
|
---|
544 |
|
---|
545 | /* keyboard types */
|
---|
546 | # define KB_84 1
|
---|
547 | # define KB_101 2
|
---|
548 | # define KB_OTHER 3
|
---|
549 |
|
---|
550 | /* LEDs */
|
---|
551 | # define LED_CAP 0x04
|
---|
552 | # define LED_NUM 0x02
|
---|
553 | # define LED_SCR 0x01
|
---|
554 |
|
---|
555 | # define POSIX_TTY
|
---|
556 | # define OSMOUSE_ONLY
|
---|
557 | # define MOUSE_PROTOCOL_IN_KERNEL
|
---|
558 |
|
---|
559 | #define TIOCM_DTR 0x0001 /* data terminal ready */
|
---|
560 | #define TIOCM_RTS 0x0002 /* request to send */
|
---|
561 | #define TIOCM_CTS 0x1000 /* clear to send */
|
---|
562 | #define TIOCM_DSR 0x2000 /* data set ready */
|
---|
563 | #define TIOCM_RI 0x4000 /* ring */
|
---|
564 | #define TIOCM_RNG TIOCM_RI
|
---|
565 | #define TIOCM_CD 0x8000 /* carrier detect */
|
---|
566 | #define TIOCM_CAR TIOCM_CD
|
---|
567 | #define TIOCM_LE 0x0100 /* line enable */
|
---|
568 | #define TIOCM_ST 0x0200 /* secondary transmit */
|
---|
569 | #define TIOCM_SR 0x0400 /* secondary receive */
|
---|
570 |
|
---|
571 | #endif
|
---|
572 |
|
---|
573 | /**************************************************************************/
|
---|
574 | /* QNX/Neutrino */
|
---|
575 | /**************************************************************************/
|
---|
576 | /* This is the Neutrino code for for NTO2.0 and GCC */
|
---|
577 | #if defined(__QNXNTO__)
|
---|
578 | #include <signal.h>
|
---|
579 | #include <errno.h>
|
---|
580 | #include <sys/stat.h>
|
---|
581 | #include <termios.h>
|
---|
582 | #include <ioctl.h>
|
---|
583 | #include <sys/param.h>
|
---|
584 |
|
---|
585 | /* Warning: by default, the fd_set size is 32 in NTO! */
|
---|
586 | #define FD_SETSIZE 256
|
---|
587 | #include <sys/select.h>
|
---|
588 |
|
---|
589 | /* keyboard types */
|
---|
590 | # define KB_84 1
|
---|
591 | # define KB_101 2
|
---|
592 | # define KB_OTHER 3
|
---|
593 |
|
---|
594 | # define POSIX_TTY
|
---|
595 |
|
---|
596 | #endif
|
---|
597 |
|
---|
598 | /**************************************************************************/
|
---|
599 | /* IRIX */
|
---|
600 | /**************************************************************************/
|
---|
601 | #if defined(sgi)
|
---|
602 |
|
---|
603 | #include <errno.h>
|
---|
604 | #include <sys/types.h>
|
---|
605 | #include <sys/stat.h>
|
---|
606 |
|
---|
607 | #endif
|
---|
608 |
|
---|
609 | /**************************************************************************/
|
---|
610 | /* Generic */
|
---|
611 | /**************************************************************************/
|
---|
612 |
|
---|
613 | #include <sys/wait.h> /* May need to adjust this for other OSs */
|
---|
614 |
|
---|
615 | /*
|
---|
616 | * Hack originally for ISC 2.2 POSIX headers, but may apply elsewhere,
|
---|
617 | * and it's safe, so just do it.
|
---|
618 | */
|
---|
619 | #if !defined(O_NDELAY) && defined(O_NONBLOCK)
|
---|
620 | # define O_NDELAY O_NONBLOCK
|
---|
621 | #endif /* !O_NDELAY && O_NONBLOCK */
|
---|
622 |
|
---|
623 | #if !defined(MAXHOSTNAMELEN)
|
---|
624 | # define MAXHOSTNAMELEN 32
|
---|
625 | #endif /* !MAXHOSTNAMELEN */
|
---|
626 |
|
---|
627 | #if !defined(X_NOT_POSIX)
|
---|
628 | # if defined(_POSIX_SOURCE)
|
---|
629 | # include <limits.h>
|
---|
630 | # else
|
---|
631 | # define _POSIX_SOURCE
|
---|
632 | # include <limits.h>
|
---|
633 | # undef _POSIX_SOURCE
|
---|
634 | # endif /* _POSIX_SOURCE */
|
---|
635 | #endif /* !X_NOT_POSIX */
|
---|
636 | #if !defined(PATH_MAX)
|
---|
637 | # if defined(MAXPATHLEN)
|
---|
638 | # define PATH_MAX MAXPATHLEN
|
---|
639 | # else
|
---|
640 | # define PATH_MAX 1024
|
---|
641 | # endif /* MAXPATHLEN */
|
---|
642 | #endif /* !PATH_MAX */
|
---|
643 |
|
---|
644 | #ifdef NEED_STRERROR
|
---|
645 | # ifndef strerror
|
---|
646 | extern char *sys_errlist[];
|
---|
647 | extern int sys_nerr;
|
---|
648 | # define strerror(n) \
|
---|
649 | ((n) >= 0 && (n) < sys_nerr) ? sys_errlist[n] : "unknown error"
|
---|
650 | # endif /* !strerror */
|
---|
651 | #endif /* NEED_STRERROR */
|
---|
652 |
|
---|
653 | #if defined(ISC) || defined(Lynx)
|
---|
654 | #define rint(x) RInt(x)
|
---|
655 | double RInt(
|
---|
656 | double x
|
---|
657 | );
|
---|
658 | #endif
|
---|
659 |
|
---|
660 | #ifndef DEV_MEM
|
---|
661 | #define DEV_MEM "/dev/mem"
|
---|
662 | #endif
|
---|
663 |
|
---|
664 | #ifndef VT_SYSREQ_DEFAULT
|
---|
665 | #define VT_SYSREQ_DEFAULT FALSE
|
---|
666 | #endif
|
---|
667 |
|
---|
668 | #ifdef OSMOUSE_ONLY
|
---|
669 | # ifndef MOUSE_PROTOCOL_IN_KERNEL
|
---|
670 | # define MOUSE_PROTOCOL_IN_KERNEL
|
---|
671 | # endif
|
---|
672 | #endif
|
---|
673 |
|
---|
674 | #define SYSCALL(call) while(((call) == -1) && (errno == EINTR))
|
---|
675 |
|
---|
676 | #define XF86_OS_PRIVS
|
---|
677 | #include "xf86_OSproc.h"
|
---|
678 |
|
---|
679 | #ifndef NO_COMPILER_H
|
---|
680 | #include "compiler.h"
|
---|
681 | #endif
|
---|
682 |
|
---|
683 | #endif /* _XF86_OSLIB_H */
|
---|