[email protected]
[Top] [All Lists]

PERFORCE change 113833 for review

Subject: PERFORCE change 113833 for review
From: Roman Divacky
Date: Thu, 1 Feb 2007 14:03:55 GMT
http://perforce.freebsd.org/chv.cgi?CH=113833

Change 113833 by [email protected]_witten on 2007/02/01 14:02:53

        IFC

Affected files ...

.. //depot/projects/linuxolator/src/sys/amd64/linux32/linux.h#17 integrate
.. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_machdep.c#33 
integrate
.. //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.c#30 integrate
.. //depot/projects/linuxolator/src/sys/compat/linux/linux_misc.c#54 integrate
.. //depot/projects/linuxolator/src/sys/compat/linux/linux_socket.c#13 integrate
.. //depot/projects/linuxolator/src/sys/dev/sound/pcm/buffer.c#4 integrate
.. //depot/projects/linuxolator/src/sys/dev/sound/pcm/buffer.h#4 integrate
.. //depot/projects/linuxolator/src/sys/dev/sound/pcm/vchan.c#3 integrate
.. //depot/projects/linuxolator/src/sys/i386/linux/linux.h#13 integrate
.. //depot/projects/linuxolator/src/sys/i386/linux/linux_machdep.c#27 integrate

Differences ...

==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux.h#17 (text+ko) 
====

@@ -27,7 +27,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/amd64/linux32/linux.h,v 1.10 2006/12/20 20:17:34 jkim Exp 
$
+ * $FreeBSD: src/sys/amd64/linux32/linux.h,v 1.11 2007/02/01 13:36:19 kib Exp $
  */
 
 #ifndef _AMD64_LINUX_LINUX_H_

==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_machdep.c#33 
(text+ko) ====

@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.28 2007/01/23 
08:46:49 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.30 2007/02/01 
13:27:51 kib Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>

==== //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.c#30 
(text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/linux/linux_emul.c,v 1.13 2007/01/20 
14:58:59 netchild Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/linux/linux_emul.c,v 1.14 2007/02/01 
13:29:27 kib Exp $");
 
 #include "opt_compat.h"
 
@@ -254,9 +254,10 @@
                struct linux_emuldata *em;
 
                /* 
-                * XXX: is it racy? if p->p_sysent still points at linux_sysvec
-                * it is. someone please check this. we were running with
-                * this race for quite a long time though.
+                * XXX:There's a race because here we assign p->p_emuldata NULL
+                * but the process is still counted as linux one for a short
+                * time so some other process might reference it and try to
+                * access its p->p_emuldata and panicing on a NULL reference.
                 */
                em = em_find(p, EMUL_DONTLOCK);
 

==== //depot/projects/linuxolator/src/sys/compat/linux/linux_misc.c#54 
(text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.205 2007/01/07 
19:30:19 netchild Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.206 2007/02/01 
13:33:33 kib Exp $");
 
 #include "opt_compat.h"
 #include "opt_mac.h"

==== //depot/projects/linuxolator/src/sys/compat/linux/linux_socket.c#13 
(text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/linux/linux_socket.c,v 1.71 2006/09/23 
19:06:54 netchild Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/linux/linux_socket.c,v 1.72 2007/02/01 
13:36:19 kib Exp $");
 
 /* XXX we use functions that might not exist. */
 #include "opt_compat.h"
@@ -1074,7 +1074,7 @@
                return (error);
 
        if ((error = copyin(PTRIN(args->msg), &msg, sizeof (msg))))
-               return (error);
+               return (error);
 
        bsd_args.s = linux_args.s;
        bsd_args.msg = PTRIN(linux_args.msg);

==== //depot/projects/linuxolator/src/sys/dev/sound/pcm/buffer.c#4 (text+ko) 
====

@@ -28,7 +28,7 @@
 
 #include "feeder_if.h"
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/buffer.c,v 1.29 2006/11/26 
12:24:05 ariff Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/buffer.c,v 1.30 2007/02/01 
09:46:03 ariff Exp $");
 
 struct snd_dbuf *
 sndbuf_create(device_t dev, char *drv, char *desc, struct pcm_channel *channel)
@@ -46,6 +46,12 @@
 void
 sndbuf_destroy(struct snd_dbuf *b)
 {
+       if (b->tmpbuf)
+               free(b->tmpbuf, M_DEVBUF);
+       if (b->shadbuf)
+               free(b->shadbuf, M_DEVBUF);
+       if (!(b->flags & SNDBUF_F_MANAGED) && b->buf)
+               free(b->buf, M_DEVBUF);
        free(b, M_DEVBUF);
 }
 
@@ -85,6 +91,7 @@
        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,
            &b->dmamap))
                return (ENOMEM);
@@ -104,6 +111,8 @@
 int
 sndbuf_setup(struct snd_dbuf *b, void *buf, unsigned int size)
 {
+       if (buf)
+               b->flags |= SNDBUF_F_MANAGED;
        b->buf = buf;
        b->maxsize = size;
        b->bufsize = b->maxsize;
@@ -122,6 +131,9 @@
        b->shadbuf = NULL;
        b->sl = 0;
 
+       if (!(b->flags & SNDBUF_F_MANAGED) && b->buf)
+               free(b->buf, M_DEVBUF);
+
        if (b->dmamap)
                bus_dmamap_unload(b->dmatag, b->dmamap);
 

==== //depot/projects/linuxolator/src/sys/dev/sound/pcm/buffer.h#4 (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.13 2006/11/26 12:24:05 ariff 
Exp $
+ * $FreeBSD: src/sys/dev/sound/pcm/buffer.h,v 1.14 2007/02/01 09:46:03 ariff 
Exp $
  */
 
 #define SND_DMA(b) (sndbuf_getflags((b)) & SNDBUF_F_DMA)
@@ -32,6 +32,7 @@
 #define        SNDBUF_F_DMA            0x00000001
 #define        SNDBUF_F_XRUN           0x00000002
 #define        SNDBUF_F_RUNNING        0x00000004
+#define        SNDBUF_F_MANAGED        0x00000008
 
 #define SNDBUF_NAMELEN 48
 

==== //depot/projects/linuxolator/src/sys/dev/sound/pcm/vchan.c#3 (text+ko) ====

@@ -32,7 +32,7 @@
 #include <dev/sound/pcm/vchan.h>
 #include "feeder_if.h"
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/vchan.c,v 1.26 2006/11/26 
12:24:06 ariff Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/vchan.c,v 1.27 2007/02/01 
09:30:01 ariff Exp $");
 
 MALLOC_DEFINE(M_VCHANFEEDER, "vchanfeed", "pcm vchan feeder");
 
@@ -334,6 +334,7 @@
 static int
 vchan_free(kobj_t obj, void *data)
 {
+       free(data, M_DEVBUF);
        return 0;
 }
 

==== //depot/projects/linuxolator/src/sys/i386/linux/linux.h#13 (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/i386/linux/linux.h,v 1.72 2006/12/20 20:17:35 jkim Exp $
+ * $FreeBSD: src/sys/i386/linux/linux.h,v 1.73 2007/02/01 13:36:19 kib Exp $
  */
 
 #ifndef _I386_LINUX_LINUX_H_

==== //depot/projects/linuxolator/src/sys/i386/linux/linux_machdep.c#27 
(text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/linux/linux_machdep.c,v 1.68 2007/01/23 
08:46:50 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/linux/linux_machdep.c,v 1.69 2007/02/01 
13:27:52 kib Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/p4-projects
To unsubscribe, send any mail to "p4-projects-unsubscrib[email protected]"

<Prev in Thread] Current Thread [Next in Thread>
  • PERFORCE change 113833 for review, Roman Divacky <=