#include "seq_info.h"
#include "seq_system.h"
#include <sound/seq_device.h>
-#if defined(CONFIG_SND_BIT32_EMUL) || defined(CONFIG_SND_BIT32_EMUL_MODULE)
-#include "../ioctl32/ioctl32.h"
+#ifdef CONFIG_COMPAT
+#include <linux/compat.h>
#endif
/* Client Manager
#define SNDRV_SEQ_LFLG_OUTPUT 0x0002
#define SNDRV_SEQ_LFLG_OPEN (SNDRV_SEQ_LFLG_INPUT|SNDRV_SEQ_LFLG_OUTPUT)
-static spinlock_t clients_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(clients_lock);
static DECLARE_MUTEX(register_mutex);
/*
if (!(snd_seq_file_flags(file) & SNDRV_SEQ_LFLG_INPUT))
return -ENXIO;
- if (verify_area(VERIFY_WRITE, buf, count))
+ if (!access_ok(VERIFY_WRITE, buf, count))
return -EFAULT;
/* check client structures are in place */
}
count -= sizeof(snd_seq_event_t);
buf += sizeof(snd_seq_event_t);
- err = snd_seq_expand_var_event(&cell->event, count, buf, 0, sizeof(snd_seq_event_t));
+ err = snd_seq_expand_var_event(&cell->event, count, (char *)buf, 0, sizeof(snd_seq_event_t));
if (err < 0)
break;
result += err;
event.data.ext.ptr = (char*)buf + sizeof(snd_seq_event_t);
len += extlen; /* increment data length */
} else {
-#if defined(CONFIG_SND_BIT32_EMUL) || defined(CONFIG_SND_BIT32_EMUL_MODULE)
+#ifdef CONFIG_COMPAT
if (client->convert32 && snd_seq_ev_is_varusr(&event)) {
void *ptr = compat_ptr(event.data.raw32.d[1]);
event.data.ext.ptr = ptr;
}
-static int snd_seq_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, unsigned long arg)
+static long snd_seq_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
client_t *client = (client_t *) file->private_data;
- int err;
snd_assert(client != NULL, return -ENXIO);
- /* FIXME: need to unlock BKL to allow preemption */
- unlock_kernel();
- err = snd_seq_do_ioctl(client, cmd, (void __user *) arg);
- lock_kernel();
- return err;
+ return snd_seq_do_ioctl(client, cmd, (void __user *) arg);
}
+#ifdef CONFIG_COMPAT
+#include "seq_compat.c"
+#else
+#define snd_seq_ioctl_compat NULL
+#endif
/* -------------------------------------------------------- */
if (client == NULL)
return -ENXIO;
fs = snd_enter_user();
- result = snd_seq_do_ioctl(client, cmd, arg);
+ result = snd_seq_do_ioctl(client, cmd, (void __user *)arg);
snd_leave_user(fs);
return result;
}
.open = snd_seq_open,
.release = snd_seq_release,
.poll = snd_seq_poll,
- .ioctl = snd_seq_ioctl,
+ .unlocked_ioctl = snd_seq_ioctl,
+ .compat_ioctl = snd_seq_ioctl_compat,
};
static snd_minor_t snd_seq_reg =