diff options
author | markm <markm@FreeBSD.org> | 1997-11-10 18:31:35 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 1997-11-10 18:31:35 +0000 |
commit | 1a385f5cdc52ad58db6d17799aab3177e988a213 (patch) | |
tree | c7efd2f94120b495b46cf4aca21ce4473dea7ae5 /sys/i386/isa/sound/midibuf.c | |
parent | 53af1df4e61b5911f54909c98c2542da81e8479e (diff) | |
download | FreeBSD-src-1a385f5cdc52ad58db6d17799aab3177e988a213.zip FreeBSD-src-1a385f5cdc52ad58db6d17799aab3177e988a213.tar.gz |
Fix conflicts.
Diffstat (limited to 'sys/i386/isa/sound/midibuf.c')
-rw-r--r-- | sys/i386/isa/sound/midibuf.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/sys/i386/isa/sound/midibuf.c b/sys/i386/isa/sound/midibuf.c index faddba9..e452e0a 100644 --- a/sys/i386/isa/sound/midibuf.c +++ b/sys/i386/isa/sound/midibuf.c @@ -37,6 +37,11 @@ */ #define MAX_QUEUE_SIZE 4000 +int +MIDIbuf_poll (int dev, struct fileinfo *file, int events, select_table * wait); + +void +drain_midi_queue(int dev); static int *midi_sleeper[MAX_MIDI_DEV] = {NULL}; static volatile struct snd_wait midi_sleep_flag[MAX_MIDI_DEV] = { {0}}; @@ -393,4 +398,32 @@ MIDIbuf_ioctl(int dev, struct fileinfo * file, u_int cmd, ioctl_arg arg) return midi_devs[dev]->ioctl(dev, cmd, arg); } } + +#ifdef ALLOW_POLL +int +MIDIbuf_poll (int dev, struct fileinfo *file, int events, select_table * wait) +{ + int revents = 0; + + dev = dev >> 4; + + if (events & (POLLIN | POLLRDNORM)) + if (!DATA_AVAIL (midi_in_buf[dev])) + selrecord(wait, &selinfo[dev]); + else + revents |= events & (POLLIN | POLLRDNORM); + + if (events & (POLLOUT | POLLWRNORM)) + if (SPACE_AVAIL (midi_out_buf[dev])) + selrecord(wait, &selinfo[dev]); + else + revents |= events & (POLLOUT | POLLWRNORM); + + return revents; +} + +#endif /* ALLOW_SELECT */ + + + #endif |