Source-Changes-HG archive

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

[src/trunk]: src/sys/uvm pmap_wired_count() is now available on all platforms,



details:   https://anonhg.NetBSD.org/src/rev/3ce6bcea75f8
branches:  trunk
changeset: 573238:3ce6bcea75f8
user:      chs <chs%NetBSD.org@localhost>
date:      Sun Jan 23 15:58:13 2005 +0000

description:
pmap_wired_count() is now available on all platforms,
remove the code for the case where it's not defined.

diffstat:

 sys/uvm/uvm_map.c  |  12 ++----------
 sys/uvm/uvm_mmap.c |  40 ++++++----------------------------------
 2 files changed, 8 insertions(+), 44 deletions(-)

diffs (139 lines):

diff -r a409709a591b -r 3ce6bcea75f8 sys/uvm/uvm_map.c
--- a/sys/uvm/uvm_map.c Sun Jan 23 10:53:19 2005 +0000
+++ b/sys/uvm/uvm_map.c Sun Jan 23 15:58:13 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_map.c,v 1.182 2005/01/17 04:37:20 atatat Exp $     */
+/*     $NetBSD: uvm_map.c,v 1.183 2005/01/23 15:58:13 chs Exp $        */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.182 2005/01/17 04:37:20 atatat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.183 2005/01/23 15:58:13 chs Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -3257,14 +3257,11 @@
                return ENOMEM;
        }
 
-       /* XXX non-pmap_wired_count case must be handled by caller */
-#ifdef pmap_wired_count
        if (limit != 0 &&
            (size + ptoa(pmap_wired_count(vm_map_pmap(map))) > limit)) {
                vm_map_unlock(map);
                return ENOMEM;
        }
-#endif
 
        /*
         * Pass 2.
@@ -4377,13 +4374,8 @@
        (*pr)("\t#ent=%d, sz=%d, ref=%d, version=%d, flags=0x%x\n",
            map->nentries, map->size, map->ref_count, map->timestamp,
            map->flags);
-#ifdef pmap_wired_count
        (*pr)("\tpmap=%p(resident=%ld, wired=%ld)\n", map->pmap,
            pmap_resident_count(map->pmap), pmap_wired_count(map->pmap));
-#else
-       (*pr)("\tpmap=%p(resident=%ld)\n", map->pmap,
-           pmap_resident_count(map->pmap));
-#endif
        if (!full)
                return;
        for (entry = map->header.next; entry != &map->header;
diff -r a409709a591b -r 3ce6bcea75f8 sys/uvm/uvm_mmap.c
--- a/sys/uvm/uvm_mmap.c        Sun Jan 23 10:53:19 2005 +0000
+++ b/sys/uvm/uvm_mmap.c        Sun Jan 23 15:58:13 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_mmap.c,v 1.86 2005/01/01 21:00:06 yamt Exp $       */
+/*     $NetBSD: uvm_mmap.c,v 1.87 2005/01/23 15:58:13 chs Exp $        */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -51,7 +51,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_mmap.c,v 1.86 2005/01/01 21:00:06 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_mmap.c,v 1.87 2005/01/23 15:58:13 chs Exp $");
 
 #include "opt_compat_netbsd.h"
 
@@ -335,16 +335,6 @@
        if ((ssize_t) size < 0)
                return (EINVAL);                        /* don't allow wrap */
 
-#ifndef pmap_wired_count
-       /*
-        * if we're going to wire the mapping, restrict it to superuser.
-        */
-
-       if ((flags & MAP_WIRED) != 0 &&
-           (error = suser(p->p_ucred, &p->p_acflag)) != 0)
-               return (error);
-#endif
-
        /*
         * now check (MAP_FIXED) or get (!MAP_FIXED) the "addr"
         */
@@ -924,14 +914,9 @@
        if (atop(size) + uvmexp.wired > uvmexp.wiredmax)
                return (EAGAIN);
 
-#ifdef pmap_wired_count
        if (size + ptoa(pmap_wired_count(vm_map_pmap(&p->p_vmspace->vm_map))) >
                        p->p_rlimit[RLIMIT_MEMLOCK].rlim_cur)
                return (EAGAIN);
-#else
-       if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
-               return (error);
-#endif
 
        error = uvm_map_pageable(&p->p_vmspace->vm_map, addr, addr+size, FALSE,
            0);
@@ -979,11 +964,6 @@
        if (addr + size < addr)
                return (EINVAL);
 
-#ifndef pmap_wired_count
-       if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
-               return (error);
-#endif
-
        error = uvm_map_pageable(&p->p_vmspace->vm_map, addr, addr+size, TRUE,
            0);
        if (error == EFAULT)
@@ -1013,11 +993,6 @@
            (flags & ~(MCL_CURRENT|MCL_FUTURE)) != 0)
                return (EINVAL);
 
-#ifndef pmap_wired_count
-       if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
-               return (error);
-#endif
-
        error = uvm_map_pageable_all(&p->p_vmspace->vm_map, flags,
            p->p_rlimit[RLIMIT_MEMLOCK].rlim_cur);
        return (error);
@@ -1207,13 +1182,10 @@
        }
        vm_map_lock(map);
        if ((flags & MAP_WIRED) != 0 || (map->flags & VM_MAP_WIREFUTURE) != 0) {
-               if ((atop(size) + uvmexp.wired) > uvmexp.wiredmax
-#ifdef pmap_wired_count
-                   || (locklimit != 0 && (size +
-                   ptoa(pmap_wired_count(vm_map_pmap(map)))) >
-                       locklimit)
-#endif
-               ) {
+               if (atop(size) + uvmexp.wired > uvmexp.wiredmax ||
+                   (locklimit != 0 &&
+                    size + ptoa(pmap_wired_count(vm_map_pmap(map))) >
+                    locklimit)) {
                        vm_map_unlock(map);
                        uvm_unmap(map, *addr, *addr + size);
                        return ENOMEM;



Home | Main Index | Thread Index | Old Index