1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
|
--- configure.dist 2009-06-18 17:05:59.000000000 -0700
+++ configure 2009-06-18 17:08:47.000000000 -0700
@@ -1097,6 +1097,8 @@
SPARC64_VIDEO_TRUE
PPC_VIDEO_FALSE
PPC_VIDEO_TRUE
+IA64_VIDEO_FALSE
+IA64_VIDEO_TRUE
I386_VIDEO_FALSE
I386_VIDEO_TRUE
ARM_VIDEO_FALSE
@@ -19134,6 +19136,7 @@
GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
;;
ia64*)
+ IA64_VIDEO=yes
GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
;;
s390*)
@@ -19166,6 +19169,14 @@
I386_VIDEO_FALSE=
fi
+ if test "x$IA64_VIDEO" = xyes; then
+ IA64_VIDEO_TRUE=
+ IA64_VIDEO_FALSE='#'
+else
+ IA64_VIDEO_TRUE='#'
+ IA64_VIDEO_FALSE=
+fi
+
if test "x$PPC_VIDEO" = xyes; then
PPC_VIDEO_TRUE=
PPC_VIDEO_FALSE='#'
--- hw/xfree86/common/compiler.h.orig 2011-06-11 18:55:47.000000000 +0200
+++ hw/xfree86/common/compiler.h 2011-07-21 20:34:44.000000000 +0200
@@ -397,12 +397,10 @@
#include <machine/pio.h>
#endif /* __NetBSD__ */
-# elif defined(linux) && defined(__ia64__)
+# elif (defined(linux) || defined(__FreeBSD__)) && defined(__ia64__)
# include <inttypes.h>
-# include <sys/io.h>
-
# undef outb
# undef outw
# undef outl
--- hw/xfree86/os-support/bsd/Makefile.in.dist 2009-06-18 17:45:13.000000000 -0700
+++ hw/xfree86/os-support/bsd/Makefile.in 2009-06-18 17:45:19.000000000 -0700
@@ -63,6 +63,7 @@
@ALPHA_VIDEO_FALSE@@ARM_VIDEO_FALSE@@I386_VIDEO_FALSE@@PPC_VIDEO_FALSE@@SPARC64_VIDEO_TRUE@am__objects_1 = sparc64_video.lo \
@ALPHA_VIDEO_FALSE@@ARM_VIDEO_FALSE@@I386_VIDEO_FALSE@@PPC_VIDEO_FALSE@@SPARC64_VIDEO_TRUE@ ioperm_noop.lo
@ALPHA_VIDEO_FALSE@@ARM_VIDEO_FALSE@@I386_VIDEO_FALSE@@PPC_VIDEO_TRUE@am__objects_1 = ppc_video.lo
+@IA64_VIDEO_TRUE@am__objects_1 = ia64_video.lo
@ALPHA_VIDEO_FALSE@@ARM_VIDEO_FALSE@@I386_VIDEO_TRUE@am__objects_1 = i386_video.lo
@ALPHA_VIDEO_FALSE@@ARM_VIDEO_TRUE@am__objects_1 = arm_video.lo
@ALPHA_VIDEO_TRUE@am__objects_1 = alpha_video.lo bsd_ev56.lo \
@@ -393,6 +394,7 @@
@ARM_VIDEO_TRUE@ARCH_SOURCES = arm_video.c
@I386_VIDEO_TRUE@ARCH_SOURCES = i386_video.c
+@IA64_VIDEO_TRUE@ARCH_SOURCES = ia64_video.c
@PPC_VIDEO_TRUE@ARCH_SOURCES = ppc_video.c
# Cheat here and piggyback other sparc64 bits on SPARC64_VIDEO.
--- /dev/null 2009-06-18 18:27:23.000000000 -0700
+++ hw/xfree86/os-support/bsd/ia64_video.c 2009-06-18 18:26:02.000000000 -0700
@@ -0,0 +1,150 @@
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <X11/X.h>
+#include "xf86.h"
+#include "xf86Priv.h"
+
+#include "xf86_OSlib.h"
+#include "xf86OSpriv.h"
+
+#include "bus/Pci.h"
+
+#ifndef MAP_FAILED
+#define MAP_FAILED ((caddr_t)-1)
+#endif
+
+
+/***************************************************************************/
+/* Video Memory Mapping section */
+/***************************************************************************/
+
+#define DEV_MEM "/dev/mem"
+
+static pointer ia64MapVidMem(int, unsigned long, unsigned long, int flags);
+static void ia64UnmapVidMem(int, pointer, unsigned long);
+
+Bool xf86EnableIO(void);
+void xf86DisableIO(void);
+
+void
+xf86OSInitVidMem(VidMemInfoPtr pVidMem)
+{
+ pVidMem->linearSupported = TRUE;
+ pVidMem->mapMem = ia64MapVidMem;
+ pVidMem->unmapMem = ia64UnmapVidMem;
+ pVidMem->initialised = TRUE;
+ xf86EnableIO();
+}
+
+
+_X_EXPORT volatile unsigned char *ioBase = MAP_FAILED;
+
+static pointer
+ia64MapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
+{
+ int fd = xf86Info.screenFd;
+ pointer base;
+#ifdef DEBUG
+ xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d",
+ Base, Size, fd);
+#endif
+
+ base = mmap(0, Size,
+ (flags & VIDMEM_READONLY) ?
+ PROT_READ : (PROT_READ | PROT_WRITE),
+ MAP_SHARED, fd, Base);
+ if (base == MAP_FAILED)
+ FatalError("%s: could not mmap screen [s=%lx,a=%lx] (%s)",
+ "xf86MapVidMem", Size, Base, strerror(errno));
+
+ return base;
+}
+
+static void
+ia64UnmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
+{
+ munmap(Base, Size);
+}
+
+_X_EXPORT int
+xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
+ int Len)
+{
+ int rv;
+ static int kmem = -1;
+
+ if (kmem == -1) {
+ kmem = open(DEV_MEM, 2);
+ if (kmem == -1) {
+ FatalError("xf86ReadBIOS: open %s", DEV_MEM);
+ }
+ }
+
+#ifdef DEBUG
+ xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS() %lx %lx, %x\n",
+ Base, Offset, Len);
+#endif
+
+
+ lseek(kmem, Base + Offset, 0);
+ rv = read(kmem, Buf, Len);
+
+ return rv;
+}
+
+Bool xf86EnableIO()
+{
+ int fd = xf86Info.screenFd;
+
+ xf86MsgVerb(X_WARNING, 3, "xf86EnableIO %d\n", fd);
+ if (ioBase == MAP_FAILED)
+ {
+ ioBase=mmap(NULL, 0x10000, PROT_READ|PROT_WRITE, MAP_SHARED, fd,
+ 0);
+ xf86MsgVerb(X_INFO, 3, "xf86EnableIO: %p\n", ioBase);
+ if (ioBase == MAP_FAILED) {
+ xf86MsgVerb(X_WARNING, 3, "Can't map IO space!\n");
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+
+void xf86DisableIO()
+{
+
+ if (ioBase != MAP_FAILED)
+ {
+ munmap((void *)(uintptr_t)(void *)ioBase, 0x10000);
+ ioBase = MAP_FAILED;
+ }
+}
+
+void outb(unsigned long port, unsigned char val)
+{
+}
+
+void outw(unsigned long port, unsigned short val)
+{
+}
+
+void outl(unsigned long port, unsigned int val)
+{
+}
+
+unsigned int inb(unsigned long port)
+{
+ return 0xff;
+}
+
+unsigned int inw(unsigned long port)
+{
+ return 0xffff;
+}
+
+unsigned int inl(unsigned long port)
+{
+ return 0xffffffff;
+}
|