summaryrefslogtreecommitdiff
path: root/sysutils/atitvout/patches/patch-aa
blob: 6292e059c51ba16592cba9946bf9c4e15e65c70c (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
47
48
49
$NetBSD: patch-aa,v 1.2 2003/08/13 13:58:57 mrg Exp $

--- atitvout.c.orig	2002-09-17 05:37:08.000000000 +1000
+++ atitvout.c	2003-08-13 23:53:57.000000000 +1000
@@ -17,7 +17,13 @@
  */
 
 #include <stdio.h>
+#ifdef __linux__
 #include <sys/io.h>
+#endif
+#ifdef __NetBSD__
+#include <sys/types.h>
+#include <machine/sysarch.h>
+#endif
 #include <string.h>
 #include <assert.h>
 
@@ -98,8 +104,21 @@
         return 0;
     }
     
+#ifdef __linux__
     ioperm(0, 1024, 1);
     iopl(3);
+#endif
+#ifdef __NetBSD__
+    {
+#define FF	0xFFFFFFFF
+#define FF8	FF, FF, FF, FF, FF, FF, FF, FF
+	u_long map[] = { FF8, FF8, FF8, FF8 };
+#undef FF
+#undef FF8
+        i386_set_ioperm(map);
+    }
+    i386_iopl(3);
+#endif
 
     if (!LRMI_init()) {
         fprintf(stderr, "Could not initialise LRMI.\n");
@@ -118,6 +137,8 @@
     } else {
         if (strncmp(oem, "ATI MACH64", 10) == 0)
             radeon = 0;
+        else if (strcmp(oem, "ATI MOBILITY RADEON 9000") == 0)
+            radeon = 0;
         else if (strncmp(oem, "ATI RAGE128", 11) == 0)
             radeon = 1;
         /* Note: Also it's possible to have here 'RG6' for first radeons */