Sat Aug 2 16:46:56 2008 UTC ()
Fix broken build on -current. While here, make it build on amd64 too.
(Patches have been sent upstream.)
PKGREVISION++.


(dholland)
diff -r1.10 -r1.11 pkgsrc/audio/cs4235/Makefile
diff -r1.3 -r1.4 pkgsrc/audio/cs4235/distinfo
diff -r0 -r1.1 pkgsrc/audio/cs4235/patches/patch-aa
diff -r0 -r1.1 pkgsrc/audio/cs4235/patches/patch-ab
diff -r0 -r1.1 pkgsrc/audio/cs4235/patches/patch-ac
diff -r0 -r1.1 pkgsrc/audio/cs4235/patches/patch-ad
diff -r0 -r1.1 pkgsrc/audio/cs4235/patches/patch-ae
diff -r0 -r1.1 pkgsrc/audio/cs4235/patches/patch-af

cvs diff -r1.10 -r1.11 pkgsrc/audio/cs4235/Makefile (expand / switch to unified diff)

--- pkgsrc/audio/cs4235/Makefile 2006/11/05 14:47:55 1.10
+++ pkgsrc/audio/cs4235/Makefile 2008/08/02 16:46:56 1.11
@@ -1,17 +1,18 @@ @@ -1,17 +1,18 @@
1# $NetBSD: Makefile,v 1.10 2006/11/05 14:47:55 rillig Exp $ 1# $NetBSD: Makefile,v 1.11 2008/08/02 16:46:56 dholland Exp $
2# 2#
3 3
4DISTNAME= cs4235-20001009 4DISTNAME= cs4235-20001009
 5PKGREVISION= 1
5CATEGORIES= audio sysutils 6CATEGORIES= audio sysutils
6MASTER_SITES= http://www.invisible.ca/~jmcneill/ 7MASTER_SITES= http://www.invisible.ca/~jmcneill/
7 8
8MAINTAINER= jmcneill@NetBSD.org 9MAINTAINER= jmcneill@NetBSD.org
9HOMEPAGE= http://www.invisible.ca/~jmcneill/ 10HOMEPAGE= http://www.invisible.ca/~jmcneill/
10COMMENT= Modifies the 3D mode on Crystal CS4235 sound cards 11COMMENT= Modifies the 3D mode on Crystal CS4235 sound cards
11 12
12ONLY_FOR_PLATFORM= NetBSD-*-i386 13ONLY_FOR_PLATFORM= NetBSD-*-i386 NetBSD-*-x86_64
13 14
14WRKSRC= ${WRKDIR}/cs4235 15WRKSRC= ${WRKDIR}/cs4235
15MAKE_ENV+= ${BSD_MAKE_ENV} 16MAKE_ENV+= ${BSD_MAKE_ENV}
16 17
17.include "../../mk/bsd.pkg.mk" 18.include "../../mk/bsd.pkg.mk"

cvs diff -r1.3 -r1.4 pkgsrc/audio/cs4235/distinfo (expand / switch to unified diff)

