summaryrefslogtreecommitdiff
path: root/graphics/cqcam/patches/patch-ab
blob: a78f64ca4f5c923e261bc2dd98267a498adcf26c (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
$NetBSD: patch-ab,v 1.4 2004/07/10 22:18:23 wiz Exp $

--- port.C.orig	1997-10-27 18:29:35.000000000 +0100
+++ port.C
@@ -10,6 +10,7 @@
 
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <errno.h>
 #include "config.h"
 
@@ -30,6 +31,10 @@
   #endif
 #elif defined(FREEBSD)
 #include <machine/cpufunc.h>
+#elif defined(NETBSD)
+#include <sys/types.h>
+#include <machine/sysarch.h>
+#include <machine/pio.h>	/* XXX */
 #elif defined(BSDI)
 #include <machine/inline.h>
 #elif defined(LYNX)
@@ -62,6 +67,20 @@ port_t::port_t(int iport) {
     perror("fopen /dev/io");
     return;
   }
+#elif defined(NETBSD)
+# if defined(__alpha__)
+  if (alpha_pci_io_enable(1) != 0) {
+    perror("alpha_pci_io_enable");
+    return;
+  }
+# elif defined(__i386__)
+  if (i386_iopl(3) != 0) {
+    perror("i386_iopl");
+    return;
+  }
+# else
+#  error Not supported on this CPU.
+# endif
 #elif defined(LYNX)
   if (io_access() < 0) {
     perror("io_access");