Imported Debian patch 2:1.15.1-0ubuntu2.6
[deb_xorg-server.git] / debian / patches / 08_xfree86_fix_ia64_inx_outx.diff
1 From: Stephan Schreiber <info@fs-driver.org>
2 Subject: xfree86: restore {in,out}{b,w,l} on linux/ia64
3
4 Call the equivalent glibc functions.
5
6 Debian bug #685750
7
8 --- a/hw/xfree86/common/compiler.h
9 +++ b/hw/xfree86/common/compiler.h
10 @@ -438,6 +438,54 @@ extern _X_EXPORT unsigned int inl(unsign
11 #include <machine/pio.h>
12 #endif /* __NetBSD__ */
13
14 +#elif defined(linux) && defined(__ia64__)
15 +/* for Linux on ia64, we use the LIBC _inx/_outx routines */
16 +/* note that the appropriate setup via "ioperm" needs to be done */
17 +/* *before* any inx/outx is done. */
18 +
19 +extern _X_EXPORT void _outb(unsigned char val, unsigned long port);
20 +extern _X_EXPORT void _outw(unsigned short val, unsigned long port);
21 +extern _X_EXPORT void _outl(unsigned int val, unsigned long port);
22 +extern _X_EXPORT unsigned int _inb(unsigned long port);
23 +extern _X_EXPORT unsigned int _inw(unsigned long port);
24 +extern _X_EXPORT unsigned int _inl(unsigned long port);
25 +
26 +static __inline__ void
27 +outb(unsigned long port, unsigned char val)
28 +{
29 + _outb(val, port);
30 +}
31 +
32 +static __inline__ void
33 +outw(unsigned long port, unsigned short val)
34 +{
35 + _outw(val, port);
36 +}
37 +
38 +static __inline__ void
39 +outl(unsigned long port, unsigned int val)
40 +{
41 + _outl(val, port);
42 +}
43 +
44 +static __inline__ unsigned int
45 +inb(unsigned long port)
46 +{
47 + return _inb(port);
48 +}
49 +
50 +static __inline__ unsigned int
51 +inw(unsigned long port)
52 +{
53 + return _inw(port);
54 +}
55 +
56 +static __inline__ unsigned int
57 +inl(unsigned long port)
58 +{
59 + return _inl(port);
60 +}
61 +
62 #elif (defined(linux) || defined(__FreeBSD__)) && defined(__amd64__)
63
64 #include <inttypes.h>