Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/xen/x86 Add some more KASSERT()



details:   https://anonhg.NetBSD.org/src/rev/a188ec8fb7d4
branches:  trunk
changeset: 777728:a188ec8fb7d4
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Fri Mar 02 16:38:14 2012 +0000

description:
Add some more KASSERT()

diffstat:

 sys/arch/xen/x86/xen_pmap.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r ca7d4cd246e9 -r a188ec8fb7d4 sys/arch/xen/x86/xen_pmap.c
--- a/sys/arch/xen/x86/xen_pmap.c       Fri Mar 02 16:37:38 2012 +0000
+++ b/sys/arch/xen/x86/xen_pmap.c       Fri Mar 02 16:38:14 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xen_pmap.c,v 1.18 2012/02/24 08:06:08 cherry Exp $     */
+/*     $NetBSD: xen_pmap.c,v 1.19 2012/03/02 16:38:14 bouyer Exp $     */
 
 /*
  * Copyright (c) 2007 Manuel Bouyer.
@@ -102,7 +102,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xen_pmap.c,v 1.18 2012/02/24 08:06:08 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_pmap.c,v 1.19 2012/03/02 16:38:14 bouyer Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -337,6 +337,8 @@
 static __inline void
 pmap_kpm_setpte(struct cpu_info *ci, struct pmap *pmap, int index)
 {
+       KASSERT(mutex_owned(pmap->pm_lock));
+       KASSERT(mutex_owned(&ci->ci_kpm_mtx));
        if (pmap == pmap_kernel()) {
                KASSERT(index >= PDIR_SLOT_KERN);
        }
@@ -363,6 +365,7 @@
        struct cpu_info *ci;
        
        KASSERT(pmap != NULL);
+       KASSERT(kpreempt_disabled());
 
        pmap_pte_flush();
 



Home | Main Index | Thread Index | Old Index