Lines Matching refs:cnum
390 typedef int (*pfm_reg_check_t)(struct task_struct *task, pfm_context_t *ctx, unsigned int cnum, uns…
403 #define PMC_PM(cnum, val) (((val) >> (pmu_conf->pmc_desc[cnum].pm_pos)) & 0x1) argument
2828 unsigned int cnum, reg_flags, flags, pmc_type; in pfm_write_pmcs() local
2859 cnum = req->reg_num; in pfm_write_pmcs()
2867 if (cnum >= PMU_MAX_PMCS) { in pfm_write_pmcs()
2868 DPRINT(("pmc%u is invalid\n", cnum)); in pfm_write_pmcs()
2872 pmc_type = pmu_conf->pmc_desc[cnum].type; in pfm_write_pmcs()
2873 pmc_pm = (value >> pmu_conf->pmc_desc[cnum].pm_pos) & 0x1; in pfm_write_pmcs()
2883 DPRINT(("pmc%u is unimplemented or no-access pmc_type=%x\n", cnum, pmc_type)); in pfm_write_pmcs()
2886 wr_func = pmu_conf->pmc_desc[cnum].write_check; in pfm_write_pmcs()
2892 if (is_monitor && value != PMC_DFL_VAL(cnum) && is_system ^ pmc_pm) { in pfm_write_pmcs()
2894 cnum, in pfm_write_pmcs()
2915 DPRINT(("invalid smpl_pmds 0x%lx for pmc%u\n", smpl_pmds, cnum)); in pfm_write_pmcs()
2921 DPRINT(("invalid reset_pmds 0x%lx for pmc%u\n", reset_pmds, cnum)); in pfm_write_pmcs()
2926 DPRINT(("cannot set ovfl_notify or random on pmc%u\n", cnum)); in pfm_write_pmcs()
2936 ret = (*wr_func)(task, ctx, cnum, &value, regs); in pfm_write_pmcs()
2957 ctx->ctx_pmds[cnum].flags = flags; in pfm_write_pmcs()
2959 ctx->ctx_pmds[cnum].reset_pmds[0] = reset_pmds; in pfm_write_pmcs()
2960 ctx->ctx_pmds[cnum].smpl_pmds[0] = smpl_pmds; in pfm_write_pmcs()
2961 ctx->ctx_pmds[cnum].eventid = req->reg_smpl_eventid; in pfm_write_pmcs()
2980 if (state == PFM_CTX_MASKED) ctx->ctx_ovfl_regs[0] &= ~1UL << cnum; in pfm_write_pmcs()
2987 CTX_USED_PMD(ctx, pmu_conf->pmc_desc[cnum].dep_pmd[0]); in pfm_write_pmcs()
3001 if (is_monitor) CTX_USED_MONITOR(ctx, 1UL << cnum); in pfm_write_pmcs()
3006 ctx->ctx_pmcs[cnum] = value; in pfm_write_pmcs()
3012 if (is_system == 0) ctx->th_pmcs[cnum] = value; in pfm_write_pmcs()
3018 ia64_set_pmc(cnum, value); in pfm_write_pmcs()
3029 ctx->ctx_reload_pmcs[0] |= 1UL << cnum; in pfm_write_pmcs()
3035 cnum, in pfm_write_pmcs()
3042 ctx->ctx_pmds[cnum].eventid, in pfm_write_pmcs()
3067 unsigned int cnum; in pfm_write_pmds() local
3102 cnum = req->reg_num; in pfm_write_pmds()
3105 if (!PMD_IS_IMPL(cnum)) { in pfm_write_pmds()
3106 DPRINT(("pmd[%u] is unimplemented or invalid\n", cnum)); in pfm_write_pmds()
3109 is_counting = PMD_IS_COUNTING(cnum); in pfm_write_pmds()
3110 wr_func = pmu_conf->pmd_desc[cnum].write_check; in pfm_write_pmds()
3118 ret = (*wr_func)(task, ctx, cnum, &v, regs); in pfm_write_pmds()
3142 ctx->ctx_pmds[cnum].lval = value; in pfm_write_pmds()
3155 ctx->ctx_pmds[cnum].long_reset = req->reg_long_reset; in pfm_write_pmds()
3156 ctx->ctx_pmds[cnum].short_reset = req->reg_short_reset; in pfm_write_pmds()
3161 ctx->ctx_pmds[cnum].seed = req->reg_random_seed; in pfm_write_pmds()
3162 ctx->ctx_pmds[cnum].mask = req->reg_random_mask; in pfm_write_pmds()
3167 ctx->ctx_pmds[cnum].val = value; in pfm_write_pmds()
3175 CTX_USED_PMD(ctx, PMD_PMD_DEP(cnum)); in pfm_write_pmds()
3180 CTX_USED_PMD(ctx, RDEP(cnum)); in pfm_write_pmds()
3187 ctx->ctx_ovfl_regs[0] &= ~1UL << cnum; in pfm_write_pmds()
3194 if (is_system == 0) ctx->th_pmds[cnum] = hw_value; in pfm_write_pmds()
3200 ia64_set_pmd(cnum, hw_value); in pfm_write_pmds()
3208 ctx->ctx_reload_pmds[0] |= 1UL << cnum; in pfm_write_pmds()
3215 cnum, in pfm_write_pmds()
3220 ctx->ctx_pmds[cnum].val, in pfm_write_pmds()
3221 ctx->ctx_pmds[cnum].short_reset, in pfm_write_pmds()
3222 ctx->ctx_pmds[cnum].long_reset, in pfm_write_pmds()
3223 PMC_OVFL_NOTIFY(ctx, cnum) ? 'Y':'N', in pfm_write_pmds()
3224 ctx->ctx_pmds[cnum].seed, in pfm_write_pmds()
3225 ctx->ctx_pmds[cnum].mask, in pfm_write_pmds()
3227 ctx->ctx_pmds[cnum].reset_pmds[0], in pfm_write_pmds()
3263 unsigned int cnum, reg_flags = 0; in pfm_read_pmds() local
3313 cnum = req->reg_num; in pfm_read_pmds()
3316 if (unlikely(!PMD_IS_IMPL(cnum))) goto error; in pfm_read_pmds()
3325 if (unlikely(!CTX_IS_USED_PMD(ctx, cnum))) goto error; in pfm_read_pmds()
3327 sval = ctx->ctx_pmds[cnum].val; in pfm_read_pmds()
3328 lval = ctx->ctx_pmds[cnum].lval; in pfm_read_pmds()
3329 is_counting = PMD_IS_COUNTING(cnum); in pfm_read_pmds()
3337 val = ia64_get_pmd(cnum); in pfm_read_pmds()
3344 val = is_loaded ? ctx->th_pmds[cnum] : 0UL; in pfm_read_pmds()
3346 rd_func = pmu_conf->pmd_desc[cnum].read_check; in pfm_read_pmds()
3361 ret = (*rd_func)(ctx->ctx_task, ctx, cnum, &v, regs); in pfm_read_pmds()
3369 DPRINT(("pmd[%u]=0x%lx\n", cnum, val)); in pfm_read_pmds()
4115 unsigned int cnum; in pfm_get_pmc_reset() local
4121 cnum = req->reg_num; in pfm_get_pmc_reset()
4123 if (!PMC_IS_IMPL(cnum)) goto abort_mission; in pfm_get_pmc_reset()
4125 req->reg_value = PMC_DFL_VAL(cnum); in pfm_get_pmc_reset()
4129 DPRINT(("pmc_reset_val pmc[%u]=0x%lx\n", cnum, req->reg_value)); in pfm_get_pmc_reset()