summaryrefslogtreecommitdiff
path: root/graphics/nvtv/patches/patch-ae
blob: 187f5b49ec1e24c3942a7172d3f0a61dd211ef5c (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
$NetBSD: patch-ae,v 1.1.1.1 2003/10/05 09:16:17 cube Exp $

--- src/tv_tdfx.c.orig	2003-02-05 17:33:10.000000000 +0100
+++ src/tv_tdfx.c
@@ -233,6 +233,7 @@ VSyncEnd     ---   ---   ---   ---   ---
 /* FIXME: Put that somewhere else */
 /* from xfree common/compiler.h */
 
+#ifndef __NetBSD__
 #ifdef linux 
 #include <sys/io.h>
 
@@ -265,6 +266,29 @@ inb (unsigned short int port)
 
 #endif
 
+#else
+static __inline__ u_int8_t
+inb(port)
+	u_int16_t port;
+{
+	u_int8_t r;
+
+	__asm__ __volatile__ ("inb %w1,%0" : "=a" (r) : "Nd" (port));
+
+	return r;
+}
+
+static __inline__ void
+outb(value, port)
+	u_int8_t value;
+	u_int16_t port;
+{
+	__asm__ __volatile__ ("outb %b0,%w1" : : "a" (value), "Nd" (port));
+}
+
+#define OUTB(p,v) outb(v,p)
+#define INB(p) inb(p)
+#endif
 /* FIXME: variable port addr */
 
 CARD8 readCrtTdfx (TDFXPtr hwp, CARD8 index)