Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hwpmc/hwpmc_power8.c
Show First 20 Lines • Show All 161 Lines • ▼ Show 20 Lines | KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), | ||||
("[powerpc,%d] illegal CPU value %d", __LINE__, cpu)); | ("[powerpc,%d] illegal CPU value %d", __LINE__, cpu)); | ||||
KASSERT(ri >= 0 && ri < ppc_max_pmcs, | KASSERT(ri >= 0 && ri < ppc_max_pmcs, | ||||
("[powerpc,%d] illegal row index %d", __LINE__, ri)); | ("[powerpc,%d] illegal row index %d", __LINE__, ri)); | ||||
pe = a->pm_md.pm_event; | pe = a->pm_md.pm_event; | ||||
counter = PM_EVENT_COUNTER(pe); | counter = PM_EVENT_COUNTER(pe); | ||||
config = PM_EVENT_CODE(pe); | config = PM_EVENT_CODE(pe); | ||||
if (a->pm_class != PMC_CLASS_POWER8) | |||||
return (EINVAL); | |||||
/* | /* | ||||
* PMC5 and PMC6 are not programmable and always count instructions | * PMC5 and PMC6 are not programmable and always count instructions | ||||
* completed and cycles, respectively. | * completed and cycles, respectively. | ||||
* | * | ||||
* When counter is 0 any of the 4 programmable PMCs may be used for | * When counter is 0 any of the 4 programmable PMCs may be used for | ||||
* the specified event, otherwise it must match ri + 1. | * the specified event, otherwise it must match ri + 1. | ||||
*/ | */ | ||||
if (counter == 0 && config == PM_INST_CMPL) | if (counter == 0 && config == PM_INST_CMPL) | ||||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |