Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hwpmc/hwpmc_core.c
| Show First 20 Lines • Show All 324 Lines • ▼ Show 20 Lines | iaf_config_pmc(int cpu, int ri, struct pmc *pm) | ||||
| core_pcpu[cpu]->pc_corepmcs[ri + core_iaf_ri].phw_pmc = pm; | core_pcpu[cpu]->pc_corepmcs[ri + core_iaf_ri].phw_pmc = pm; | ||||
| return (0); | return (0); | ||||
| } | } | ||||
| static int | static int | ||||
| iaf_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) | iaf_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) | ||||
| { | { | ||||
| int error; | |||||
| struct pmc_hw *phw; | struct pmc_hw *phw; | ||||
| char iaf_name[PMC_NAME_MAX]; | |||||
| phw = &core_pcpu[cpu]->pc_corepmcs[ri + core_iaf_ri]; | phw = &core_pcpu[cpu]->pc_corepmcs[ri + core_iaf_ri]; | ||||
| (void) snprintf(iaf_name, sizeof(iaf_name), "IAF-%d", ri); | snprintf(pi->pm_name, PMC_NAME_MAX, "IAF-%d", ri); | ||||
| if ((error = copystr(iaf_name, pi->pm_name, PMC_NAME_MAX, | |||||
| NULL)) != 0) | |||||
| return (error); | |||||
| pi->pm_class = PMC_CLASS_IAF; | pi->pm_class = PMC_CLASS_IAF; | ||||
| if (phw->phw_state & PMC_PHW_FLAG_IS_ENABLED) { | if (phw->phw_state & PMC_PHW_FLAG_IS_ENABLED) { | ||||
| pi->pm_enabled = TRUE; | pi->pm_enabled = TRUE; | ||||
| *ppmc = phw->phw_pmc; | *ppmc = phw->phw_pmc; | ||||
| } else { | } else { | ||||
| pi->pm_enabled = FALSE; | pi->pm_enabled = FALSE; | ||||
| *ppmc = NULL; | *ppmc = NULL; | ||||
| ▲ Show 20 Lines • Show All 457 Lines • ▼ Show 20 Lines | iap_config_pmc(int cpu, int ri, struct pmc *pm) | ||||
| core_pcpu[cpu]->pc_corepmcs[ri].phw_pmc = pm; | core_pcpu[cpu]->pc_corepmcs[ri].phw_pmc = pm; | ||||
| return (0); | return (0); | ||||
| } | } | ||||
| static int | static int | ||||
| iap_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) | iap_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) | ||||
| { | { | ||||
| int error; | |||||
| struct pmc_hw *phw; | struct pmc_hw *phw; | ||||
| char iap_name[PMC_NAME_MAX]; | |||||
| phw = &core_pcpu[cpu]->pc_corepmcs[ri]; | phw = &core_pcpu[cpu]->pc_corepmcs[ri]; | ||||
| (void) snprintf(iap_name, sizeof(iap_name), "IAP-%d", ri); | snprintf(pi->pm_name, PMC_NAME_MAX, "IAP-%d", ri); | ||||
| if ((error = copystr(iap_name, pi->pm_name, PMC_NAME_MAX, | |||||
| NULL)) != 0) | |||||
| return (error); | |||||
| pi->pm_class = PMC_CLASS_IAP; | pi->pm_class = PMC_CLASS_IAP; | ||||
| if (phw->phw_state & PMC_PHW_FLAG_IS_ENABLED) { | if (phw->phw_state & PMC_PHW_FLAG_IS_ENABLED) { | ||||
| pi->pm_enabled = TRUE; | pi->pm_enabled = TRUE; | ||||
| *ppmc = phw->phw_pmc; | *ppmc = phw->phw_pmc; | ||||
| } else { | } else { | ||||
| pi->pm_enabled = FALSE; | pi->pm_enabled = FALSE; | ||||
| *ppmc = NULL; | *ppmc = NULL; | ||||
| ▲ Show 20 Lines • Show All 487 Lines • Show Last 20 Lines | |||||