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