kgdb_acc: use mutex since pm_lock was converted to it.

This commit is contained in:
rmind 2011-05-23 18:38:51 +00:00
parent 5415722580
commit 8b6402a800

View File

@ -1,4 +1,4 @@
/* $NetBSD: kgdb_machdep.c,v 1.14 2009/03/18 10:22:37 cegger Exp $ */
/* $NetBSD: kgdb_machdep.c,v 1.15 2011/05/23 18:38:51 rmind Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
* All rights reserved.
@ -121,7 +121,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.14 2009/03/18 10:22:37 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.15 2011/05/23 18:38:51 rmind Exp $");
#include "opt_kgdb.h"
#include "opt_multiprocessor.h"
@ -385,15 +385,15 @@ kgdb_acc(vaddr_t va, size_t len)
eva = round_page(va + len);
va = trunc_page(va);
simple_lock(&pm->pm_lock);
mutex_enter(&pm->pm_lock);
for (; va < eva; va += PAGE_SIZE) {
data = pseg_get(pm, va);
if ((data & TLB_V) == 0) {
simple_unlock(&pm->pm_lock);
mutex_exit(&pm->pm_lock);
return 0;
}
}
simple_unlock(&pm->pm_lock);
mutex_exit(&pm->pm_lock);
return (1);
}