diff options
author | jmg <jmg@FreeBSD.org> | 1998-01-08 23:13:22 +0000 |
---|---|---|
committer | jmg <jmg@FreeBSD.org> | 1998-01-08 23:13:22 +0000 |
commit | 48cccef792222ce3b835ce491221e75d45d4a2d9 (patch) | |
tree | f9ee63bf2c32dd84f2723f0ea507efacf83f5ae1 /sys/gnu | |
parent | ac5240c506c9b57b55faa70a4ae4411a4fce5c79 (diff) | |
download | FreeBSD-src-48cccef792222ce3b835ce491221e75d45d4a2d9.zip FreeBSD-src-48cccef792222ce3b835ce491221e75d45d4a2d9.tar.gz |
update the AWE32 wave table driver to Iwai's 0.4.2c version. This also
includes the patches to make it work under -current from Randall Hopper.
Remove the old AWE driver.
Diffstat (limited to 'sys/gnu')
-rw-r--r-- | sys/gnu/i386/isa/sound/awe_compat.h | 28 | ||||
-rw-r--r-- | sys/gnu/i386/isa/sound/awe_config.h | 18 | ||||
-rw-r--r-- | sys/gnu/i386/isa/sound/awe_version.h | 23 | ||||
-rw-r--r-- | sys/gnu/i386/isa/sound/awe_wave.c | 55 |
4 files changed, 100 insertions, 24 deletions
diff --git a/sys/gnu/i386/isa/sound/awe_compat.h b/sys/gnu/i386/isa/sound/awe_compat.h index d0c34a1..c2b0ee5 100644 --- a/sys/gnu/i386/isa/sound/awe_compat.h +++ b/sys/gnu/i386/isa/sound/awe_compat.h @@ -1,3 +1,26 @@ +/* + * sound/awe_compat.h + * + * Compat defines for the AWE32/Sound Blaster 32 wave table synth. driver + * version 0.4.2c; Oct. 7, 1997 + * + * Copyright (C) 1996,1997 Takashi Iwai + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + /*---------------------------------------------------------------- * compatibility macros for AWE32 driver *----------------------------------------------------------------*/ @@ -186,5 +209,10 @@ static void *my_realloc(void *buf, int oldsize, int size) #define BZERO(target,len) bzero((caddr_t)target, len) #define MEMCPY(dst,src,len) bcopy((caddr_t)src, (caddr_t)dst, len) +#ifndef AWE_OBSOLETE_VOXWARE +# define printk printf +# define RET_ERROR(err) -err +#endif + #endif diff --git a/sys/gnu/i386/isa/sound/awe_config.h b/sys/gnu/i386/isa/sound/awe_config.h index 48dc8f8..70efaac 100644 --- a/sys/gnu/i386/isa/sound/awe_config.h +++ b/sys/gnu/i386/isa/sound/awe_config.h @@ -28,15 +28,11 @@ * system configuration *----------------------------------------------------------------*/ -/* if you're using obsolete VoxWare 3.0.x on Linux 1.2.x (or FreeBSD), - * define the following line. +/* if you're using obsolete VoxWare 3.0.x on Linux 1.2.x (or pre-Voxware 3.5 + * versions of FreeBSD), define the following line. */ #undef AWE_OBSOLETE_VOXWARE -#ifdef __FreeBSD__ -# define AWE_OBSOLETE_VOXWARE -#endif - /* if you're using OSS-Lite on Linux 2.1.6 or later, define the * following line. */ @@ -137,7 +133,15 @@ #include "lowlevel.h" #endif -#include "../sound_config.h" +#ifdef __FreeBSD__ +# include <i386/isa/sound/sound_config.h> +# if defined(CONFIGURE_SOUNDCARD) && defined(CONFIG_AWE32) +# define CONFIG_AWE32_SYNTH +# endif +#else +# include "../sound_config.h" +#endif + #endif /* AWE_OBSOLETE_VOXWARE */ diff --git a/sys/gnu/i386/isa/sound/awe_version.h b/sys/gnu/i386/isa/sound/awe_version.h index 40d10df..42013bb 100644 --- a/sys/gnu/i386/isa/sound/awe_version.h +++ b/sys/gnu/i386/isa/sound/awe_version.h @@ -1,3 +1,26 @@ +/* + * sound/awe_version.h + * + * Version defines for the AWE32/Sound Blaster 32 wave table synth driver. + * version 0.4.2c; Oct. 7, 1997 + * + * Copyright (C) 1996,1997 Takashi Iwai + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + /* AWE32 driver version number */ #ifndef AWE_VERSION_H_DEF diff --git a/sys/gnu/i386/isa/sound/awe_wave.c b/sys/gnu/i386/isa/sound/awe_wave.c index 7480311..1f3269e 100644 --- a/sys/gnu/i386/isa/sound/awe_wave.c +++ b/sys/gnu/i386/isa/sound/awe_wave.c @@ -22,7 +22,7 @@ */ #ifdef __FreeBSD__ -# include <i386/isa/sound/awe_config.h> +# include <gnu/i386/isa/sound/awe_config.h> #else # include "awe_config.h" #endif @@ -32,9 +32,9 @@ #ifdef CONFIG_AWE32_SYNTH #ifdef __FreeBSD__ -# include <i386/isa/sound/awe_hw.h> -# include <i386/isa/sound/awe_version.h> -# include <i386/isa/sound/awe_voice.h> +# include <gnu/i386/isa/sound/awe_hw.h> +# include <gnu/i386/isa/sound/awe_version.h> +# include <gnu/i386/isa/sound/awe_voice.h> #else # include "awe_hw.h" # include "awe_version.h" @@ -43,15 +43,18 @@ #ifdef AWE_HAS_GUS_COMPATIBILITY /* include finetune table */ -#ifdef AWE_OBSOLETE_VOXWARE -# ifdef __FreeBSD__ + +#ifdef __FreeBSD__ +# ifdef AWE_OBSOLETE_VOXWARE # define SEQUENCER_C -# include <i386/isa/sound/tuning.h> -# else -# include "tuning.h" # endif +# include <i386/isa/sound/tuning.h> #else -# include "../tuning.h" +# ifdef AWE_OBSOLETE_VOXWARE +# include "tuning.h" +# else +# include "../tuning.h" +# endif #endif #ifdef linux @@ -299,7 +302,7 @@ static struct voice_alloc_info *voice_alloc; /* set at initialization */ * function prototypes *----------------------------------------------------------------*/ -#ifndef AWE_OBSOLETE_VOXWARE +#if defined(linux) && !defined(AWE_OBSOLETE_VOXWARE) static int awe_check_port(void); static void awe_request_region(void); static void awe_release_region(void); @@ -444,7 +447,7 @@ static int awe_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg); /* define macros for compatibility */ #ifdef __FreeBSD__ -# include <i386/isa/sound/awe_compat.h> +# include <gnu/i386/isa/sound/awe_compat.h> #else # include "awe_compat.h" #endif @@ -504,19 +507,27 @@ static struct mixer_operations awe_mixer_operations = { #define ATTACH_DECL /**/ #endif +#if defined(__FreeBSD__) && !defined(AWE_OBSOLETE_VOXWARE) +# define ATTACH_RET +void attach_awe(struct address_info *hw_config) +#else +# define ATTACH_RET ret ATTACH_DECL int attach_awe(void) +#endif { + int ret = 0; + /* check presence of AWE32 card */ if (! awe_detect()) { printk("AWE32: not detected\n"); - return 0; + return ATTACH_RET; } /* check AWE32 ports are available */ if (awe_check_port()) { printk("AWE32: I/O area already used.\n"); - return 0; + return ATTACH_RET; } /* set buffers to NULL */ @@ -534,7 +545,7 @@ int attach_awe(void) my_free(voices); my_free(channels); printk("AWE32: can't allocate sample tables\n"); - return 0; + return ATTACH_RET; } /* allocate sample tables */ @@ -582,7 +593,8 @@ int attach_awe(void) awe_present = TRUE; - return 1; + ret = 1; + return ATTACH_RET; } @@ -601,6 +613,7 @@ static void free_tables(void) #endif +#ifdef linux ATTACH_DECL void unload_awe(void) { @@ -613,6 +626,7 @@ void unload_awe(void) awe_present = FALSE; } } +#endif /*---------------------------------------------------------------- @@ -639,7 +653,14 @@ int probe_awe_obsolete(struct address_info *hw_config) /*return awe_detect();*/ } +#else +#if defined(__FreeBSD__ ) +int probe_awe(struct address_info *hw_config) +{ + return 1; +} #endif +#endif /* AWE_OBSOLETE_VOXWARE */ /*================================================================ @@ -743,7 +764,7 @@ awe_write_dram(unsigned short c) } -#ifndef AWE_OBSOLETE_VOXWARE +#if defined(linux) && !defined(AWE_OBSOLETE_VOXWARE) /*================================================================ * port check / request |