--- pkgsrc/audio/cs4235/distinfo 2005/02/23 20:39:43 1.3
+++ pkgsrc/audio/cs4235/distinfo 2008/08/02 16:46:56 1.4
@@ -1,5 +1,11 @@ @@ -1,5 +1,11 @@
1$NetBSD: distinfo,v 1.3 2005/02/23 20:39:43 agc Exp $ 1$NetBSD: distinfo,v 1.4 2008/08/02 16:46:56 dholland Exp $
2 2
3SHA1 (cs4235-20001009.tar.gz) = 599d28d94dc72ccccb0d9478f5e0383bcbff2bd8 3SHA1 (cs4235-20001009.tar.gz) = 599d28d94dc72ccccb0d9478f5e0383bcbff2bd8
4RMD160 (cs4235-20001009.tar.gz) = f1768596e9dee389d9435f8ce72fc61ba2f36dfa 4RMD160 (cs4235-20001009.tar.gz) = f1768596e9dee389d9435f8ce72fc61ba2f36dfa
5Size (cs4235-20001009.tar.gz) = 1967 bytes 5Size (cs4235-20001009.tar.gz) = 1967 bytes
 6SHA1 (patch-aa) = 428bbba16bd1fe32f96ec9cbb0062ac053693f49
 7SHA1 (patch-ab) = 10f85ffd04057ae9612134940590053a5764e151
 8SHA1 (patch-ac) = ed060c5977d645dca15ed712d339f019672f008c
 9SHA1 (patch-ad) = 6ffe4c9afb240f125d3bd815049641961cfb3f38
 10SHA1 (patch-ae) = 9f8ab76babd508b3399c6862af74f49d447ffe98
 11SHA1 (patch-af) = 8bac18e90fb8ae57bf6fd1cf8edded10c1c909ef

File Added: pkgsrc/audio/cs4235/patches/patch-aa
$NetBSD: patch-aa,v 1.1 2008/08/02 16:46:56 dholland Exp $

diff -urpN Makefile.orig Makefile
--- Makefile.orig	2000-10-09 09:55:19.000000000 -0400
+++ Makefile	2008-08-02 12:09:06.000000000 -0400
@@ -3,7 +3,7 @@
 PROG=	cs4235_3dctl
 SRCS=	cs4235_3dctl.c cs4235_ctl.c
 
-LDFLAGS=-li386
+LDFLAGS=-l$(MACHINE_ARCH)
 
 NOMAN=	Sorry
 

File Added: pkgsrc/audio/cs4235/patches/patch-ab
$NetBSD: patch-ab,v 1.1 2008/08/02 16:46:56 dholland Exp $

diff -urpN cs4235_3dctl.c.orig cs4235_3dctl.c
--- cs4235_3dctl.c.orig	2000-10-09 09:55:19.000000000 -0400
+++ cs4235_3dctl.c	2008-08-02 12:21:57.000000000 -0400
@@ -10,9 +10,10 @@
 #include <sys/types.h>
 
 #include <stdio.h>
+#include <stdlib.h>
 
 #include <machine/sysarch.h>
-#include <machine/pio.h>
+#include "pio.h"
 
 #include "cs4235_ctl.h"
 
@@ -42,9 +43,9 @@ main(int argc, char *argv[])
 	}
 
 	/* Enable access to IO ports */
-	if (i386_iopl(3))
+	if (iopl(3))
 	{
-		perror("i386_iopl");
+		perror("iopl");
 		return(1);
 	}
 
@@ -62,7 +63,7 @@ main(int argc, char *argv[])
 	printf("cs4235.spacectl: %i -> %i\n", old_volume / 16, new_volume / 16);
 
 	/* Disable access to IO ports */
-	i386_iopl(0);
+	iopl(0);
 
 	/* All done */
 	return(0);

File Added: pkgsrc/audio/cs4235/patches/patch-ac
$NetBSD: patch-ac,v 1.1 2008/08/02 16:46:56 dholland Exp $

diff -urpN cs4235_ctl.c.orig cs4235_ctl.c
--- cs4235_ctl.c.orig	2000-10-09 09:55:19.000000000 -0400
+++ cs4235_ctl.c	2008-08-02 12:21:52.000000000 -0400
@@ -13,7 +13,7 @@
 #include <string.h>
 
 #include <machine/sysarch.h>
-#include <machine/pio.h>
+#include "pio.h"
 
 #include "cs4235_regs.h"
 #include "cs4235_ctl.h"

File Added: pkgsrc/audio/cs4235/patches/patch-ad
$NetBSD: patch-ad,v 1.1 2008/08/02 16:46:56 dholland Exp $

