PERFORCE change 118386 for review

Kip Macy kmacy at FreeBSD.org
Thu Apr 19 00:00:03 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=118386

Change 118386 by kmacy at kmacy_vt-x:opentoe_init on 2007/04/18 23:59:44

	IFC

Affected files ...

.. //depot/projects/opentoe/sys/amd64/linux32/linux32_dummy.c#3 integrate
.. //depot/projects/opentoe/sys/amd64/linux32/linux32_machdep.c#3 integrate
.. //depot/projects/opentoe/sys/dev/sound/isa/ad1816.c#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/isa/ess.c#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/isa/mss.c#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/isa/sb16.c#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/isa/sb8.c#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/pci/als4000.c#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/pci/atiixp.c#3 integrate
.. //depot/projects/opentoe/sys/dev/sound/pci/au88x0.c#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/pci/aureal.c#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/pci/cs4281.c#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/pci/csapcm.c#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/pci/ds1.c#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/pci/emu10k1.c#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/pci/emu10kx-pcm.c#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/pci/es137x.c#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/pci/fm801.c#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/pci/hda/hdac.c#4 integrate
.. //depot/projects/opentoe/sys/dev/sound/pci/ich.c#3 integrate
.. //depot/projects/opentoe/sys/dev/sound/pci/maestro3.c#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/pci/solo.c#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/pci/t4dwave.c#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/pci/via8233.c#3 integrate
.. //depot/projects/opentoe/sys/dev/sound/pci/via82c686.c#3 integrate
.. //depot/projects/opentoe/sys/dev/sound/pci/vibes.c#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/pcm/buffer.c#3 integrate
.. //depot/projects/opentoe/sys/dev/sound/pcm/buffer.h#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/pcm/sound.h#2 integrate
.. //depot/projects/opentoe/sys/dev/sound/sbus/cs4231.c#2 integrate

Differences ...

==== //depot/projects/opentoe/sys/amd64/linux32/linux32_dummy.c#3 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_dummy.c,v 1.8 2007/03/29 02:11:46 julian Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_dummy.c,v 1.9 2007/04/18 18:08:12 jkim Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -64,7 +64,6 @@
 DUMMY(mincore);
 DUMMY(fadvise64);
 DUMMY(ptrace);
-DUMMY(settimeofday);
 DUMMY(lookup_dcookie);
 DUMMY(epoll_create);
 DUMMY(epoll_ctl);

==== //depot/projects/opentoe/sys/amd64/linux32/linux32_machdep.c#3 (text+ko) ====

@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.39 2007/03/30 17:27:13 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.42 2007/04/18 20:12:05 jkim Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -252,7 +252,7 @@
 	if (iovcnt > UIO_MAXIOV)
 		return (EINVAL);
 	iovlen = iovcnt * sizeof(struct iovec);
