summaryrefslogtreecommitdiffstats
path: root/sys/dev/hwpmc
diff options
context:
space:
mode:
authordavide <davide@FreeBSD.org>2013-09-20 23:06:21 +0000
committerdavide <davide@FreeBSD.org>2013-09-20 23:06:21 +0000
commit5273d359fdd82fc7a93ff0f694844d25a2e17c59 (patch)
tree0f8acc1728a85e0911253a1fa7cfe9c10d2c05b4 /sys/dev/hwpmc
parent7ed30adae7eb0c6e156983ca0c96c04e1e6a8e0d (diff)
downloadFreeBSD-src-5273d359fdd82fc7a93ff0f694844d25a2e17c59.zip
FreeBSD-src-5273d359fdd82fc7a93ff0f694844d25a2e17c59.tar.gz
Fix lc_lock/lc_unlock() support for rmlocks held in shared mode. With
current lock classes KPI it was really difficult because there was no way to pass an rmtracker object to the lock/unlock routines. In order to accomplish the task, modify the aforementioned functions so that they can return (or pass as argument) an uinptr_t, which is in the rm case used to hold a pointer to struct rm_priotracker for current thread. As an added bonus, this fixes rm_sleep() in the rm shared case, which right now can communicate priotracker structure between lc_unlock()/lc_lock(). Suggested by: jhb Reviewed by: jhb Approved by: re (delphij)
Diffstat (limited to 'sys/dev/hwpmc')
-rw-r--r--sys/dev/hwpmc/hwpmc_mod.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c
index 8e5eac8..2794f38 100644
--- a/sys/dev/hwpmc/hwpmc_mod.c
+++ b/sys/dev/hwpmc/hwpmc_mod.c
@@ -2027,6 +2027,7 @@ pmc_allocate_owner_descriptor(struct proc *p)
/* allocate space for N pointers and one descriptor struct */
po = malloc(sizeof(struct pmc_owner), M_PMC, M_WAITOK|M_ZERO);
po->po_owner = p;
+ LIST_INIT(&po->po_pmcs);
LIST_INSERT_HEAD(poh, po, po_next); /* insert into hash table */
TAILQ_INIT(&po->po_logbuffers);
@@ -2152,6 +2153,7 @@ pmc_allocate_pmc_descriptor(void)
struct pmc *pmc;
pmc = malloc(sizeof(struct pmc), M_PMC, M_WAITOK|M_ZERO);
+ LIST_INIT(&pmc->pm_targets);
PMCDBG(PMC,ALL,1, "allocate-pmc -> pmc=%p", pmc);
OpenPOWER on IntegriCloud