--- /dev/null
+/*
+ * Copyright (C) 2002 Steve Schmidtke
+ * Licensed under the GPL
+ */
+
+#include <sys/types.h>
+#include <unistd.h>
+#include <errno.h>
+#include "hostaudio.h"
+#include "user_util.h"
+#include "kern_util.h"
+#include "user.h"
+#include "os.h"
+
+/* /dev/dsp file operations */
+
+ssize_t hostaudio_read_user(struct hostaudio_state *state, char *buffer,
+ size_t count, loff_t *ppos)
+{
+#ifdef DEBUG
+ printk("hostaudio: read_user called, count = %d\n", count);
+#endif
+
+ return(os_read_file(state->fd, buffer, count));
+}
+
+ssize_t hostaudio_write_user(struct hostaudio_state *state, const char *buffer,
+ size_t count, loff_t *ppos)
+{
+#ifdef DEBUG
+ printk("hostaudio: write_user called, count = %d\n", count);
+#endif
+
+ return(os_write_file(state->fd, buffer, count));
+}
+
+int hostaudio_ioctl_user(struct hostaudio_state *state, unsigned int cmd,
+ unsigned long arg)
+{
+#ifdef DEBUG
+ printk("hostaudio: ioctl_user called, cmd = %u\n", cmd);
+#endif
+
+ return(os_ioctl_generic(state->fd, cmd, arg));
+}
+
+int hostaudio_open_user(struct hostaudio_state *state, int r, int w, char *dsp)
+{
+#ifdef DEBUG
+ printk("hostaudio: open_user called\n");
+#endif
+
+ state->fd = os_open_file(dsp, of_set_rw(OPENFLAGS(), r, w), 0);
+
+ if(state->fd < 0) {
+ printk("hostaudio_open_user failed to open '%s', err = %d\n",
+ dsp, -state->fd);
+ return(state->fd);
+ }
+
+ return(0);
+}
+
+int hostaudio_release_user(struct hostaudio_state *state)
+{
+#ifdef DEBUG
+ printk("hostaudio: release called\n");
+#endif
+ if(state->fd >= 0){
+ os_close_file(state->fd);
+ state->fd = -1;
+ }
+
+ return(0);
+}
+
+/* /dev/mixer file operations */
+
+int hostmixer_ioctl_mixdev_user(struct hostmixer_state *state,
+ unsigned int cmd, unsigned long arg)
+{
+#ifdef DEBUG
+ printk("hostmixer: ioctl_user called cmd = %u\n",cmd);
+#endif
+
+ return(os_ioctl_generic(state->fd, cmd, arg));
+}
+
+int hostmixer_open_mixdev_user(struct hostmixer_state *state, int r, int w,
+ char *mixer)
+{
+#ifdef DEBUG
+ printk("hostmixer: open_user called\n");
+#endif
+
+ state->fd = os_open_file(mixer, of_set_rw(OPENFLAGS(), r, w), 0);
+
+ if(state->fd < 0) {
+ printk("hostaudio_open_mixdev_user failed to open '%s', "
+ "err = %d\n", mixer, state->fd);
+ return(state->fd);
+ }
+
+ return(0);
+}
+
+int hostmixer_release_mixdev_user(struct hostmixer_state *state)
+{
+#ifdef DEBUG
+ printk("hostmixer: release_user called\n");
+#endif
+
+ if(state->fd >= 0){
+ os_close_file(state->fd);
+ state->fd = -1;
+ }
+
+ return 0;
+}
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only. This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-file-style: "linux"
+ * End:
+ */
extern syscall_handler_t old_select;
extern syscall_handler_t sys_modify_ldt;
extern syscall_handler_t sys_rt_sigsuspend;
+
extern syscall_handler_t sys_vserver;
syscall_handler_t *sys_call_table[] = {
[ __NR_times ] (syscall_handler_t *) sys_times,
[ __NR_prof ] (syscall_handler_t *) sys_ni_syscall,
[ __NR_brk ] (syscall_handler_t *) sys_brk,
- [ __NR_setgid ] (syscall_handler_t *) sys_setgid1
+ [ __NR_setgid ] (syscall_handler_t *) sys_setgid16,
+ [ __NR_getgid ] (syscall_handler_t *) sys_getgid16,
+ [ __NR_signal ] (syscall_handler_t *) sys_signal,
+ [ __NR_geteuid ] (syscall_handler_t *) sys_geteuid16,
+ [ __NR_getegid ] (syscall_handler_t *) sys_getegid16,
+ [ __NR_acct ] (syscall_handler_t *) sys_acct,
+ [ __NR_umount2 ] (syscall_handler_t *) sys_umount,
+ [ __NR_lock ] (syscall_handler_t *) sys_ni_syscall,
+ [ __NR_ioctl ] (syscall_handler_t *) sys_ioctl,
+ [ __NR_fcntl ] (syscall_handler_t *) sys_fcntl,
+ [ __NR_mpx ] (syscall_handler_t *) sys_ni_syscall,
+ [ __NR_setpgid ] (syscall_handler_t *) sys_setpgid,
+ [ __NR_ulimit ] (syscall_handler_t *) sys_ni_syscall,
+ [ __NR_oldolduname ] (syscall_handler_t *) sys_olduname,
+ [ __NR_umask ] (syscall_handler_t *) sys_umask,
+ [ __NR_chroot ] (syscall_handler_t *) sys_chroot,
+ [ __NR_ustat ] (syscall_handler_t *) sys_ustat,
+ [ __NR_dup2 ] (syscall_handler_t *) sys_dup2,
+ [ __NR_getppid ] (syscall_handler_t *) sys_getppid,
+ [ __NR_getpgrp ] (syscall_handler_t *) sys_getpgrp,
+ [ __NR_setsid ] = (syscall_handler_t *) sys_setsid,
+ [ __NR_sigaction ] (syscall_handler_t *) sys_sigaction,
+ [ __NR_sgetmask ] (syscall_handler_t *) sys_sgetmask,
+ [ __NR_ssetmask ] (syscall_handler_t *) sys_ssetmask,
+ [ __NR_setreuid ] (syscall_handler_t *) sys_setreuid16,
+ [ __NR_setregid ] (syscall_handler_t *) sys_setregid16,
+ [ __NR_sigsuspend ] (syscall_handler_t *) sys_sigsuspend,
+ [ __NR_sigpending ] (syscall_handler_t *) sys_sigpending,
+ [ __NR_sethostname ] (syscall_handler_t *) sys_sethostname,
+ [ __NR_setrlimit ] (syscall_handler_t *) sys_setrlimit,
+ [ __NR_getrlimit ] (syscall_handler_t *) sys_old_getrlimit,
+ [ __NR_getrusage ] (syscall_handler_t *) sys_getrusage,
+ [ __NR_gettimeofday ] (syscall_handler_t *) sys_gettimeofday,
+ [ __NR_settimeofday ] (syscall_handler_t *) sys_settimeofday,
+ [ __NR_getgroups ] (syscall_handler_t *) sys_getgroups16,
+ [ __NR_setgroups ] (syscall_handler_t *) sys_setgroups16,
+ [ __NR_symlink ] (syscall_handler_t *) sys_symlink,
+ [ __NR_oldlstat ] (syscall_handler_t *) sys_lstat,
+ [ __NR_readlink ] (syscall_handler_t *) sys_readlink,
+ [ __NR_uselib ] (syscall_handler_t *) sys_uselib,
+ [ __NR_swapon ] = (syscall_handler_t *) sys_swapon,
+ [ __NR_reboot ] (syscall_handler_t *) sys_reboot,
+ [ __NR_readdir ] = old_readdir,
+ [ __NR_munmap ] (syscall_handler_t *) sys_munmap,
+ [ __NR_truncate ] (syscall_handler_t *) sys_truncate,
+ [ __NR_ftruncate ] (syscall_handler_t *) sys_ftruncate,
+ [ __NR_fchmod ] (syscall_handler_t *) sys_fchmod,
+ [ __NR_fchown ] (syscall_handler_t *) sys_fchown16,
+ [ __NR_getpriority ] (syscall_handler_t *) sys_getpriority,
+ [ __NR_setpriority ] (syscall_handler_t *) sys_setpriority,
+ [ __NR_profil ] (syscall_handler_t *) sys_ni_syscall,
+ [ __NR_statfs ] (syscall_handler_t *) sys_statfs,
+ [ __NR_fstatfs ] (syscall_handler_t *) sys_fstatfs,
+ [ __NR_ioperm ] (syscall_handler_t *) sys_ni_syscall,
+ [ __NR_socketcall ] (syscall_handler_t *) sys_socketcall,
+ [ __NR_syslog ] (syscall_handler_t *) sys_syslog,
+ [ __NR_setitimer ] (syscall_handler_t *) sys_setitimer,
+ [ __NR_getitimer ] (syscall_handler_t *) sys_getitimer,
+ [ __NR_stat ] (syscall_handler_t *) sys_newstat,
+ [ __NR_lstat ] (syscall_handler_t *) sys_newlstat,
+ [ __NR_fstat ] (syscall_handler_t *) sys_newfstat,
+ [ __NR_olduname ] (syscall_handler_t *) sys_uname,
+ [ __NR_iopl ] (syscall_handler_t *) sys_ni_syscall,
+ [ __NR_vhangup ] (syscall_handler_t *) sys_vhangup,
+ [ __NR_idle ] (syscall_handler_t *) sys_ni_syscall,
+ [ __NR_wait4 ] = (syscall_handler_t *) sys_wait4,
+ [ __NR_swapoff ] = (syscall_handler_t *) sys_swapoff,
+ [ __NR_sysinfo ] (syscall_handler_t *) sys_sysinfo,
+ [ __NR_ipc ] (syscall_handler_t *) sys_ipc,
+ [ __NR_fsync ] (syscall_handler_t *) sys_fsync,
+ [ __NR_sigreturn ] (syscall_handler_t *) sys_sigreturn,
+ [ __NR_clone ] (syscall_handler_t *) sys_clone,
+ [ __NR_setdomainname ] (syscall_handler_t *) sys_setdomainname,
+ [ __NR_uname ] (syscall_handler_t *) sys_newuname,
+ [ __NR_adjtimex ] (syscall_handler_t *) sys_adjtimex,
+ [ __NR_mprotect ] (syscall_handler_t *) sys_mprotect,
+ [ __NR_sigprocmask ] (syscall_handler_t *) sys_sigprocmask,
+ [ __NR_create_module ] (syscall_handler_t *) sys_ni_syscall,
+ [ __NR_init_module ] (syscall_handler_t *) sys_init_module,
+ [ __NR_delete_module ] (syscall_handler_t *) sys_delete_module,
+ [ __NR_get_kernel_syms ] (syscall_handler_t *) sys_ni_syscall,
+ [ __NR_quotactl ] (syscall_handler_t *) sys_quotactl,
+ [ __NR_getpgid ] (syscall_handler_t *) sys_getpgid,
+ [ __NR_fchdir ] (syscall_handler_t *) sys_fchdir,
+ [ __NR_bdflush ] (syscall_handler_t *) sys_bdflush,
+ [ __NR_sysfs ] (syscall_handler_t *) sys_sysfs,
+ [ __NR_personality ] (syscall_handler_t *) sys_personality,
+ [ __NR_afs_syscall ] (syscall_handler_t *) sys_ni_syscall,
+ [ __NR_setfsuid ] (syscall_handler_t *) sys_setfsuid16,
+ [ __NR_setfsgid ] (syscall_handler_t *) sys_setfsgid16,
+ [ __NR__llseek ] (syscall_handler_t *) sys_llseek,
+ [ __NR_getdents ] (syscall_handler_t *) sys_getdents,
+ [ __NR__newselect ] = (syscall_handler_t *) sys_select,
+ [ __NR_flock ] (syscall_handler_t *) sys_flock,
+ [ __NR_msync ] (syscall_handler_t *) sys_msync,
+ [ __NR_readv ] (syscall_handler_t *) sys_readv,
+ [ __NR_writev ] (syscall_handler_t *) sys_writev,
+ [ __NR_getsid ] (syscall_handler_t *) sys_getsid,
+ [ __NR_fdatasync ] (syscall_handler_t *) sys_fdatasync,
+ [ __NR__sysctl ] = (syscall_handler_t *) sys_sysctl,
+ [ __NR_mlock ] (syscall_handler_t *) sys_mlock,
+ [ __NR_munlock ] (syscall_handler_t *) sys_munlock,
+ [ __NR_mlockall ] (syscall_handler_t *) sys_mlockall,
+ [ __NR_munlockall ] (syscall_handler_t *) sys_munlockall,
+ [ __NR_sched_setparam ] (syscall_handler_t *) sys_sched_setparam,
+ [ __NR_sched_getparam ] (syscall_handler_t *) sys_sched_getparam,
+ [ __NR_sched_setscheduler ] (syscall_handler_t *) sys_sched_setscheduler,
+ [ __NR_sched_getscheduler ] (syscall_handler_t *) sys_sched_getscheduler,
+ [ __NR_sched_yield ] = (syscall_handler_t *) yield,
+ [ __NR_sched_get_priority_max ] (syscall_handler_t *) sys_sched_get_priority_max,
+ [ __NR_sched_get_priority_min ] (syscall_handler_t *) sys_sched_get_priority_min,
+ [ __NR_sched_rr_get_interval ] (syscall_handler_t *) sys_sched_rr_get_interval,
+ [ __NR_nanosleep ] (syscall_handler_t *) sys_nanosleep,
+ [ __NR_mremap ] (syscall_handler_t *) sys_mremap,
+ [ __NR_setresuid ] (syscall_handler_t *) sys_setresuid16,
+ [ __NR_getresuid ] (syscall_handler_t *) sys_getresuid16,
+ [ __NR_vm86 ] (syscall_handler_t *) sys_ni_syscall,
+ [ __NR_query_module ] (syscall_handler_t *) sys_ni_syscall,
+ [ __NR_poll ] (syscall_handler_t *) sys_poll,
+ [ __NR_nfsservctl ] = (syscall_handler_t *) NFSSERVCTL,
+ [ __NR_setresgid ] (syscall_handler_t *) sys_setresgid16,
+ [ __NR_getresgid ] (syscall_handler_t *) sys_getresgid16,
+ [ __NR_prctl ] (syscall_handler_t *) sys_prctl,
+ [ __NR_rt_sigreturn ] (syscall_handler_t *) sys_rt_sigreturn,
+ [ __NR_rt_sigaction ] (syscall_handler_t *) sys_rt_sigaction,
+ [ __NR_rt_sigprocmask ] (syscall_handler_t *) sys_rt_sigprocmask,
+ [ __NR_rt_sigpending ] (syscall_handler_t *) sys_rt_sigpending,
+ [ __NR_rt_sigtimedwait ] (syscall_handler_t *) sys_rt_sigtimedwait,
+ [ __NR_rt_sigqueueinfo ] (syscall_handler_t *) sys_rt_sigqueueinfo,
+ [ __NR_rt_sigsuspend ] (syscall_handler_t *) sys_rt_sigsuspend,
+ [ __NR_pread64 ] (syscall_handler_t *) sys_pread64,
+ [ __NR_pwrite64 ] (syscall_handler_t *) sys_pwrite64,
+ [ __NR_chown ] (syscall_handler_t *) sys_chown16,
+ [ __NR_getcwd ] (syscall_handler_t *) sys_getcwd,
+ [ __NR_capget ] (syscall_handler_t *) sys_capget,
+ [ __NR_capset ] (syscall_handler_t *) sys_capset,
+ [ __NR_sigaltstack ] (syscall_handler_t *) sys_sigaltstack,
+ [ __NR_sendfile ] (syscall_handler_t *) sys_sendfile,
+ [ __NR_getpmsg ] (syscall_handler_t *) sys_ni_syscall,
+ [ __NR_putpmsg ] (syscall_handler_t *) sys_ni_syscall,
+ [ __NR_vfork ] (syscall_handler_t *) sys_vfork,
+ [ __NR_ugetrlimit ] (syscall_handler_t *) sys_getrlimit,
+ [ __NR_mmap2 ] (syscall_handler_t *) sys_mmap2,
+ [ __NR_truncate64 ] (syscall_handler_t *) sys_truncate64,
+ [ __NR_ftruncate64 ] (syscall_handler_t *) sys_ftruncate64,
+ [ __NR_stat64 ] (syscall_handler_t *) sys_stat64,
+ [ __NR_lstat64 ] (syscall_handler_t *) sys_lstat64,
+ [ __NR_fstat64 ] (syscall_handler_t *) sys_fstat64,
[ __NR_getdents64 ] (syscall_handler_t *) sys_getdents64,
[ __NR_fcntl64 ] (syscall_handler_t *) sys_fcntl64,
[ 223 ] (syscall_handler_t *) sys_ni_syscall,