Root/svgalib/patches/030-no-vga.patch

1Index: svgalib-1.4.3/src/vga.c
2===================================================================
3--- svgalib-1.4.3.orig/src/vga.c 2011-01-06 12:44:21.000000000 +0100
4+++ svgalib-1.4.3/src/vga.c 2011-01-06 13:24:11.000000000 +0100
5@@ -519,7 +519,8 @@
6 
7 /* Chipset specific functions */
8 
9-DriverSpecs *__svgalib_driverspecs = &__svgalib_vga_driverspecs;
10+#define __svgalib_vga_driverspecs __svgalib_fbdev_driverspecs
11+DriverSpecs *__svgalib_driverspecs = &__svgalib_fbdev_driverspecs;
12 
13 #ifndef BACKGROUND
14 static void (*__svgalib_setpage) (int); /* gives little faster vga_setpage() */
15@@ -537,7 +538,9 @@
16 DriverSpecs *__svgalib_driverspecslist[] =
17 {
18     NULL, /* chipset undefined */
19+#if 0 /* vga disabled */
20     &__svgalib_vga_driverspecs,
21+#endif
22 #ifdef INCLUDE_ET4000_DRIVER
23     &__svgalib_et4000_driverspecs,
24 #else
25@@ -1504,12 +1507,12 @@
26     else
27 #endif
28 
29- if (__svgalib_vga_driverspecs.test())
30- CHIPSET = VGA;
31+ if (__svgalib_fbdev_driverspecs.test())
32+ CHIPSET = FBDEV;
33     else
34         /* else */
35     {
36- fprintf(stderr, "svgalib: Cannot find EGA or VGA graphics device.\n");
37+ fprintf(stderr, "svgalib: Cannot find fbdev graphics device.\n");
38         exit(1);
39     }
40     __svgalib_setpage = __svgalib_driverspecs->__svgalib_setpage;
41@@ -4441,7 +4444,8 @@
42 };
43 
44 
45-#ifdef __alpha__
46+#if 0
47+/* #ifdef __alpha__ */
48 
49 #define vuip volatile unsigned int *
50 
51Index: svgalib-1.4.3/src/vgadrv.c
52===================================================================
53--- svgalib-1.4.3.orig/src/vgadrv.c 2011-01-06 12:44:21.000000000 +0100
54+++ svgalib-1.4.3/src/vgadrv.c 2011-01-06 13:13:47.000000000 +0100
55@@ -13,6 +13,8 @@
56 #include "libvga.h"
57 #include "driver.h"
58 
59+#if 0 /* vga disabled */
60+
61 /* BIOS mode 0Dh - 320x200x16 */
62 static const unsigned char g320x200x16_regs[60] =
63 {
64@@ -311,3 +313,5 @@
65 
66     return 0;
67 }
68+
69+#endif /* vga disabled */
70Index: svgalib-1.4.3/src/libvga.h
71===================================================================
72--- svgalib-1.4.3.orig/src/libvga.h 2011-01-06 13:13:47.000000000 +0100
73+++ svgalib-1.4.3/src/libvga.h 2011-01-06 13:13:47.000000000 +0100
74@@ -216,7 +216,18 @@
75 extern void __svgalib_acquirevt_signal(int n);
76 #endif
77 
78-#ifdef __alpha__
79+
80+/* do not compile vga direct hw access code. It is not called anyways when
81+ * using fbdev driver. It won't compile on some non-x86 hw. */
82+#define ioperm(a,b,c) (-1)
83+#define port_in(a) (0)
84+#define port_out(a,b) (void)0
85+#define port_outw(a,b) (void)0
86+#define inb(a) (0)
87+#define outb(a,b) (void)0
88+
89+#if 0
90+/* #ifdef __alpha__ */
91 
92 #include <asm/io.h>
93 
94@@ -270,50 +281,60 @@
95 
96 #else
97 
98-static __inline__ void port_out(int value, int port)
99-{
100- __asm__ volatile ("outb %0,%1"
101- ::"a" ((unsigned char) value), "d"((unsigned short) port));
102-}
103-
104-static __inline__ void port_outw(int value, int port)
105-{
106- __asm__ volatile ("outw %0,%1"
107- ::"a" ((unsigned short) value), "d"((unsigned short) port));
108-}
109-
110-static __inline__ void port_outl(int value, int port)
111-{
112- __asm__ volatile ("outl %0,%1"
113- ::"a" ((unsigned long)value), "d" ((unsigned short) port));
114-}
115-
116-static __inline__ int port_in(int port)
117-{
118- unsigned char value;
119- __asm__ volatile ("inb %1,%0"
120- :"=a" (value)
121- :"d"((unsigned short) port));
122- return value;
123-}
124-
125-static __inline__ int port_inw(int port)
126-{
127- unsigned short value;
128- __asm__ volatile ("inw %1,%0"
129- :"=a" (value)
130- :"d"((unsigned short) port));
131- return value;
132-}
133-
134-static __inline__ int port_inl(int port)
135-{
136- unsigned int value;
137- __asm__ volatile("inl %1,%0" :
138- "=a" (value) :
139- "d" ((unsigned short)port));
140- return value;
141-}
142+/* do not compile vga direct hw access code. It is not called anyways when
143+ * using fbdev driver. It won't compile on some non-x86 hw. */
144+#define ioperm(a,b,c) (-1)
145+#define port_in(a) (0)
146+#define port_inw(a) (0)
147+#define port_inl(a) (0)
148+#define port_out(a,b) (void)0
149+#define port_outl(a,b) (void)0
150+#define port_outw(a,b) (void)0
151+
152+/* static __inline__ void port_out(int value, int port) */
153+/* { */
154+/* __asm__ volatile ("outb %0,%1" */
155+/* ::"a" ((unsigned char) value), "d"((unsigned short) port)); */
156+/* } */
157+
158+/* static __inline__ void port_outw(int value, int port) */
159+/* { */
160+/* __asm__ volatile ("outw %0,%1" */
161+/* ::"a" ((unsigned short) value), "d"((unsigned short) port)); */
162+/* } */
163+
164+/* static __inline__ void port_outl(int value, int port) */
165+/* { */
166+/* __asm__ volatile ("outl %0,%1" */
167+/* ::"a" ((unsigned long)value), "d" ((unsigned short) port)); */
168+/* } */
169+
170+/* static __inline__ int port_in(int port) */
171+/* { */
172+/* unsigned char value; */
173+/* __asm__ volatile ("inb %1,%0" */
174+/* :"=a" (value) */
175+/* :"d"((unsigned short) port)); */
176+/* return value; */
177+/* } */
178+
179+/* static __inline__ int port_inw(int port) */
180+/* { */
181+/* unsigned short value; */
182+/* __asm__ volatile ("inw %1,%0" */
183+/* :"=a" (value) */
184+/* :"d"((unsigned short) port)); */
185+/* return value; */
186+/* } */
187+
188+/* static __inline__ int port_inl(int port) */
189+/* { */
190+/* unsigned int value; */
191+/* __asm__ volatile("inl %1,%0" : */
192+/* "=a" (value) : */
193+/* "d" ((unsigned short)port)); */
194+/* return value; */
195+/* } */
196 
197 #define gr_readb(off) (((volatile unsigned char *)GM)[(off)])
198 #define gr_readw(off) (*(volatile unsigned short*)((GM)+(off)))
199@@ -322,7 +343,6 @@
200 #define gr_writew(v,off) (*(unsigned short*)((GM)+(off)) = (v))
201 #define gr_writel(v,off) (*(unsigned long*)((GM)+(off)) = (v))
202 
203-
204 #endif
205 
206 /* Note that the arguments of outb/w are reversed compared with the */
207

Archive Download this file



interactive