Lines Matching refs:idx

190 static u64 bfin_pfmon_read(int idx)  in bfin_pfmon_read()  argument
192 return bfin_read32(PFCNTR0 + (idx * 4)); in bfin_pfmon_read()
195 static void bfin_pfmon_disable(struct hw_perf_event *hwc, int idx) in bfin_pfmon_disable() argument
197 bfin_write_PFCTL(bfin_read_PFCTL() & ~PFCEN(idx, PFCEN_MASK)); in bfin_pfmon_disable()
200 static void bfin_pfmon_enable(struct hw_perf_event *hwc, int idx) in bfin_pfmon_enable() argument
205 if (idx) { in bfin_pfmon_enable()
261 struct hw_perf_event *hwc, int idx) in bfin_perf_event_update() argument
281 new_raw_count = bfin_pfmon_read(idx); in bfin_perf_event_update()
305 int idx = hwc->idx; in bfin_pmu_stop() local
308 bfin_pfmon_disable(hwc, idx); in bfin_pmu_stop()
309 cpuc->events[idx] = NULL; in bfin_pmu_stop()
314 bfin_perf_event_update(event, &event->hw, idx); in bfin_pmu_stop()
323 int idx = hwc->idx; in bfin_pmu_start() local
325 if (WARN_ON_ONCE(idx == -1)) in bfin_pmu_start()
331 cpuc->events[idx] = event; in bfin_pmu_start()
333 bfin_pfmon_enable(hwc, idx); in bfin_pmu_start()
341 __clear_bit(event->hw.idx, cpuc->used_mask); in bfin_pmu_del()
350 int idx = hwc->idx; in bfin_pmu_add() local
355 if (__test_and_set_bit(idx, cpuc->used_mask)) { in bfin_pmu_add()
356 idx = find_first_zero_bit(cpuc->used_mask, MAX_HWEVENTS); in bfin_pmu_add()
357 if (idx == MAX_HWEVENTS) in bfin_pmu_add()
360 __set_bit(idx, cpuc->used_mask); in bfin_pmu_add()
361 hwc->idx = idx; in bfin_pmu_add()
364 bfin_pfmon_disable(hwc, idx); in bfin_pmu_add()
379 bfin_perf_event_update(event, &event->hw, event->hw.idx); in bfin_pmu_read()
434 bfin_pfmon_enable(hwc, hwc->idx); in bfin_pmu_enable()