summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/include/pmap.h
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2004-08-26 04:15:36 +0000
committeralc <alc@FreeBSD.org>2004-08-26 04:15:36 +0000
commit270429c53c41f1ccb67357f9ead5ef113c8be016 (patch)
tree7d35d6fd5b05a61ea3332f511df6329a09645748 /sys/powerpc/include/pmap.h
parent2222ae0c1d1b04bb980f9c2590c79260b7cfe878 (diff)
downloadFreeBSD-src-270429c53c41f1ccb67357f9ead5ef113c8be016.zip
FreeBSD-src-270429c53c41f1ccb67357f9ead5ef113c8be016.tar.gz
Add pmap locking to many of the functions.
Many thanks to Andrew Gallatin for resolving a powerpc-specific initialization problem in my original patch. Tested by: gallatin@
Diffstat (limited to 'sys/powerpc/include/pmap.h')
-rw-r--r--sys/powerpc/include/pmap.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/powerpc/include/pmap.h b/sys/powerpc/include/pmap.h
index 16fc5c6..e28042c 100644
--- a/sys/powerpc/include/pmap.h
+++ b/sys/powerpc/include/pmap.h
@@ -35,6 +35,9 @@
#ifndef _MACHINE_PMAP_H_
#define _MACHINE_PMAP_H_
+#include <sys/queue.h>
+#include <sys/_lock.h>
+#include <sys/_mutex.h>
#include <machine/sr.h>
#include <machine/pte.h>
@@ -43,6 +46,7 @@
#endif /* !defined(NPMAPS) */
struct pmap {
+ struct mtx pm_mtx;
u_int pm_sr[16];
u_int pm_active;
u_int pm_context;
@@ -72,6 +76,17 @@ extern struct pmap kernel_pmap_store;
#ifdef _KERNEL
+#define PMAP_LOCK(pmap) mtx_lock(&(pmap)->pm_mtx)
+#define PMAP_LOCK_ASSERT(pmap, type) \
+ mtx_assert(&(pmap)->pm_mtx, (type))
+#define PMAP_LOCK_DESTROY(pmap) mtx_destroy(&(pmap)->pm_mtx)
+#define PMAP_LOCK_INIT(pmap) mtx_init(&(pmap)->pm_mtx, "pmap", \
+ NULL, MTX_DEF)
+#define PMAP_LOCKED(pmap) mtx_owned(&(pmap)->pm_mtx)
+#define PMAP_MTX(pmap) (&(pmap)->pm_mtx)
+#define PMAP_TRYLOCK(pmap) mtx_trylock(&(pmap)->pm_mtx)
+#define PMAP_UNLOCK(pmap) mtx_unlock(&(pmap)->pm_mtx)
+
void pmap_bootstrap(vm_offset_t, vm_offset_t);
void pmap_kenter(vm_offset_t va, vm_offset_t pa);
void pmap_kremove(vm_offset_t);
OpenPOWER on IntegriCloud