FreeBSD Bugzilla – Attachment 7808 Details for
Bug 16709
PATCH: make poll work for -STABLE's AudioPCI driver
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.74 KB, created by
Michael Hohmuth
on 2000-02-14 16:30:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Michael Hohmuth
Created:
2000-02-14 16:30:01 UTC
Size:
2.74 KB
patch
obsolete
>--- es1370.c.orig Mon Feb 14 16:20:42 2000 >+++ es1370.c Mon Feb 14 16:57:38 2000 >@@ -628,7 +628,69 @@ > static int > es_select(dev_t i_dev, int rw, struct proc * p) > { >- return (ENOSYS); >+ int unit, c = 1; >+ snddev_info *d ; >+ u_long flags; >+ >+/* dev = minor(i_dev); */ >+/* d = get_snddev_info(dev, &unit); */ >+ unit = UNIT(minor(i_dev)); >+ d = &pcm_info[unit]; >+ >+ if (d == NULL ) /* should not happen! */ >+ return (ENXIO) ; >+ >+ { >+ /* >+ * if the user selected a block size, then we want to use the >+ * device as a block device, and select will return ready when >+ * we have a full block. >+ * In all other cases, select will return when 1 byte is ready. >+ */ >+ int lim = 1; >+ >+ int revents = 0 ; >+ if (rw & (POLLOUT | POLLWRNORM) ) { >+ if ( d->flags & SND_F_HAS_SIZE ) >+ lim = d->play_blocksize ; >+ /* XXX fix the test here for half duplex devices */ >+ if (1 /* write is compatible with current mode */) { >+ flags = spltty(); >+ if (d->dbuf_out.dl) { >+ es_wr_dmaupdate(d); >+ } >+ c = d->dbuf_out.fl ; >+ if (c < lim) /* no space available */ >+ selrecord(p, & (d->wsel)); >+ else >+ revents |= rw & (POLLOUT | POLLWRNORM); >+ splx(flags); >+ } >+ } >+ if (rw & (POLLIN | POLLRDNORM)) { >+ if ( d->flags & SND_F_HAS_SIZE ) >+ lim = d->rec_blocksize ; >+ /* XXX fix the test here */ >+ if (1 /* read is compatible with current mode */) { >+ flags = spltty(); >+ if ( d->dbuf_in.dl == 0 ) /* dma idle, restart it */ >+ dma_rdintr(d); >+ else { >+ es_rd_dmaupdate(d); >+ } >+ c = d->dbuf_in.rl ; >+ if (c < lim) /* no data available */ >+ selrecord(p, & (d->rsel)); >+ else >+ revents |= rw & (POLLIN | POLLRDNORM); >+ splx(flags); >+ } >+ DEB(printf("sndselect on read: %d >= %d flags 0x%08x\n", >+ c, lim, d->flags)); >+ return c < lim ? 0 : 1 ; >+ } >+ return revents; >+ } > } > > >@@ -746,6 +808,15 @@ > > if(es_debug > 0) printf("es_callback reason %d speed %d \t",reason ,d->play_speed); > switch(reason & SND_CB_REASON_MASK) { >+ case SND_CB_DMAUPDATE: >+ if (reason & SND_CB_WR) >+ es_wr_dmaupdate(d); >+ else if (reason & SND_CB_RD) >+ es_rd_dmaupdate(d); >+ else return -1; >+ >+ break; >+ > case SND_CB_INIT: > /* if(es_debug > 0) printf("case SND_CB_INIT\n"); */ > if (d->type == ES1371_PCI_ID){
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 16709
: 7808