summaryrefslogtreecommitdiffstats
path: root/x11/mgapdesk/files/patch-ab
blob: 60e5ad5e3e5c7ca9902d24821d265c403902b385 (plain)
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
--- src/io.c.orig	Thu May 31 04:10:39 2001
+++ src/io.c	Sat Jun  2 13:21:25 2001
@@ -14,18 +14,40 @@
 
 #include "global.h"
 #include "io.h"
+#ifdef BSD
+/*
+ * Make a phony iopl call. Opening /dev/io in BSD permits all I/O access.
+ * There is no granularity.
+ */
+#include <stdio.h>
+int iopl(int on) {
+	static FILE *f=NULL;
+
+	if (on) {
+		if (f!=NULL)
+			return 0; /* already on */
+		f=fopen("/dev/io","r+");
+		return (f==NULL);
+	} else {
+		fclose(f);
+		f=NULL;
+		return 0;
+	}
+}
+
+#endif
 
 static int int_pci_conf1_read_config_dword(unsigned char bus, unsigned char device_fn, unsigned char where, unsigned int *value)
 { 
-	outl(CONFIG_CMD(bus,device_fn,where), 0xCF8 );
+	outl(0xCF8, CONFIG_CMD(bus,device_fn,where));
 	*value = inl(0xCFC); 
 	return 1;
 }
 
 static int int_pci_conf1_write_config_dword(unsigned char bus, unsigned char device_fn, unsigned char where, unsigned int value)
 { 
-	outl(CONFIG_CMD(bus,device_fn,where), 0xCF8 );
-	outl(value, ((0xCFC + (where & 3)))); 
+	outl(0xCF8, CONFIG_CMD(bus,device_fn,where));
+	outl(((0xCFC + (where & 3))), value); 
 	return 1;
 }
 
OpenPOWER on IntegriCloud