Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 assertions



details:   https://anonhg.NetBSD.org/src/rev/bb65e0b23f71
branches:  trunk
changeset: 761691:bb65e0b23f71
user:      yamt <yamt%NetBSD.org@localhost>
date:      Sat Feb 05 13:50:08 2011 +0000

description:
assertions

diffstat:

 sys/arch/x86/x86/pmap.c |  14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diffs (49 lines):

diff -r 63e8c0fe6dcc -r bb65e0b23f71 sys/arch/x86/x86/pmap.c
--- a/sys/arch/x86/x86/pmap.c   Sat Feb 05 13:47:57 2011 +0000
+++ b/sys/arch/x86/x86/pmap.c   Sat Feb 05 13:50:08 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.115 2011/02/01 20:20:19 chuck Exp $ */
+/*     $NetBSD: pmap.c,v 1.116 2011/02/05 13:50:08 yamt Exp $  */
 
 /*
  * Copyright (c) 2007 Manuel Bouyer.
@@ -142,7 +142,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.115 2011/02/01 20:20:19 chuck Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.116 2011/02/05 13:50:08 yamt Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -1905,6 +1905,7 @@
 static inline void
 pmap_freepage(struct pmap *pmap, struct vm_page *ptp, int level)
 {
+       lwp_t *l;
        int lidx;
        struct uvm_object *obj;
 
@@ -1920,8 +1921,10 @@
                pmap->pm_ptphint[lidx] = TAILQ_FIRST(&obj->memq);
        ptp->wire_count = 0;
        uvm_pagerealloc(ptp, NULL, 0);
-       VM_PAGE_TO_PP(ptp)->pp_link = curlwp->l_md.md_gc_ptp;
-       curlwp->l_md.md_gc_ptp = ptp;
+       l = curlwp;
+       KASSERT((l->l_pflag & LP_INTR) == 0);
+       VM_PAGE_TO_PP(ptp)->pp_link = l->l_md.md_gc_ptp;
+       l->l_md.md_gc_ptp = ptp;
        if (lidx != 0)
                mutex_exit(&obj->vmobjlock);
 }
@@ -4676,7 +4679,8 @@
         * but not from interrupt context.
         */
        if (l->l_md.md_gc_ptp != NULL) {
-               if (cpu_intr_p() || (l->l_pflag & LP_INTR) != 0) {
+               KASSERT((l->l_pflag & LP_INTR) == 0);
+               if (cpu_intr_p()) {
                        return;
                }
 



Home | Main Index | Thread Index | Old Index