diff -urpN cs4235.orig/cs4235_ctl.h cs4235/cs4235_ctl.h
--- cs4235_ctl.h.orig	2000-10-09 09:55:19.000000000 -0400
+++ cs4235_ctl.h	2008-08-02 12:26:36.000000000 -0400
@@ -17,4 +17,10 @@ void	cs4235_enable_access_indirect	__P((
 void	cs4235_enable_access_extended	__P((void));
 void	cs4235_enable_3d		__P((void));
 
+#if defined(__i386__)
+#define iopl i386_iopl
+#elif defined(__x86_64__) || defined(__amd64__)
+#define iopl x86_64_iopl
+#endif
+
 #endif /* !_CS4235_CTL_H_ */

File Added: pkgsrc/audio/cs4235/patches/patch-ae
$NetBSD: patch-ae,v 1.1 2008/08/02 16:46:56 dholland Exp $

diff -urpN /dev/null pio.h
--- /dev/null	1969-12-31 19:00:00.000000000 -0500
+++ pio.h	2008-08-02 12:22:17.000000000 -0400
@@ -0,0 +1,7 @@
+#include <sys/param.h>
+
+#if __NetBSD_Version__ < 499003100       /* NetBSD 4.99.31 */
+#include <machine/pio.h>
+#else
+#include "x86_pio.h"
+#endif

File Added: pkgsrc/audio/cs4235/patches/patch-af
$NetBSD: patch-af,v 1.1 2008/08/02 16:46:56 dholland Exp $

diff -urpN /dev/null x86_pio.h
--- /dev/null	1969-12-31 19:00:00.000000000 -0500
+++ x86_pio.h	2008-08-02 12:15:47.000000000 -0400
@@ -0,0 +1,231 @@
+/*	$NetBSD: patch-af,v 1.1 2008/08/02 16:46:56 dholland Exp $	*/
+
+/*-
+ * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Charles M. Hannum.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *        This product includes software developed by the NetBSD
+ *        Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _X86_PIO_H_
+#define _X86_PIO_H_
+
+/*
+ * Functions to provide access to x86 programmed I/O instructions.
+ *
+ * The in[bwl]() and out[bwl]() functions are split into two varieties: one to
+ * use a small, constant, 8-bit port number, and another to use a large or
+ * variable port number.  The former can be compiled as a smaller instruction.
+ */
+
+
+#ifdef __OPTIMIZE__
+
+#define	__use_immediate_port(port) \
+	(__builtin_constant_p((port)) && (port) < 0x100)
+
+#else
+
+#define	__use_immediate_port(port)	0
+
+#endif
+
+
+#define	inb(port) \
+    (/* CONSTCOND */ __use_immediate_port(port) ? __inbc(port) : __inb(port))
+
+static __inline u_int8_t
+__inbc(unsigned port)
+{
+	u_int8_t data;
+	__asm volatile("inb %w1,%0" : "=a" (data) : "id" (port));
+	return data;
+}
+
+static __inline u_int8_t
+__inb(unsigned port)
+{
+	u_int8_t data;
+	__asm volatile("inb %w1,%0" : "=a" (data) : "d" (port));
+	return data;
+}
+
+static __inline void
+insb(unsigned port, void *addr, int cnt)
+{
+	void *dummy1;
+	int dummy2;
+	__asm volatile("cld\n\trep\n\tinsb"			:
+			 "=D" (dummy1), "=c" (dummy2) 		:
+			 "d" (port), "0" (addr), "1" (cnt)	:
+			 "memory");
+}
+
+#define	inw(port) \
+    (/* CONSTCOND */ __use_immediate_port(port) ? __inwc(port) : __inw(port))
+
+static __inline u_int16_t
+__inwc(unsigned port)
+{
+	u_int16_t data;
+	__asm volatile("inw %w1,%0" : "=a" (data) : "id" (port));
+	return data;
+}
+
+static __inline u_int16_t
+__inw(unsigned port)
+{
+	u_int16_t data;
+	__asm volatile("inw %w1,%0" : "=a" (data) : "d" (port));
+	return data;
+}
+
+static __inline void
+insw(unsigned port, void *addr, int cnt)
+{
+	void *dummy1;
+	int dummy2;
+	__asm volatile("cld\n\trep\n\tinsw"			:
+			 "=D" (dummy1), "=c" (dummy2)		:
+			 "d" (port), "0" (addr), "1" (cnt)	:
+			 "memory");
+}
+
+#define	inl(port) \
+    (/* CONSTCOND */ __use_immediate_port(port) ? __inlc(port) : __inl(port))
+
+static __inline u_int32_t
+__inlc(unsigned port)
+{
+	u_int32_t data;
+	__asm volatile("inl %w1,%0" : "=a" (data) : "id" (port));
+	return data;
+}
+
+static __inline u_int32_t
+__inl(unsigned port)
+{
+	u_int32_t data;
+	__asm volatile("inl %w1,%0" : "=a" (data) : "d" (port));
+	return data;
+}
+
+static __inline void
+insl(unsigned port, void *addr, int cnt)
+{
+	void *dummy1;
+	int dummy2;
+	__asm volatile("cld\n\trep\n\tinsl"			:
+			 "=D" (dummy1), "=c" (dummy2)		:
+			 "d" (port), "0" (addr), "1" (cnt)	:
+			 "memory");
+}
+
+#define	outb(port, data) \
+    (/* CONSTCOND */__use_immediate_port(port) ? __outbc(port, data) : \
+						__outb(port, data))
+
+static __inline void
+__outbc(unsigned port, u_int8_t data)
+{
+	__asm volatile("outb %0,%w1" : : "a" (data), "id" (port));
+}
+
+static __inline void
+__outb(unsigned port, u_int8_t data)
+{
+	__asm volatile("outb %0,%w1" : : "a" (data), "d" (port));
+}
+
+static __inline void
+outsb(unsigned port, const void *addr, int cnt)
+{
+	void *dummy1;
+	int dummy2;
+	__asm volatile("cld\n\trep\n\toutsb"		:
+			 "=S" (dummy1), "=c" (dummy2)		:
+			 "d" (port), "0" (addr), "1" (cnt));
+}
+
+#define	outw(port, data) \
+    (/* CONSTCOND */ __use_immediate_port(port) ? __outwc(port, data) : \
+						__outw(port, data))
+
+static __inline void
+__outwc(unsigned port, u_int16_t data)
+{
+	__asm volatile("outw %0,%w1" : : "a" (data), "id" (port));
+}
+
+static __inline void
+__outw(unsigned port, u_int16_t data)
+{
+	__asm volatile("outw %0,%w1" : : "a" (data), "d" (port));
+}
+
+static __inline void
+outsw(unsigned port, const void *addr, int cnt)
+{
+	void *dummy1;
+	int dummy2;
+	__asm volatile("cld\n\trep\n\toutsw"		:
+			 "=S" (dummy1), "=c" (dummy2)		:
+			 "d" (port), "0" (addr), "1" (cnt));
+}
+
+#define	outl(port, data) \
+    (/* CONSTCOND */ __use_immediate_port(port) ? __outlc(port, data) : \
+						__outl(port, data))
+
+static __inline void
+__outlc(unsigned port, u_int32_t data)
+{
+	__asm volatile("outl %0,%w1" : : "a" (data), "id" (port));
+}
+
+static __inline void
+__outl(unsigned port, u_int32_t data)
+{
+	__asm volatile("outl %0,%w1" : : "a" (data), "d" (port));
+}
+
+static __inline void
+outsl(unsigned port, const void *addr, int cnt)
+{
+	void *dummy1;
+	int dummy2;
+	__asm volatile("cld\n\trep\n\toutsl"		:
+			 "=S" (dummy1), "=c" (dummy2)		:
+			 "d" (port), "0" (addr), "1" (cnt));
+}
+
+#endif /* _X86_PIO_H_ */