patch-2.0.1 linux/drivers/sound/patmgr.c
Next file: linux/drivers/sound/pss.c
Previous file: linux/drivers/sound/pas2_pcm.c
Back to the patch index
Back to the overall index
- Lines: 220
- Date:
Sun Jun 30 11:44:10 1996
- Orig file:
v2.0.0/linux/drivers/sound/patmgr.c
- Orig date:
Fri Apr 12 15:52:03 1996
diff -u --recursive --new-file v2.0.0/linux/drivers/sound/patmgr.c linux/drivers/sound/patmgr.c
@@ -1,30 +1,14 @@
/*
* sound/patmgr.c
*
- * The patch manager interface for the /dev/sequencer
+ * The patch maneger interface for the /dev/sequencer
*/
/*
- * Copyright by Hannu Savolainen 1993-1996
+ * Copyright (C) by Hannu Savolainen 1993-1996
*
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
+ * USS/Lite for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
+ * Version 2 (June 1991). See the "COPYING" file distributed with this software
+ * for more info.
*/
#include <linux/config.h>
@@ -59,13 +43,13 @@
pmgr_open (int dev)
{
if (dev < 0 || dev >= num_synths)
- return -ENXIO;
+ return -(ENXIO);
if (pmgr_opened[dev])
- return -EBUSY;
+ return -(EBUSY);
pmgr_opened[dev] = 1;
- server_wait_flag[dev].mode = WK_NONE;
+ server_wait_flag[dev].flags = WK_NONE;
return 0;
}
@@ -80,11 +64,11 @@
{
mbox[dev]->key = PM_ERROR;
- mbox[dev]->parm1 = -EIO;
+ mbox[dev]->parm1 = -(EIO);
- if ((appl_wait_flag.mode & WK_SLEEP))
+ if ((appl_wait_flag.flags & WK_SLEEP))
{
- appl_wait_flag.mode = WK_WAKEUP;
+ appl_wait_flag.flags = WK_WAKEUP;
module_wake_up (&appl_proc);
};
}
@@ -101,7 +85,7 @@
if (count != sizeof (struct patmgr_info))
{
printk ("PATMGR%d: Invalid read count\n", dev);
- return -EIO;
+ return -(EIO);
}
while (!ok && !current_got_fatal_signal ())
@@ -113,14 +97,14 @@
!current_got_fatal_signal ())
{
- server_wait_flag[dev].mode = WK_SLEEP;
+ server_wait_flag[dev].flags = WK_SLEEP;
module_interruptible_sleep_on (&server_procs[dev]);
- server_wait_flag[dev].mode &= ~WK_SLEEP;;
+ server_wait_flag[dev].flags &= ~WK_SLEEP;;
}
if (mbox[dev] && msg_direction[dev] == A_TO_S)
{
- memcpy_tofs (&((buf)[0]), (char *) mbox[dev], count);
+ memcpy_tofs (&(buf)[0], (char *) mbox[dev], count);
msg_direction[dev] = 0;
ok = 1;
}
@@ -130,7 +114,7 @@
}
if (!ok)
- return -EINTR;
+ return -(EINTR);
return count;
}
@@ -142,10 +126,10 @@
if (count < 4)
{
printk ("PATMGR%d: Write count < 4\n", dev);
- return -EIO;
+ return -(EIO);
}
- memcpy_fromfs ((char *) mbox[dev], &((buf)[0]), 4);
+ memcpy_fromfs ((char *) mbox[dev], &(buf)[0], 4);
if (*(unsigned char *) mbox[dev] == SEQ_FULLSIZE)
{
@@ -153,7 +137,7 @@
tmp_dev = ((unsigned short *) mbox[dev])[2];
if (tmp_dev != dev)
- return -ENXIO;
+ return -(ENXIO);
return synth_devs[dev]->load_patch (dev, *(unsigned short *) mbox[dev],
buf, 4, count, 1);
@@ -162,7 +146,7 @@
if (count != sizeof (struct patmgr_info))
{
printk ("PATMGR%d: Invalid write count\n", dev);
- return -EIO;
+ return -(EIO);
}
/*
@@ -175,13 +159,13 @@
if (mbox[dev] && !msg_direction[dev])
{
- memcpy_fromfs (&((char *) mbox[dev])[4], &((buf)[4]), count - 4);
+ memcpy_fromfs (&((char *) mbox[dev])[4], &(buf)[4], count - 4);
msg_direction[dev] = S_TO_A;
- if ((appl_wait_flag.mode & WK_SLEEP))
+ if ((appl_wait_flag.flags & WK_SLEEP))
{
{
- appl_wait_flag.mode = WK_WAKEUP;
+ appl_wait_flag.flags = WK_WAKEUP;
module_wake_up (&appl_proc);
};
}
@@ -209,23 +193,23 @@
mbox[dev] = rec;
msg_direction[dev] = A_TO_S;
- if ((server_wait_flag[dev].mode & WK_SLEEP))
+ if ((server_wait_flag[dev].flags & WK_SLEEP))
{
{
- server_wait_flag[dev].mode = WK_WAKEUP;
+ server_wait_flag[dev].flags = WK_WAKEUP;
module_wake_up (&server_procs[dev]);
};
}
- appl_wait_flag.mode = WK_SLEEP;
+ appl_wait_flag.flags = WK_SLEEP;
module_interruptible_sleep_on (&appl_proc);
- appl_wait_flag.mode &= ~WK_SLEEP;;
+ appl_wait_flag.flags &= ~WK_SLEEP;;
if (msg_direction[dev] != S_TO_A)
{
rec->key = PM_ERROR;
- rec->parm1 = -EIO;
+ rec->parm1 = -(EIO);
}
else if (rec->key == PM_ERROR)
{
@@ -255,7 +239,7 @@
if (!pmgr_opened[dev])
return 0;
- tmp_mbox = (struct patmgr_info *) kmalloc (sizeof (struct patmgr_info), GFP_KERNEL);
+ tmp_mbox = (struct patmgr_info *) vmalloc (sizeof (struct patmgr_info));
if (tmp_mbox == NULL)
{
@@ -279,24 +263,24 @@
mbox[dev]->parm3 = p3;
msg_direction[dev] = A_TO_S;
- if ((server_wait_flag[dev].mode & WK_SLEEP))
+ if ((server_wait_flag[dev].flags & WK_SLEEP))
{
{
- server_wait_flag[dev].mode = WK_WAKEUP;
+ server_wait_flag[dev].flags = WK_WAKEUP;
module_wake_up (&server_procs[dev]);
};
}
- appl_wait_flag.mode = WK_SLEEP;
+ appl_wait_flag.flags = WK_SLEEP;
module_interruptible_sleep_on (&appl_proc);
- appl_wait_flag.mode &= ~WK_SLEEP;;
+ appl_wait_flag.flags &= ~WK_SLEEP;;
mbox[dev] = NULL;
msg_direction[dev] = 0;
}
restore_flags (flags);
- kfree (tmp_mbox);
+ vfree (tmp_mbox);
return err;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov