Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/rump/net/lib/libshmif Don't assume rump kernel PAGE_SIZE...



details:   https://anonhg.NetBSD.org/src/rev/4e20f6c20fef
branches:  trunk
changeset: 763147:4e20f6c20fef
user:      pooka <pooka%NetBSD.org@localhost>
date:      Fri Mar 11 09:25:59 2011 +0000

description:
Don't assume rump kernel PAGE_SIZE and host page size are the same.

diffstat:

 sys/rump/net/lib/libshmif/if_shmem.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r 18a1f85c7739 -r 4e20f6c20fef sys/rump/net/lib/libshmif/if_shmem.c
--- a/sys/rump/net/lib/libshmif/if_shmem.c      Fri Mar 11 03:26:37 2011 +0000
+++ b/sys/rump/net/lib/libshmif/if_shmem.c      Fri Mar 11 09:25:59 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_shmem.c,v 1.35 2011/03/10 13:27:03 pooka Exp $      */
+/*     $NetBSD: if_shmem.c,v 1.36 2011/03/11 09:25:59 pooka Exp $      */
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.35 2011/03/10 13:27:03 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.36 2011/03/11 09:25:59 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -219,10 +219,14 @@
                return ENOEXEC; 
        }
 
-       /* Prefault in pages to minimize runtime penalty with buslock */
+       /*
+        * Prefault in pages to minimize runtime penalty with buslock.
+        * Use 512 instead of PAGE_SIZE to make sure we catch cases where
+        * rump kernel PAGE_SIZE > host page size.
+        */
        for (p = (uint8_t *)sc->sc_busmem;
            p < (uint8_t *)sc->sc_busmem + BUSMEM_SIZE;
-           p += PAGE_SIZE)
+           p += 512)
                v = *p;
 
        shmif_lockbus(sc->sc_busmem);



Home | Main Index | Thread Index | Old Index