1 |
josejx 08/01/06 19:47:19 |
2 |
|
3 |
Modified: bioscall.c setup.py vbe.c |
4 |
Log: |
5 |
Fixed vbe on amd64 with dummy module, another range fix. |
6 |
|
7 |
Revision Changes Path |
8 |
1.2 xac/src/bioscall.c |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-src/xac/src/bioscall.c?rev=1.2&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-src/xac/src/bioscall.c?rev=1.2&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-src/xac/src/bioscall.c?r1=1.1&r2=1.2 |
13 |
|
14 |
Index: bioscall.c |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-src/xac/src/bioscall.c,v |
17 |
retrieving revision 1.1 |
18 |
retrieving revision 1.2 |
19 |
diff -u -r1.1 -r1.2 |
20 |
--- bioscall.c 25 Aug 2006 19:48:26 -0000 1.1 |
21 |
+++ bioscall.c 6 Jan 2008 19:47:18 -0000 1.2 |
22 |
@@ -6,6 +6,9 @@ |
23 |
* Joseph Jezak, 2006 |
24 |
*/ |
25 |
|
26 |
+#if defined(__i386__) && (defined(__linux__) || defined(__NetBSD__) \ |
27 |
+ || defined(__FreeBSD__) || defined(__OpenBSD__)) |
28 |
+ |
29 |
#include <sys/types.h> |
30 |
#include <sys/io.h> |
31 |
#include <sys/stat.h> |
32 |
@@ -355,3 +358,5 @@ |
33 |
do_vm86(&vm, mem, BIOSCALL_START_OFS + sizeof(call)); |
34 |
memcpy(regs, &vm.regs, sizeof(vm.regs)); |
35 |
} |
36 |
+ |
37 |
+#endif /* (__linux__ || __NetBSD__ || __FreeBSD__ || __OpenBSD__) && __i386__ */ |
38 |
|
39 |
|
40 |
|
41 |
1.3 xac/src/setup.py |
42 |
|
43 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-src/xac/src/setup.py?rev=1.3&view=markup |
44 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-src/xac/src/setup.py?rev=1.3&content-type=text/plain |
45 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-src/xac/src/setup.py?r1=1.2&r2=1.3 |
46 |
|
47 |
Index: setup.py |
48 |
=================================================================== |
49 |
RCS file: /var/cvsroot/gentoo-src/xac/src/setup.py,v |
50 |
retrieving revision 1.2 |
51 |
retrieving revision 1.3 |
52 |
diff -u -r1.2 -r1.3 |
53 |
--- setup.py 13 Feb 2007 00:52:31 -0000 1.2 |
54 |
+++ setup.py 6 Jan 2008 19:47:18 -0000 1.3 |
55 |
@@ -8,11 +8,7 @@ |
56 |
vbe_module = Extension("vbe", |
57 |
sources = ["bioscall.c", "lrmi.c", "vbe.c"]) |
58 |
|
59 |
-### If we're not building for x86, don't build the vbe module |
60 |
-if 1: |
61 |
- ext_modules = [pci_module] |
62 |
-else: |
63 |
- ext_modules = [pci_module, vbe_module] |
64 |
+ext_modules = [pci_module, vbe_module] |
65 |
|
66 |
setup( name="pci", |
67 |
version="1.0", |
68 |
|
69 |
|
70 |
|
71 |
1.4 xac/src/vbe.c |
72 |
|
73 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-src/xac/src/vbe.c?rev=1.4&view=markup |
74 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-src/xac/src/vbe.c?rev=1.4&content-type=text/plain |
75 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-src/xac/src/vbe.c?r1=1.3&r2=1.4 |
76 |
|
77 |
Index: vbe.c |
78 |
=================================================================== |
79 |
RCS file: /var/cvsroot/gentoo-src/xac/src/vbe.c,v |
80 |
retrieving revision 1.3 |
81 |
retrieving revision 1.4 |
82 |
diff -u -r1.3 -r1.4 |
83 |
--- vbe.c 1 Mar 2007 21:10:59 -0000 1.3 |
84 |
+++ vbe.c 6 Jan 2008 19:47:18 -0000 1.4 |
85 |
@@ -10,6 +10,9 @@ |
86 |
* |
87 |
*/ |
88 |
|
89 |
+#if defined(__i386__) && (defined(__linux__) || defined(__NetBSD__) \ |
90 |
+ || defined(__FreeBSD__) || defined(__OpenBSD__)) |
91 |
+ |
92 |
#include <sys/types.h> |
93 |
#include <sys/io.h> |
94 |
#include <sys/mman.h> |
95 |
@@ -31,9 +34,8 @@ |
96 |
int ret = 0; |
97 |
|
98 |
/* Initialize LRMI. */ |
99 |
- if(LRMI_init() == 0) { |
100 |
- return 0; |
101 |
- } |
102 |
+ if(LRMI_init() == 0) |
103 |
+ return Py_BuildValue("i", 0); |
104 |
|
105 |
memset(®s, 0, sizeof(regs)); |
106 |
regs.eax = 0x4f15; |
107 |
@@ -46,19 +48,17 @@ |
108 |
ioperm(0, 0x400, 1); |
109 |
|
110 |
if(LRMI_int(0x10, ®s) == 0) { |
111 |
- return 0; |
112 |
+ ret = 0; |
113 |
} |
114 |
- |
115 |
- /* Check for successful return. */ |
116 |
- if((regs.eax & 0xff) == 0x4f) { |
117 |
+ else { |
118 |
/* Supported. */ |
119 |
- ret = 1; |
120 |
- } else { |
121 |
+ if((regs.eax & 0xff) == 0x4f) |
122 |
+ ret = 1; |
123 |
/* Not supported. */ |
124 |
- ret = 0; |
125 |
+ else |
126 |
+ ret = 0; |
127 |
} |
128 |
|
129 |
- /* Clean up and return. */ |
130 |
return Py_BuildValue("i", ret); |
131 |
} |
132 |
|
133 |
@@ -72,15 +72,14 @@ |
134 |
PyObject *p; |
135 |
|
136 |
/* Initialize LRMI. */ |
137 |
- if(LRMI_init() == 0) { |
138 |
+ if(LRMI_init() == 0) |
139 |
return NULL; |
140 |
- } |
141 |
|
142 |
/* Allocate a chunk of memory. */ |
143 |
mem = LRMI_alloc_real(sizeof(struct vbe_edid1_info)); |
144 |
- if(mem == NULL) { |
145 |
+ if(mem == NULL) |
146 |
return NULL; |
147 |
- } |
148 |
+ |
149 |
memset(mem, 0, sizeof(struct vbe_edid1_info)); |
150 |
|
151 |
memset(®s, 0, sizeof(regs)); |
152 |
@@ -144,3 +143,23 @@ |
153 |
PyObject *m; |
154 |
m = Py_InitModule3("vbe", module_methods,"Allow VESA EDID info to be accessed on x86"); |
155 |
} |
156 |
+ |
157 |
+#else /* (__linux__ || __NetBSD__ || __FreeBSD__ || __OpenBSD__) && __i386__ */ |
158 |
+ |
159 |
+/* Always returns false */ |
160 |
+static PyObject * vbe_get_edid_supported() |
161 |
+{ |
162 |
+ return Py_BuildValue("i", 0); |
163 |
+} |
164 |
+ |
165 |
+static struct PyMethodDef module_methods[] = { |
166 |
+ {"vbe_get_edid_supported", (PyCFunction)vbe_get_edid_supported, METH_NOARGS, "Dummy module - Not supported"}, |
167 |
+ {NULL, NULL, 0, NULL}, |
168 |
+}; |
169 |
+ |
170 |
+PyMODINIT_FUNC initvbe(void) { |
171 |
+ PyObject *m; |
172 |
+ m = Py_InitModule3("vbe", module_methods,"Dummy VBE module"); |
173 |
+} |
174 |
+ |
175 |
+#endif /* (__linux__ || __NetBSD__ || __FreeBSD__ || __OpenBSD__) && __i386__ */ |
176 |
|
177 |
|
178 |
|
179 |
-- |
180 |
gentoo-commits@l.g.o mailing list |