diff options
author | sos <sos@FreeBSD.org> | 1995-12-29 22:12:14 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 1995-12-29 22:12:14 +0000 |
commit | 58acdd095c1ac25ac70f9992f1aca1b76d8acc9c (patch) | |
tree | 98eafd0ac87cfc895d9a9d478a28cfd12b80c0ec /sys/compat | |
parent | d965394a53818da63fc18f7b2c157d0aecc7188a (diff) | |
download | FreeBSD-src-58acdd095c1ac25ac70f9992f1aca1b76d8acc9c.zip FreeBSD-src-58acdd095c1ac25ac70f9992f1aca1b76d8acc9c.tar.gz |
My first shot at get sound to work on the emulator.
Inspired by the work Amancio Hasty has done, but implemented
somewhat differently.
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/linux/linux_ioctl.c | 65 | ||||
-rw-r--r-- | sys/compat/linux/linux_ipc.c | 50 |
2 files changed, 108 insertions, 7 deletions
diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index ebdc850..6073071 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: linux_ioctl.c,v 1.2 1995/11/22 07:43:46 bde Exp $ + * $Id: linux_ioctl.c,v 1.3 1995/12/15 03:06:52 peter Exp $ */ #include <sys/param.h> @@ -40,6 +40,7 @@ #include <sys/termios.h> #include <machine/console.h> +#include <machine/soundcard.h> #include <i386/linux/linux.h> #include <i386/linux/sysproto.h> @@ -469,7 +470,6 @@ linux_ioctl(struct proc *p, struct linux_ioctl_args *args, int *retval) default: return EINVAL; } - break; case LINUX_TIOCGETD: bsd_line = TTYDISC; @@ -490,6 +490,67 @@ linux_ioctl(struct proc *p, struct linux_ioctl_args *args, int *retval) } return copyout(&linux_line, (caddr_t)args->arg, sizeof(int)); + + case LINUX_SNDCTL_DSP_RESET: + args->cmd = SNDCTL_DSP_RESET; + return ioctl(p, (struct ioctl_args *)args, retval); + + case LINUX_SNDCTL_DSP_SYNC: + args->cmd = SNDCTL_DSP_SYNC; + return ioctl(p, (struct ioctl_args *)args, retval); + + case LINUX_SNDCTL_DSP_SPEED: + args->cmd = SNDCTL_DSP_SPEED; + return ioctl(p, (struct ioctl_args *)args, retval); + + case LINUX_SNDCTL_DSP_STEREO: + args->cmd = SNDCTL_DSP_STEREO; + return ioctl(p, (struct ioctl_args *)args, retval); + + case LINUX_SNDCTL_DSP_GETBLKSIZE: + /* LINUX_SNDCTL_DSP_SETBLKSIZE */ + args->cmd = SNDCTL_DSP_GETBLKSIZE; + return ioctl(p, (struct ioctl_args *)args, retval); + + case LINUX_SNDCTL_DSP_SETFMT: + args->cmd = SNDCTL_DSP_SETFMT; + return ioctl(p, (struct ioctl_args *)args, retval); + + case LINUX_SOUND_PCM_WRITE_CHANNELS: + args->cmd = SOUND_PCM_WRITE_CHANNELS; + return ioctl(p, (struct ioctl_args *)args, retval); + + case LINUX_SOUND_PCM_WRITE_FILTER: + args->cmd = SOUND_PCM_WRITE_FILTER; + return ioctl(p, (struct ioctl_args *)args, retval); + + case LINUX_SNDCTL_DSP_POST: + args->cmd = SNDCTL_DSP_POST; + return ioctl(p, (struct ioctl_args *)args, retval); + + case LINUX_SNDCTL_DSP_SUBDIVIDE: + args->cmd = SNDCTL_DSP_SUBDIVIDE; + return ioctl(p, (struct ioctl_args *)args, retval); + + case LINUX_SNDCTL_DSP_SETFRAGMENT: + args->cmd = SNDCTL_DSP_SETFRAGMENT; + return ioctl(p, (struct ioctl_args *)args, retval); + + case LINUX_SNDCTL_DSP_GETFMTS: + args->cmd = SNDCTL_DSP_GETFMTS; + return ioctl(p, (struct ioctl_args *)args, retval); + + case LINUX_SNDCTL_DSP_GETOSPACE: + args->cmd = SNDCTL_DSP_GETOSPACE; + return ioctl(p, (struct ioctl_args *)args, retval); + + case LINUX_SNDCTL_DSP_GETISPACE: + args->cmd = SNDCTL_DSP_GETISPACE; + return ioctl(p, (struct ioctl_args *)args, retval); + + case LINUX_SNDCTL_DSP_NONBLOCK: + args->cmd = SNDCTL_DSP_NONBLOCK; + return ioctl(p, (struct ioctl_args *)args, retval); } uprintf("LINUX: 'ioctl' fd=%d, typ=0x%x(%c), num=0x%x not implemented\n", args->fd, (args->cmd&0xffff00)>>8, diff --git a/sys/compat/linux/linux_ipc.c b/sys/compat/linux/linux_ipc.c index 8327b20..4973c8d 100644 --- a/sys/compat/linux/linux_ipc.c +++ b/sys/compat/linux/linux_ipc.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: linux_ipc.c,v 1.2 1995/11/22 07:43:47 bde Exp $ + * $Id: linux_ipc.c,v 1.3 1995/12/15 05:07:20 peter Exp $ */ #include <sys/param.h> @@ -143,25 +143,65 @@ linux_semctl(struct proc *p, struct linux_ipc_args *args, int *retval) int linux_msgsnd(struct proc *p, struct linux_ipc_args *args, int *retval) { - return ENOSYS; + struct msgsnd_args /* { + int msqid; + void *msgp; + size_t msgsz; + int msgflg; + } */ bsd_args; + + bsd_args.msqid = args->arg1; + bsd_args.msgp = args->ptr; + bsd_args.msgsz = args->arg2; + bsd_args.msgflg = args->arg3; + return msgsnd(p, &bsd_args, retval); } int linux_msgrcv(struct proc *p, struct linux_ipc_args *args, int *retval) { - return ENOSYS; + struct msgrcv_args /* { + int msqid; + void *msgp; + size_t msgsz; + long msgtyp; + int msgflg; + } */ bsd_args; + + bsd_args.msqid = args->arg1; + bsd_args.msgp = args->ptr; + bsd_args.msgsz = args->arg2; + bsd_args.msgtyp = 0; + bsd_args.msgflg = args->arg3; + return msgrcv(p, &bsd_args, retval); } int linux_msgget(struct proc *p, struct linux_ipc_args *args, int *retval) { - return ENOSYS; + struct msgget_args /* { + key_t key; + int msgflg; + } */ bsd_args; + + bsd_args.key = args->arg1; + bsd_args.msgflg = args->arg2; + return msgget(p, &bsd_args, retval); } int linux_msgctl(struct proc *p, struct linux_ipc_args *args, int *retval) { - return ENOSYS; + struct msgctl_args /* { + int msqid; + int cmd; + struct msqid_ds *buf; + } */ bsd_args; + + bsd_args.msqid = args->arg1; + bsd_args.cmd = args->arg2; + bsd_args.buf = (struct msqid_ds *)args->ptr; + return msgctl(p, &bsd_args, retval); } int |