Date: Fri, 24 Nov 2006 14:52:19 GMT From: Oleksandr Tymoshenko <gonzo@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 110482 for review Message-ID: <200611241452.kAOEqJks057140@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=110482 Change 110482 by gonzo@gonzo_hq on 2006/11/24 14:51:19 o Add mutex to pmap struct o Add macroses to handle pmap locking Affected files ... .. //depot/projects/mips2/src/sys/mips/include/pmap.h#7 edit Differences ... ==== //depot/projects/mips2/src/sys/mips/include/pmap.h#7 (text+ko) ==== @@ -111,6 +111,10 @@ #ifndef LOCORE +#include <sys/queue.h> +#include <sys/_lock.h> +#include <sys/_mutex.h> + struct pv_entry; /* @@ -144,6 +148,7 @@ extern struct segtab *segbase; /* current segtab base */ typedef struct pmap { + struct mtx pm_mtx; struct pmap_statistics pm_stats; int pm_asid; int pm_asidgen; @@ -160,6 +165,21 @@ LIST_ENTRY(pmap) pm_list; /* list of all pmaps. */ } *pmap_t; +#ifdef _KERNEL +#define pmap_kernel() kernel_pmap + +#define PMAP_ASSERT_LOCKED(pmap) \ + mtx_assert(&(pmap)->pm_mtx, MA_OWNED) +#define PMAP_LOCK(pmap) mtx_lock(&(pmap)->pm_mtx) +#define PMAP_LOCK_DESTROY(pmap) mtx_destroy(&(pmap)->pm_mtx) +#define PMAP_LOCK_INIT(pmap) mtx_init(&(pmap)->pm_mtx, "pmap", \ + NULL, MTX_DEF | MTX_DUPOK) +#define PMAP_OWNED(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) +#endif + struct md_page { int pv_list_count; TAILQ_HEAD(,pv_entry) pv_list;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200611241452.kAOEqJks057140>