X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Fisa%2Fsb%2Femu8000_patch.c;h=1be16c9700f09cd254117f3a0de9b014997de6f6;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=432c31e841630830201f4da33af9df58abd59b56;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/sound/isa/sb/emu8000_patch.c b/sound/isa/sb/emu8000_patch.c index 432c31e84..1be16c970 100644 --- a/sound/isa/sb/emu8000_patch.c +++ b/sound/isa/sb/emu8000_patch.c @@ -21,18 +21,18 @@ #include "emu8000_local.h" #include +#include -MODULE_PARM(emu8000_reset_addr, "i"); +static int emu8000_reset_addr; +module_param(emu8000_reset_addr, int, 0444); MODULE_PARM_DESC(emu8000_reset_addr, "reset write address at each time (makes slowdown)"); -int emu8000_reset_addr = 0; - /* * Open up channels. */ static int -snd_emu8000_open_dma(emu8000_t *emu, int write) +snd_emu8000_open_dma(struct snd_emu8000 *emu, int write) { int i; @@ -59,7 +59,7 @@ snd_emu8000_open_dma(emu8000_t *emu, int write) * Close all dram channels. */ static void -snd_emu8000_close_dma(emu8000_t *emu) +snd_emu8000_close_dma(struct snd_emu8000 *emu) { int i; @@ -87,14 +87,14 @@ read_word(const void __user *buf, int offset, int mode) unsigned short c; if (mode & SNDRV_SFNT_SAMPLE_8BITS) { unsigned char cc; - get_user(cc, (unsigned char*)buf + offset); + get_user(cc, (unsigned char __user *)buf + offset); c = cc << 8; /* convert 8bit -> 16bit */ } else { #ifdef SNDRV_LITTLE_ENDIAN - get_user(c, (unsigned short*)buf + offset); + get_user(c, (unsigned short __user *)buf + offset); #else unsigned short cc; - get_user(cc, (unsigned short*)buf + offset); + get_user(cc, (unsigned short __user *)buf + offset); c = swab16(cc); #endif } @@ -106,11 +106,10 @@ read_word(const void __user *buf, int offset, int mode) /* */ static void -snd_emu8000_write_wait(emu8000_t *emu) +snd_emu8000_write_wait(struct snd_emu8000 *emu) { while ((EMU8000_SMALW_READ(emu) & 0x80000000) != 0) { - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(1); + schedule_timeout_interruptible(1); if (signal_pending(current)) break; } @@ -128,8 +127,8 @@ snd_emu8000_write_wait(emu8000_t *emu) * This is therefore much slower than need be, but is at least * working. */ -inline static void -write_word(emu8000_t *emu, int *offset, unsigned short data) +static inline void +write_word(struct snd_emu8000 *emu, int *offset, unsigned short data) { if (emu8000_reset_addr) { if (emu8000_reset_addr > 1) @@ -145,17 +144,18 @@ write_word(emu8000_t *emu, int *offset, unsigned short data) * the generic soundfont routines as a callback. */ int -snd_emu8000_sample_new(snd_emux_t *rec, snd_sf_sample_t *sp, - snd_util_memhdr_t *hdr, const void __user *data, long count) +snd_emu8000_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp, + struct snd_util_memhdr *hdr, + const void __user *data, long count) { int i; int rc; int offset; int truesize; int dram_offset, dram_start; - emu8000_t *emu; + struct snd_emu8000 *emu; - emu = snd_magic_cast(emu8000_t, rec->hw, return -EINVAL); + emu = rec->hw; snd_assert(sp != NULL, return -EINVAL); if (sp->v.size == 0) @@ -183,10 +183,10 @@ snd_emu8000_sample_new(snd_emux_t *rec, snd_sf_sample_t *sp, } if (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS) { - if (verify_area(VERIFY_READ, data, sp->v.size)) + if (!access_ok(VERIFY_READ, data, sp->v.size)) return -EFAULT; } else { - if (verify_area(VERIFY_READ, data, sp->v.size * 2)) + if (!access_ok(VERIFY_READ, data, sp->v.size * 2)) return -EFAULT; } @@ -283,7 +283,8 @@ snd_emu8000_sample_new(snd_emux_t *rec, snd_sf_sample_t *sp, * free a sample block */ int -snd_emu8000_sample_free(snd_emux_t *rec, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr) +snd_emu8000_sample_free(struct snd_emux *rec, struct snd_sf_sample *sp, + struct snd_util_memhdr *hdr) { if (sp->block) { snd_util_mem_free(hdr, sp->block); @@ -297,7 +298,7 @@ snd_emu8000_sample_free(snd_emux_t *rec, snd_sf_sample_t *sp, snd_util_memhdr_t * sample_reset callback - terminate voices */ void -snd_emu8000_sample_reset(snd_emux_t *rec) +snd_emu8000_sample_reset(struct snd_emux *rec) { snd_emux_terminate_all(rec); }