-	uio = malloc(iovlen + sizeof *uio, M_IOV, M_WAITOK);
+	uio = malloc(iovlen + sizeof(*uio), M_IOV, M_WAITOK);
 	iov = (struct iovec *)(uio + 1);
 	for (i = 0; i < iovcnt; i++) {
 		error = copyin(&iovp[i], &iov32, sizeof(struct iovec32));
@@ -526,7 +526,9 @@
 
 	td2 = FIRST_THREAD_IN_PROC(p2);
 
-	/* make it run */
+	/*
+	 * Make this runnable after we are finished with it.
+	 */
 	mtx_lock_spin(&sched_lock);
 	TD_SET_CAN_RUN(td2);
 	sched_add(td2, SRQ_BORING);
@@ -572,8 +574,8 @@
 	/*
 	 * XXX: In Linux, sharing of fs info (chroot/cwd/umask)
 	 * and open files is independant.  In FreeBSD, its in one
-	 * structure but in reality it does not make any problems
-	 * because both of these flags are set at once usually.
+	 * structure but in reality it does not cause any problems
+	 * because both of these flags are usually set together.
 	 */
 	if (!(args->flags & (LINUX_CLONE_FILES | LINUX_CLONE_FS)))
 		ff |= RFFDG;
@@ -660,15 +662,15 @@
 	if (args->flags & LINUX_CLONE_SETTLS) {
 		struct user_segment_descriptor sd;
 		struct l_user_desc info;
-	   	int a[2];
+		int a[2];
 
-	   	error = copyin((void *)td->td_frame->tf_rsi, &info,
+		error = copyin((void *)td->td_frame->tf_rsi, &info,
 		    sizeof(struct l_user_desc));
 		if (error) {
 			printf(LMSG("copyin failed!"));
 		} else {
 			/* We might copy out the entry_number as GUGS32_SEL. */
-		   	info.entry_number = GUGS32_SEL;
+			info.entry_number = GUGS32_SEL;
 			error = copyout(&info, (void *)td->td_frame->tf_rsi,
 			    sizeof(struct l_user_desc));
 			if (error)
@@ -871,7 +873,7 @@
 		 *
 		 * Our mmap with MAP_STACK takes addr as the maximum
 		 * downsize limit on BOS, and as len the max size of
-		 * the region.  It them maps the top SGROWSIZ bytes,
+		 * the region.  It then maps the top SGROWSIZ bytes,
 		 * and auto grows the region down, up to the limit
 		 * in addr.
 		 *
@@ -1167,17 +1169,44 @@
 		microtime(&atv);
 		atv32.tv_sec = atv.tv_sec;
 		atv32.tv_usec = atv.tv_usec;
-		error = copyout(&atv32, uap->tp, sizeof (atv32));
+		error = copyout(&atv32, uap->tp, sizeof(atv32));
 	}
 	if (error == 0 && uap->tzp != NULL) {
 		rtz.tz_minuteswest = tz_minuteswest;
 		rtz.tz_dsttime = tz_dsttime;
-		error = copyout(&rtz, uap->tzp, sizeof (rtz));
+		error = copyout(&rtz, uap->tzp, sizeof(rtz));
 	}
 	return (error);
 }
 
 int
+linux_settimeofday(struct thread *td, struct linux_settimeofday_args *uap)
+{
+	l_timeval atv32;
+	struct timeval atv, *tvp;
+	struct timezone atz, *tzp;
+	int error;
+
+	if (uap->tp) {
+		error = copyin(uap->tp, &atv32, sizeof(atv32));
+		if (error)
+			return (error);
+		atv.tv_sec = atv32.tv_sec;
+		atv.tv_usec = atv32.tv_usec;
+		tvp = &atv;
+	} else
+		tvp = NULL;
+	if (uap->tzp) {
+		error = copyin(uap->tzp, &atz, sizeof(atz));
+		if (error)
+			return (error);
+		tzp = &atz;
+	} else
+		tzp = NULL;
+	return (kern_settimeofday(td, tvp, tzp));
+}
+
+int
 linux_getrusage(struct thread *td, struct linux_getrusage_args *uap)
 {
 	struct l_rusage s32;
@@ -1242,7 +1271,7 @@
 
 #ifdef DEBUG
 	if (ldebug(set_thread_area))
-	   	printf(ARGS(set_thread_area, "%i, %x, %x, %i, %i, %i, "
+		printf(ARGS(set_thread_area, "%i, %x, %x, %i, %i, %i, "
 		    "%i, %i, %i"), info.entry_number, info.base_addr,
 		    info.limit, info.seg_32bit, info.contents,
 		    info.read_exec_only, info.limit_in_pages,
@@ -1261,9 +1290,10 @@
 	 * The tls_array[] is used only in [gs]et_thread_area() syscalls and
 	 * for loading the GDT descriptors. We use just one GDT descriptor
 	 * for TLS, so we will load just one.
-	 * XXX: This doesnt work when user-space process tries to use more
+	 *
+	 * XXX: This doesn't work when a user space process tries to use more
 	 * than one TLS segment. Comment in the Linux source says wine might
-	 * do that.
+	 * do this.
 	 */
 
 	/*
@@ -1284,8 +1314,9 @@
 
 	/*
 	 * We have to copy out the GDT entry we use.
-	 * XXX: What if userspace program does not check return value and
-	 * tries to use 6, 7 or 8?
+	 *
+	 * XXX: What if a user space program does not check the return value
+	 * and tries to use 6, 7 or 8?
 	 */
 	error = copyout(&info, args->desc, sizeof(struct l_user_desc));
 	if (error)

==== //depot/projects/opentoe/sys/dev/sound/isa/ad1816.c#2 (text+ko) ====

@@ -33,7 +33,7 @@
 
 #include "mixer_if.h"
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/isa/ad1816.c,v 1.42 2007/03/15 16:41:25 ariff Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/isa/ad1816.c,v 1.43 2007/04/18 18:26:38 ariff Exp $");
 
 struct ad1816_info;
 
@@ -318,7 +318,7 @@
 	ch->parent = ad1816;
 	ch->channel = c;
 	ch->buffer = b;
-	if (sndbuf_alloc(ch->buffer, ad1816->parent_dmat, ad1816->bufsize) != 0)
+	if (sndbuf_alloc(ch->buffer, ad1816->parent_dmat, 0, ad1816->bufsize) != 0)
 		return NULL;
 	return ch;
 }

==== //depot/projects/opentoe/sys/dev/sound/isa/ess.c#2 (text+ko) ====

@@ -38,7 +38,7 @@
 
 #include "mixer_if.h"
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/isa/ess.c,v 1.38 2007/02/23 13:47:33 netchild Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/isa/ess.c,v 1.39 2007/04/18 18:26:38 ariff Exp $");
 
 #define ESS_BUFFSIZE (4096)
 #define ABS(x) (((x) < 0)? -(x) : (x))
@@ -563,7 +563,7 @@
 	ch->parent = sc;
 	ch->channel = c;
 	ch->buffer = b;
-	if (sndbuf_alloc(ch->buffer, sc->parent_dmat, sc->bufsize) != 0)
+	if (sndbuf_alloc(ch->buffer, sc->parent_dmat, 0, sc->bufsize) != 0)
 		return NULL;
 	ch->dir = dir;
 	ch->hwch = 1;

==== //depot/projects/opentoe/sys/dev/sound/isa/mss.c#2 (text+ko) ====

@@ -29,7 +29,7 @@
 
 #include <dev/sound/pcm/sound.h>
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/isa/mss.c,v 1.108 2007/03/15 16:41:25 ariff Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/isa/mss.c,v 1.109 2007/04/18 18:26:38 ariff Exp $");
 
 /* board-specific include files */
 #include <dev/sound/isa/mss.h>
@@ -1152,7 +1152,7 @@
 	ch->channel = c;
 	ch->buffer = b;
 	ch->dir = dir;
-	if (sndbuf_alloc(ch->buffer, mss->parent_dmat, mss->bufsize) != 0)
+	if (sndbuf_alloc(ch->buffer, mss->parent_dmat, 0, mss->bufsize) != 0)
 		return NULL;
 	sndbuf_dmasetup(ch->buffer, (dir == PCMDIR_PLAY)? mss->drq1 : mss->drq2);
 	return ch;

==== //depot/projects/opentoe/sys/dev/sound/isa/sb16.c#2 (text+ko) ====

@@ -38,7 +38,7 @@
 
 #include "mixer_if.h"
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/isa/sb16.c,v 1.94 2007/02/23 13:47:33 netchild Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/isa/sb16.c,v 1.95 2007/04/18 18:26:38 ariff Exp $");
 
 #define SB16_BUFFSIZE	4096
 #define PLAIN_SB16(x) ((((x)->bd_flags) & (BD_F_SB16|BD_F_SB16X)) == BD_F_SB16)
@@ -681,7 +681,7 @@
 	ch->buffer = b;
 	ch->dir = dir;
 
-	if (sndbuf_alloc(ch->buffer, sb->parent_dmat, sb->bufsize) != 0)
+	if (sndbuf_alloc(ch->buffer, sb->parent_dmat, 0, sb->bufsize) != 0)
 		return NULL;
 
 	return ch;

==== //depot/projects/opentoe/sys/dev/sound/isa/sb8.c#2 (text+ko) ====

@@ -38,7 +38,7 @@
 
 #include "mixer_if.h"
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/isa/sb8.c,v 1.83 2007/02/23 13:47:33 netchild Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/isa/sb8.c,v 1.84 2007/04/18 18:26:39 ariff Exp $");
 
 #define SB_DEFAULT_BUFSZ	4096
 
@@ -599,7 +599,7 @@
 	ch->channel = c;
 	ch->dir = dir;
 	ch->buffer = b;
-	if (sndbuf_alloc(ch->buffer, sb->parent_dmat, sb->bufsize) != 0)
+	if (sndbuf_alloc(ch->buffer, sb->parent_dmat, 0, sb->bufsize) != 0)
 		return NULL;
 	sndbuf_dmasetup(ch->buffer, sb->drq);
 	return ch;

==== //depot/projects/opentoe/sys/dev/sound/pci/als4000.c#2 (text+ko) ====

@@ -42,7 +42,7 @@
 
 #include "mixer_if.h"
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/als4000.c,v 1.24 2007/03/15 16:41:26 ariff Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/als4000.c,v 1.25 2007/04/18 18:26:39 ariff Exp $");
 
 /* Debugging macro's */
 #undef DEB
@@ -221,7 +221,7 @@
 	ch->buffer = b;
 	snd_mtxunlock(sc->lock);
 
-	if (sndbuf_alloc(ch->buffer, sc->parent_dmat, sc->bufsz) != 0)
+	if (sndbuf_alloc(ch->buffer, sc->parent_dmat, 0, sc->bufsz) != 0)
 		return NULL;
 
 	return ch;

==== //depot/projects/opentoe/sys/dev/sound/pci/atiixp.c#3 (text+ko) ====

@@ -63,7 +63,7 @@
 
 #include <dev/sound/pci/atiixp.h>
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/atiixp.c,v 1.13 2007/03/21 18:17:02 ariff Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/atiixp.c,v 1.14 2007/04/18 18:26:39 ariff Exp $");
 
 #define ATI_IXP_DMA_RETRY_MAX	100
 
@@ -459,7 +459,7 @@
 
 	atiixp_unlock(sc);
 
-	if (sndbuf_alloc(ch->buffer, sc->parent_dmat, sc->bufsz) == -1)
+	if (sndbuf_alloc(ch->buffer, sc->parent_dmat, 0, sc->bufsz) == -1)
 		return (NULL);
 
 	atiixp_lock(sc);

==== //depot/projects/opentoe/sys/dev/sound/pci/au88x0.c#2 (text+ko) ====

@@ -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.
  *
- * $FreeBSD: src/sys/dev/sound/pci/au88x0.c,v 1.11 2007/02/23 13:47:34 netchild Exp $
+ * $FreeBSD: src/sys/dev/sound/pci/au88x0.c,v 1.12 2007/04/18 18:26:39 ariff Exp $
  */
 
 #include <dev/sound/pcm/sound.h>
@@ -332,7 +332,7 @@
 	struct au88x0_info *aui = arg;
 	struct au88x0_chan_info *auci = au88x0_channel(aui, dir);
 
-	if (sndbuf_alloc(buf, aui->aui_dmat, aui->aui_bufsize) != 0)
+	if (sndbuf_alloc(buf, aui->aui_dmat, 0, aui->aui_bufsize) != 0)
 		return (NULL);
 	auci->auci_aui = aui;
 	auci->auci_pcmchan = chan;

==== //depot/projects/opentoe/sys/dev/sound/pci/aureal.c#2 (text+ko) ====

@@ -31,7 +31,7 @@
 #include <dev/pci/pcireg.h>
 #include <dev/pci/pcivar.h>
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/aureal.c,v 1.33 2007/02/23 13:47:34 netchild Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/aureal.c,v 1.34 2007/04/18 18:26:39 ariff Exp $");
 
 /* PCI IDs of supported chips */
 #define AU8820_PCI_ID 0x000112eb
@@ -303,7 +303,7 @@
 	ch->channel = c;
 	ch->buffer = b;
 	ch->dir = dir;
-	if (sndbuf_alloc(ch->buffer, au->parent_dmat, AU_BUFFSIZE) != 0)
+	if (sndbuf_alloc(ch->buffer, au->parent_dmat, 0, AU_BUFFSIZE) != 0)
 		return NULL;
 	return ch;
 }

==== //depot/projects/opentoe/sys/dev/sound/pci/cs4281.c#2 (text+ko) ====

@@ -37,7 +37,7 @@
 
 #include <dev/sound/pci/cs4281.h>
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/cs4281.c,v 1.23 2007/02/23 13:47:34 netchild Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/cs4281.c,v 1.24 2007/04/18 18:26:39 ariff Exp $");
 
 #define CS4281_DEFAULT_BUFSZ 16384
 
@@ -314,7 +314,7 @@
     struct sc_chinfo *ch = (dir == PCMDIR_PLAY) ? &sc->pch : &sc->rch;
 
     ch->buffer = b;
-    if (sndbuf_alloc(ch->buffer, sc->parent_dmat, sc->bufsz) != 0) {
+    if (sndbuf_alloc(ch->buffer, sc->parent_dmat, 0, sc->bufsz) != 0) {
 	return NULL;
     }
     ch->parent = sc;

==== //depot/projects/opentoe/sys/dev/sound/pci/csapcm.c#2 (text+ko) ====

@@ -38,7 +38,7 @@
 #include <dev/pci/pcireg.h>
 #include <dev/pci/pcivar.h>
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/csapcm.c,v 1.38 2007/02/23 13:47:34 netchild Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/csapcm.c,v 1.39 2007/04/18 18:26:39 ariff Exp $");
 
 /* Buffer size on dma transfer. Fixed for CS416x. */
 #define CS461x_BUFFSIZE   (4 * 1024)
@@ -534,7 +534,7 @@
 	ch->channel = c;
 	ch->buffer = b;
 	ch->dir = dir;
-	if (sndbuf_alloc(ch->buffer, csa->parent_dmat, CS461x_BUFFSIZE) != 0)
+	if (sndbuf_alloc(ch->buffer, csa->parent_dmat, 0, CS461x_BUFFSIZE) != 0)
 		return NULL;
 	return ch;
 }

==== //depot/projects/opentoe/sys/dev/sound/pci/ds1.c#2 (text+ko) ====

@@ -33,7 +33,7 @@
 #include <dev/sound/pci/ds1.h>
 #include <dev/sound/pci/ds1-fw.h>
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/ds1.c,v 1.49 2007/03/15 16:41:26 ariff Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/ds1.c,v 1.50 2007/04/18 18:26:39 ariff Exp $");
 
 /* -------------------------------------------------------------------- */
 
@@ -490,7 +490,7 @@
 	ch->fmt = AFMT_U8;
 	ch->spd = 8000;
 	ch->run = 0;
-	if (sndbuf_alloc(ch->buffer, sc->buffer_dmat, sc->bufsz) != 0)
+	if (sndbuf_alloc(ch->buffer, sc->buffer_dmat, 0, sc->bufsz) != 0)
 		return NULL;
 	else {
 		ch->lsnum = sc->pslotfree;
@@ -621,7 +621,7 @@
 	ch->dir = dir;
 	ch->fmt = AFMT_U8;
 	ch->spd = 8000;
-	if (sndbuf_alloc(ch->buffer, sc->buffer_dmat, sc->bufsz) != 0)
+	if (sndbuf_alloc(ch->buffer, sc->buffer_dmat, 0, sc->bufsz) != 0)
 		return NULL;
 	else {
 		ch->slot = (ch->num == DS1_RECPRIMARY)? sc->rbank + 2: sc->rbank;

==== //depot/projects/opentoe/sys/dev/sound/pci/emu10k1.c#2 (text+ko) ====

@@ -37,7 +37,7 @@
 #include <dev/sound/midi/mpu401.h>
 #include "mpufoi_if.h"
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/emu10k1.c,v 1.65 2007/03/15 16:41:26 ariff Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/emu10k1.c,v 1.66 2007/04/18 18:26:39 ariff Exp $");
 
 /* -------------------------------------------------------------------- */
 
@@ -895,7 +895,7 @@
 		break;
 	}
 	sc->rnum++;
-	if (sndbuf_alloc(ch->buffer, sc->parent_dmat, sc->bufsz) != 0)
+	if (sndbuf_alloc(ch->buffer, sc->parent_dmat, 0, sc->bufsz) != 0)
 		return NULL;
 	else {
 		snd_mtxlock(sc->lock);

==== //depot/projects/opentoe/sys/dev/sound/pci/emu10kx-pcm.c#2 (text+ko) ====

@@ -24,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/dev/sound/pci/emu10kx-pcm.c,v 1.7 2007/03/15 16:41:26 ariff Exp $
+ * $FreeBSD: src/sys/dev/sound/pci/emu10kx-pcm.c,v 1.8 2007/04/18 18:26:39 ariff Exp $
  */
 
 #include <sys/param.h>
@@ -602,7 +602,7 @@
 	ch->irqmask = INTE_ADCBUFENABLE;
 	ch->iprmask = IPR_ADCBUFFULL | IPR_ADCBUFHALFFULL;
 
-	if (sndbuf_alloc(ch->buffer, emu_gettag(sc->card), sc->bufsz) != 0)
+	if (sndbuf_alloc(ch->buffer, emu_gettag(sc->card), 0, sc->bufsz) != 0)
 		return (NULL);
 	else {
 		emu_wrptr(sc->card, 0, ch->basereg, sndbuf_getbufaddr(ch->buffer));
@@ -761,7 +761,7 @@
 	ch->channel = c;
 	ch->blksz = sc->bufsz;
 
-	if (sndbuf_alloc(ch->buffer, emu_gettag(sc->card), sc->bufsz) != 0)
+	if (sndbuf_alloc(ch->buffer, emu_gettag(sc->card), 0, sc->bufsz) != 0)
 		return (NULL);
 	else {
 		emu_wrptr(sc->card, 0, ch->basereg, sndbuf_getbufaddr(ch->buffer));

==== //depot/projects/opentoe/sys/dev/sound/pci/es137x.c#2 (text+ko) ====

@@ -59,7 +59,7 @@
 
 #include "mixer_if.h"
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/es137x.c,v 1.64 2007/03/16 17:18:17 ariff Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/es137x.c,v 1.65 2007/04/18 18:26:39 ariff Exp $");
 
 #define MEM_MAP_REG 0x14
 
@@ -471,7 +471,7 @@
 	ch->blksz = ch->bufsz / ch->blkcnt;
 	ch->dir = dir;
 	ES_UNLOCK(es);
-	if (sndbuf_alloc(ch->buffer, es->parent_dmat, ch->bufsz) != 0)
+	if (sndbuf_alloc(ch->buffer, es->parent_dmat, 0, ch->bufsz) != 0)
 		return (NULL);
 	ES_LOCK(es);
 	if (dir == PCMDIR_PLAY) {

==== //depot/projects/opentoe/sys/dev/sound/pci/fm801.c#2 (text+ko) ====

@@ -29,7 +29,7 @@
 #include <dev/pci/pcireg.h>
 #include <dev/pci/pcivar.h>
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/fm801.c,v 1.29 2007/02/23 13:47:34 netchild Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/fm801.c,v 1.30 2007/04/18 18:26:39 ariff Exp $");
 
 #define PCI_VENDOR_FORTEMEDIA	0x1319
 #define PCI_DEVICE_FORTEMEDIA1	0x08011319
@@ -334,7 +334,7 @@
 	ch->channel = c;
 	ch->buffer = b;
 	ch->dir = dir;
-	if (sndbuf_alloc(ch->buffer, fm801->parent_dmat, fm801->bufsz) != 0)
+	if (sndbuf_alloc(ch->buffer, fm801->parent_dmat, 0, fm801->bufsz) != 0)
 		return NULL;
 	return (void *)ch;
 }

==== //depot/projects/opentoe/sys/dev/sound/pci/hda/hdac.c#4 (text+ko) ====

@@ -98,7 +98,7 @@
 #define HDA_DRV_TEST_REV	"20070320_0043"
 #define HDA_WIDGET_PARSER_REV	1
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/hda/hdac.c,v 1.33 2007/03/21 18:17:02 ariff Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/hda/hdac.c,v 1.34 2007/04/18 18:26:40 ariff Exp $");
 
 #undef HDA_DEBUG_ENABLED
 #define HDA_DEBUG_ENABLED	1
@@ -2710,7 +2710,7 @@
 		return (NULL);
 	}
 
-	if (sndbuf_alloc(ch->b, sc->chan_dmat, sc->chan_size) != 0)
+	if (sndbuf_alloc(ch->b, sc->chan_dmat, 0, sc->chan_size) != 0)
 		return (NULL);
 
 	hdac_dma_attr((vm_offset_t)ch->b->buf, sndbuf_getmaxsize(ch->b),

==== //depot/projects/opentoe/sys/dev/sound/pci/ich.c#3 (text+ko) ====

@@ -32,7 +32,7 @@
 #include <dev/pci/pcireg.h>
 #include <dev/pci/pcivar.h>
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/ich.c,v 1.73 2007/03/21 18:17:02 ariff Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/ich.c,v 1.74 2007/04/18 18:26:39 ariff Exp $");
 
 /* -------------------------------------------------------------------- */
 
@@ -393,7 +393,7 @@
 		ch->spdreg = 0;
 
 	ICH_UNLOCK(sc);
-	if (sndbuf_alloc(ch->buffer, sc->dmat, sc->bufsz) != 0)
+	if (sndbuf_alloc(ch->buffer, sc->dmat, 0, sc->bufsz) != 0)
 		return (NULL);
 
 	ICH_LOCK(sc);

==== //depot/projects/opentoe/sys/dev/sound/pci/maestro3.c#2 (text+ko) ====

@@ -61,7 +61,7 @@
 #include <gnu/dev/sound/pci/maestro3_reg.h>
 #include <gnu/dev/sound/pci/maestro3_dsp.h>
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/maestro3.c,v 1.32 2007/03/15 16:41:26 ariff Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/maestro3.c,v 1.33 2007/04/18 18:26:39 ariff Exp $");
 
 /* -------------------------------------------------------------------- */
 
@@ -407,7 +407,7 @@
 	ch->fmt = AFMT_U8;
 	ch->spd = DSP_DEFAULT_SPEED;
 	M3_UNLOCK(sc); /* XXX */
-	if (sndbuf_alloc(ch->buffer, sc->parent_dmat, sc->bufsz) != 0) {
+	if (sndbuf_alloc(ch->buffer, sc->parent_dmat, 0, sc->bufsz) != 0) {
 		device_printf(sc->dev, "m3_pchan_init chn_allocbuf failed\n");
 		return (NULL);
 	}
@@ -756,7 +756,7 @@
 	ch->fmt = AFMT_U8;
 	ch->spd = DSP_DEFAULT_SPEED;
 	M3_UNLOCK(sc); /* XXX */
-	if (sndbuf_alloc(ch->buffer, sc->parent_dmat, sc->bufsz) != 0) {
+	if (sndbuf_alloc(ch->buffer, sc->parent_dmat, 0, sc->bufsz) != 0) {
 		device_printf(sc->dev, "m3_rchan_init chn_allocbuf failed\n");
 		return (NULL);
 	}

==== //depot/projects/opentoe/sys/dev/sound/pci/solo.c#2 (text+ko) ====

@@ -33,7 +33,7 @@
 
 #include "mixer_if.h"
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/solo.c,v 1.41 2007/03/15 16:41:26 ariff Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/solo.c,v 1.42 2007/04/18 18:26:40 ariff Exp $");
 
 #define SOLO_DEFAULT_BUFSZ 16384
 #define ABS(x) (((x) < 0)? -(x) : (x))
@@ -538,7 +538,7 @@
 	ch->channel = c;
 	ch->buffer = b;
 	ch->dir = dir;
-	if (sndbuf_alloc(ch->buffer, sc->parent_dmat, sc->bufsz) != 0)
+	if (sndbuf_alloc(ch->buffer, sc->parent_dmat, 0, sc->bufsz) != 0)
 		return NULL;
 	ch->hwch = 1;
 	if ((dir == PCMDIR_PLAY) && (sc->duplex))

==== //depot/projects/opentoe/sys/dev/sound/pci/t4dwave.c#2 (text+ko) ====

@@ -31,7 +31,7 @@
 #include <dev/pci/pcireg.h>
 #include <dev/pci/pcivar.h>
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/t4dwave.c,v 1.50 2007/03/15 16:41:26 ariff Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/t4dwave.c,v 1.51 2007/04/18 18:26:40 ariff Exp $");
 
 /* -------------------------------------------------------------------- */
 
@@ -494,7 +494,7 @@
 	ch->buffer = b;
 	ch->parent = tr;
 	ch->channel = c;
-	if (sndbuf_alloc(ch->buffer, tr->parent_dmat, tr->bufsz) != 0)
+	if (sndbuf_alloc(ch->buffer, tr->parent_dmat, 0, tr->bufsz) != 0)
 		return NULL;
 
 	return ch;
@@ -602,7 +602,7 @@
 	ch->buffer = b;
 	ch->parent = tr;
 	ch->channel = c;
-	if (sndbuf_alloc(ch->buffer, tr->parent_dmat, tr->bufsz) != 0)
+	if (sndbuf_alloc(ch->buffer, tr->parent_dmat, 0, tr->bufsz) != 0)
 		return NULL;
 
 	return ch;

==== //depot/projects/opentoe/sys/dev/sound/pci/via8233.c#3 (text+ko) ====

@@ -44,7 +44,7 @@
 
 #include <dev/sound/pci/via8233.h>
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/via8233.c,v 1.32 2007/03/21 18:17:02 ariff Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/via8233.c,v 1.33 2007/04/18 18:26:40 ariff Exp $");
 
 #define VIA8233_PCI_ID 0x30591106
 
@@ -671,7 +671,7 @@
 	via_wr(via, ch->rbase + VIA_WR_RP_SGD_FORMAT, WR_FIFO_ENABLE, 1);
 	snd_mtxunlock(via->lock);
 
-	if (sndbuf_alloc(ch->buffer, via->parent_dmat, via->bufsz) != 0)
+	if (sndbuf_alloc(ch->buffer, via->parent_dmat, 0, via->bufsz) != 0)
 		return (NULL);
 
 	snd_mtxlock(via->lock);
@@ -705,7 +705,7 @@
 	via->n_dxs_registered++;
 	snd_mtxunlock(via->lock);
 
-	if (sndbuf_alloc(ch->buffer, via->parent_dmat, via->bufsz) != 0)
+	if (sndbuf_alloc(ch->buffer, via->parent_dmat, 0, via->bufsz) != 0)
 		return (NULL);
 
 	snd_mtxlock(via->lock);
@@ -730,7 +730,7 @@
 	ch->rbase = VIA_MC_SGD_STATUS;
 	ch->blkcnt = via->blkcnt;
 
-	if (sndbuf_alloc(ch->buffer, via->parent_dmat, via->bufsz) != 0)
+	if (sndbuf_alloc(ch->buffer, via->parent_dmat, 0, via->bufsz) != 0)
 		return (NULL);
 
 	snd_mtxlock(via->lock);

==== //depot/projects/opentoe/sys/dev/sound/pci/via82c686.c#3 (text+ko) ====

@@ -33,7 +33,7 @@
 
 #include <dev/sound/pci/via82c686.h>
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/via82c686.c,v 1.40 2007/03/21 18:17:02 ariff Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/via82c686.c,v 1.41 2007/04/18 18:26:40 ariff Exp $");
 
 #define VIA_PCI_ID 0x30581106
 #define	NSEGS		4	/* Number of segments in SGD table */
@@ -270,7 +270,7 @@
 	ch->dir = dir;
 	snd_mtxunlock(via->lock);
 
-	if (sndbuf_alloc(ch->buffer, via->parent_dmat, via->bufsz) != 0)
+	if (sndbuf_alloc(ch->buffer, via->parent_dmat, 0, via->bufsz) != 0)
 		return NULL;
 
 	return ch;

==== //depot/projects/opentoe/sys/dev/sound/pci/vibes.c#2 (text+ko) ====

@@ -36,7 +36,7 @@
 
 #include "mixer_if.h"
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/vibes.c,v 1.23 2007/02/23 19:39:06 ariff Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/vibes.c,v 1.24 2007/04/18 18:26:40 ariff Exp $");
 
 /* ------------------------------------------------------------------------- */
 /* Constants */
@@ -192,7 +192,7 @@
 	ch->channel = c;
 	ch->dir = dir;
 
-	if (sndbuf_alloc(b, sc->parent_dmat, sc->bufsz) != 0) {
+	if (sndbuf_alloc(b, sc->parent_dmat, 0, sc->bufsz) != 0) {
 		DEB(printf("svchan_init failed\n"));
 		return NULL;
 	}

==== //depot/projects/opentoe/sys/dev/sound/pcm/buffer.c#3 (text+ko) ====

@@ -28,7 +28,7 @@
 
 #include "feeder_if.h"
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/buffer.c,v 1.33 2007/03/21 18:17:03 ariff Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/buffer.c,v 1.34 2007/04/18 18:26:40 ariff Exp $");
 
 struct snd_dbuf *
 sndbuf_create(device_t dev, char *drv, char *desc, struct pcm_channel *channel)
@@ -78,16 +78,18 @@
  */
 
 int
-sndbuf_alloc(struct snd_dbuf *b, bus_dma_tag_t dmatag, unsigned int size)
+sndbuf_alloc(struct snd_dbuf *b, bus_dma_tag_t dmatag, int dmaflags,
+    unsigned int size)
 {
 	int ret;
 
 	b->dmatag = dmatag;
+	b->dmaflags = dmaflags | BUS_DMA_NOWAIT;
 	b->maxsize = size;
 	b->bufsize = b->maxsize;
 	b->buf_addr = 0;
 	b->flags |= SNDBUF_F_MANAGED;
-	if (bus_dmamem_alloc(b->dmatag, (void **)&b->buf, BUS_DMA_NOWAIT,
+	if (bus_dmamem_alloc(b->dmatag, (void **)&b->buf, b->dmaflags,
 	    &b->dmamap)) {
 		sndbuf_free(b);
 		return (ENOMEM);

==== //depot/projects/opentoe/sys/dev/sound/pcm/buffer.h#2 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/dev/sound/pcm/buffer.h,v 1.14 2007/02/01 09:46:03 ariff Exp $
+ * $FreeBSD: src/sys/dev/sound/pcm/buffer.h,v 1.15 2007/04/18 18:26:40 ariff Exp $
  */
 
 #define SND_DMA(b) (sndbuf_getflags((b)) & SNDBUF_F_DMA)
@@ -54,6 +54,7 @@
 	u_int32_t flags;
 	bus_dmamap_t dmamap;
 	bus_dma_tag_t dmatag;
+	int dmaflags;
 	u_int32_t buf_addr;
 	struct selinfo sel;
 	struct pcm_channel *channel;
@@ -65,7 +66,7 @@
 
 void sndbuf_dump(struct snd_dbuf *b, char *s, u_int32_t what);
 
-int sndbuf_alloc(struct snd_dbuf *b, bus_dma_tag_t dmatag, unsigned int size);
+int sndbuf_alloc(struct snd_dbuf *b, bus_dma_tag_t dmatag, int dmaflags, unsigned int size);
 int sndbuf_setup(struct snd_dbuf *b, void *buf, unsigned int size);
 void sndbuf_free(struct snd_dbuf *b);
 int sndbuf_resize(struct snd_dbuf *b, unsigned int blkcnt, unsigned int blksz);

==== //depot/projects/opentoe/sys/dev/sound/pcm/sound.h#2 (text+ko) ====

@@ -24,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/dev/sound/pcm/sound.h,v 1.74 2007/03/16 17:15:33 ariff Exp $
+ * $FreeBSD: src/sys/dev/sound/pcm/sound.h,v 1.75 2007/04/18 18:20:48 ariff Exp $
  */
 
 /*
@@ -100,11 +100,11 @@
 
 #define SND_STATUSLEN	64
 
-#define SOUND_MODVER	1
+#define SOUND_MODVER	2
 
-#define SOUND_MINVER	1
+#define SOUND_MINVER	SOUND_MODVER
 #define SOUND_PREFVER	SOUND_MODVER
-#define SOUND_MAXVER	1
+#define SOUND_MAXVER	SOUND_MODVER
 
 /*
 PROPOSAL:

==== //depot/projects/opentoe/sys/dev/sound/sbus/cs4231.c#2 (text+ko) ====

@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/sound/sbus/cs4231.c,v 1.7 2007/03/15 16:41:27 ariff Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/sound/sbus/cs4231.c,v 1.8 2007/04/18 18:26:41 ariff Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1036,7 +1036,7 @@
 		else
 			dmat = sc->sc_dmat[0];
 	}
-	if (sndbuf_alloc(ch->buffer, dmat, sc->sc_bufsz) != 0)
+	if (sndbuf_alloc(ch->buffer, dmat, 0, sc->sc_bufsz) != 0)
 		return (NULL);
 	DPRINTF(("%s channel addr: 0x%lx\n", dir == PCMDIR_PLAY ? "playback" :
 	    "capture", sndbuf_getbufaddr(ch->buffer)));


More information about the p4-projects mailing list