summaryrefslogtreecommitdiff
path: root/audio/cs4235
diff options
context:
space:
mode:
authordholland <dholland@pkgsrc.org>2008-08-02 16:46:56 +0000
committerdholland <dholland@pkgsrc.org>2008-08-02 16:46:56 +0000
commita18f1fefa1c190738cb633a7a12c77f94e7359d1 (patch)
treea5b0fc8dd4fa2d149de3f8c88fd345f0d4e21ad2 /audio/cs4235
parentfec7b943884311fe42f7616e5320eb6e55ec4d94 (diff)
downloadpkgsrc-a18f1fefa1c190738cb633a7a12c77f94e7359d1.tar.gz
Fix broken build on -current. While here, make it build on amd64 too.
(Patches have been sent upstream.) PKGREVISION++.
Diffstat (limited to 'audio/cs4235')
-rw-r--r--audio/cs4235/Makefile5
-rw-r--r--audio/cs4235/distinfo8
-rw-r--r--audio/cs4235/patches/patch-aa14
-rw-r--r--audio/cs4235/patches/patch-ab38
-rw-r--r--audio/cs4235/patches/patch-ac14
-rw-r--r--audio/cs4235/patches/patch-ad16
-rw-r--r--audio/cs4235/patches/patch-ae13
-rw-r--r--audio/cs4235/patches/patch-af237
8 files changed, 342 insertions, 3 deletions
diff --git a/audio/cs4235/Makefile b/audio/cs4235/Makefile
index 0de6db7fe55..8bb92326403 100644
--- a/audio/cs4235/Makefile
+++ b/audio/cs4235/Makefile
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.10 2006/11/05 14:47:55 rillig Exp $
+# $NetBSD: Makefile,v 1.11 2008/08/02 16:46:56 dholland Exp $
#
DISTNAME= cs4235-20001009
+PKGREVISION= 1
CATEGORIES= audio sysutils
MASTER_SITES= http://www.invisible.ca/~jmcneill/
@@ -9,7 +10,7 @@ MAINTAINER= jmcneill@NetBSD.org
HOMEPAGE= http://www.invisible.ca/~jmcneill/
COMMENT= Modifies the 3D mode on Crystal CS4235 sound cards
-ONLY_FOR_PLATFORM= NetBSD-*-i386
+ONLY_FOR_PLATFORM= NetBSD-*-i386 NetBSD-*-x86_64
WRKSRC= ${WRKDIR}/cs4235
MAKE_ENV+= ${BSD_MAKE_ENV}
diff --git a/audio/cs4235/distinfo b/audio/cs4235/distinfo
index 566edeb2ef3..3b473d449d6 100644
--- a/audio/cs4235/distinfo
+++ b/audio/cs4235/distinfo
@@ -1,5 +1,11 @@
-$NetBSD: distinfo,v 1.3 2005/02/23 20:39:43 agc Exp $
+$NetBSD: distinfo,v 1.4 2008/08/02 16:46:56 dholland Exp $
SHA1 (cs4235-20001009.tar.gz) = 599d28d94dc72ccccb0d9478f5e0383bcbff2bd8
RMD160 (cs4235-20001009.tar.gz) = f1768596e9dee389d9435f8ce72fc61ba2f36dfa
Size (cs4235-20001009.tar.gz) = 1967 bytes
+SHA1 (patch-aa) = 428bbba16bd1fe32f96ec9cbb0062ac053693f49
+SHA1 (patch-ab) = 10f85ffd04057ae9612134940590053a5764e151
+SHA1 (patch-ac) = ed060c5977d645dca15ed712d339f019672f008c
+SHA1 (patch-ad) = 6ffe4c9afb240f125d3bd815049641961cfb3f38
+SHA1 (patch-ae) = 9f8ab76babd508b3399c6862af74f49d447ffe98
+SHA1 (patch-af) = 8bac18e90fb8ae57bf6fd1cf8edded10c1c909ef
diff --git a/audio/cs4235/patches/patch-aa b/audio/cs4235/patches/patch-aa
new file mode 100644
index 00000000000..ab2d38283f4
--- /dev/null
+++ b/audio/cs4235/patches/patch-aa
@@ -0,0 +1,14 @@
+$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
+
diff --git a/audio/cs4235/patches/patch-ab b/audio/cs4235/patches/patch-ab
new file mode 100644
index 00000000000..456e0819908
--- /dev/null
+++ b/audio/cs4235/patches/patch-ab
@@ -0,0 +1,38 @@
+$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);
diff --git a/audio/cs4235/patches/patch-ac b/audio/cs4235/patches/patch-ac
new file mode 100644
index 00000000000..417e4db7cb0
--- /dev/null
+++ b/audio/cs4235/patches/patch-ac
@@ -0,0 +1,14 @@
+$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"
diff --git a/audio/cs4235/patches/patch-ad b/audio/cs4235/patches/patch-ad
new file mode 100644
index 00000000000..fe83a292a1e
--- /dev/null
+++ b/audio/cs4235/patches/patch-ad
@@ -0,0 +1,16 @@
+$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_ */
diff --git a/audio/cs4235/patches/patch-ae b/audio/cs4235/patches/patch-ae
new file mode 100644
index 00000000000..3eb656e7812
--- /dev/null
+++ b/audio/cs4235/patches/patch-ae
@@ -0,0 +1,13 @@
+$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
diff --git a/audio/cs4235/patches/patch-af b/audio/cs4235/patches/patch-af
new file mode 100644
index 00000000000..801c9f39ec4
--- /dev/null
+++ b/audio/cs4235/patches/patch-af
@@ -0,0 +1,237 @@
+$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_ */