Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/hwpmc/hwpmc_tsc.c
Show First 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | tsc_allocate_pmc(int cpu, int ri, struct pmc *pm, | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
tsc_config_pmc(int cpu, int ri, struct pmc *pm) | tsc_config_pmc(int cpu, int ri, struct pmc *pm) | ||||
{ | { | ||||
struct pmc_hw *phw; | struct pmc_hw *phw; | ||||
PMCDBG(MDP,CFG,1, "cpu=%d ri=%d pm=%p", cpu, ri, pm); | PMCDBG3(MDP,CFG,1, "cpu=%d ri=%d pm=%p", cpu, ri, pm); | ||||
KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), | KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), | ||||
("[tsc,%d] illegal CPU value %d", __LINE__, cpu)); | ("[tsc,%d] illegal CPU value %d", __LINE__, cpu)); | ||||
KASSERT(ri == 0, ("[tsc,%d] illegal row-index %d", __LINE__, ri)); | KASSERT(ri == 0, ("[tsc,%d] illegal row-index %d", __LINE__, ri)); | ||||
phw = &tsc_pcpu[cpu]->tc_hw; | phw = &tsc_pcpu[cpu]->tc_hw; | ||||
KASSERT(pm == NULL || phw->phw_pmc == NULL, | KASSERT(pm == NULL || phw->phw_pmc == NULL, | ||||
▲ Show 20 Lines • Show All 137 Lines • ▼ Show 20 Lines | tsc_read_pmc(int cpu, int ri, pmc_value_t *v) | ||||
KASSERT(pm != NULL, | KASSERT(pm != NULL, | ||||
("[tsc,%d] no owner for PHW [cpu%d,pmc%d]", __LINE__, cpu, ri)); | ("[tsc,%d] no owner for PHW [cpu%d,pmc%d]", __LINE__, cpu, ri)); | ||||
mode = PMC_TO_MODE(pm); | mode = PMC_TO_MODE(pm); | ||||
KASSERT(mode == PMC_MODE_SC, | KASSERT(mode == PMC_MODE_SC, | ||||
("[tsc,%d] illegal pmc mode %d", __LINE__, mode)); | ("[tsc,%d] illegal pmc mode %d", __LINE__, mode)); | ||||
PMCDBG(MDP,REA,1,"tsc-read id=%d", ri); | PMCDBG1(MDP,REA,1,"tsc-read id=%d", ri); | ||||
*v = rdtsc(); | *v = rdtsc(); | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
tsc_release_pmc(int cpu, int ri, struct pmc *pmc) | tsc_release_pmc(int cpu, int ri, struct pmc *pmc) | ||||
▲ Show 20 Lines • Show All 121 Lines • Show Last 20 Lines |