Home
last modified time | relevance | path

Searched refs:counter (Results 1 – 25 of 949) sorted by relevance

12345678910>>...38

/linux-5.19.10/drivers/net/ethernet/marvell/prestera/ !
Dprestera_counter.c50 static void prestera_counter_lock(struct prestera_counter *counter) in prestera_counter_lock() argument
52 mutex_lock(&counter->mtx); in prestera_counter_lock()
55 static void prestera_counter_unlock(struct prestera_counter *counter) in prestera_counter_unlock() argument
57 mutex_unlock(&counter->mtx); in prestera_counter_unlock()
89 prestera_counter_block_lookup_not_full(struct prestera_counter *counter, in prestera_counter_block_lookup_not_full() argument
94 prestera_counter_lock(counter); in prestera_counter_block_lookup_not_full()
95 for (i = 0; i < counter->block_list_len; i++) { in prestera_counter_block_lookup_not_full()
96 if (counter->block_list[i] && in prestera_counter_block_lookup_not_full()
97 counter->block_list[i]->client == client && in prestera_counter_block_lookup_not_full()
98 !counter->block_list[i]->full && in prestera_counter_block_lookup_not_full()
[all …]
/linux-5.19.10/drivers/counter/ !
Dcounter-chrdev.c60 struct counter_device *const counter = filp->private_data; in counter_chrdev_read() local
64 if (!counter->ops) in counter_chrdev_read()
71 if (kfifo_is_empty(&counter->events)) { in counter_chrdev_read()
75 err = wait_event_interruptible(counter->events_wait, in counter_chrdev_read()
76 !kfifo_is_empty(&counter->events) || in counter_chrdev_read()
77 !counter->ops); in counter_chrdev_read()
80 if (!counter->ops) in counter_chrdev_read()
84 if (mutex_lock_interruptible(&counter->events_out_lock)) in counter_chrdev_read()
86 err = kfifo_to_user(&counter->events, buf, len, &copied); in counter_chrdev_read()
87 mutex_unlock(&counter->events_out_lock); in counter_chrdev_read()
[all …]
Dcounter-core.c31 struct counter_device counter; member
42 struct counter_device *const counter = in counter_device_release() local
45 counter_chrdev_remove(counter); in counter_device_release()
48 kfree(container_of(counter, struct counter_device_allochelper, counter)); in counter_device_release()
69 void *counter_priv(const struct counter_device *const counter) in counter_priv() argument
72 container_of(counter, struct counter_device_allochelper, counter); in counter_priv()
90 struct counter_device *counter; in counter_alloc() local
98 counter = &ch->counter; in counter_alloc()
99 dev = &counter->dev; in counter_alloc()
107 mutex_init(&counter->ops_exist_lock); in counter_alloc()
[all …]
Dinterrupt-cnt.c29 struct counter_device *counter = dev_id; in interrupt_cnt_isr() local
30 struct interrupt_cnt_priv *priv = counter_priv(counter); in interrupt_cnt_isr()
34 counter_push_event(counter, COUNTER_EVENT_CHANGE_OF_STATE, 0); in interrupt_cnt_isr()
39 static int interrupt_cnt_enable_read(struct counter_device *counter, in interrupt_cnt_enable_read() argument
42 struct interrupt_cnt_priv *priv = counter_priv(counter); in interrupt_cnt_enable_read()
49 static int interrupt_cnt_enable_write(struct counter_device *counter, in interrupt_cnt_enable_write() argument
52 struct interrupt_cnt_priv *priv = counter_priv(counter); in interrupt_cnt_enable_write()
77 static int interrupt_cnt_action_read(struct counter_device *counter, in interrupt_cnt_action_read() argument
87 static int interrupt_cnt_read(struct counter_device *counter, in interrupt_cnt_read() argument
90 struct interrupt_cnt_priv *priv = counter_priv(counter); in interrupt_cnt_read()
[all …]
Dti-eqep.c85 struct counter_device counter; member
90 static struct ti_eqep_cnt *ti_eqep_count_from_counter(struct counter_device *counter) in ti_eqep_count_from_counter() argument
92 return counter_priv(counter); in ti_eqep_count_from_counter()
95 static int ti_eqep_count_read(struct counter_device *counter, in ti_eqep_count_read() argument
98 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_count_read()
107 static int ti_eqep_count_write(struct counter_device *counter, in ti_eqep_count_write() argument
110 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_count_write()
120 static int ti_eqep_function_read(struct counter_device *counter, in ti_eqep_function_read() argument
124 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_function_read()
147 static int ti_eqep_function_write(struct counter_device *counter, in ti_eqep_function_write() argument
[all …]
D104-quad-8.c110 static int quad8_signal_read(struct counter_device *counter, in quad8_signal_read() argument
114 const struct quad8 *const priv = counter_priv(counter); in quad8_signal_read()
129 static int quad8_count_read(struct counter_device *counter, in quad8_count_read() argument
132 struct quad8 *const priv = counter_priv(counter); in quad8_count_read()
161 static int quad8_count_write(struct counter_device *counter, in quad8_count_write() argument
164 struct quad8 *const priv = counter_priv(counter); in quad8_count_write()
210 static int quad8_function_read(struct counter_device *counter, in quad8_function_read() argument
214 struct quad8 *const priv = counter_priv(counter); in quad8_function_read()
240 static int quad8_function_write(struct counter_device *counter, in quad8_function_write() argument
244 struct quad8 *const priv = counter_priv(counter); in quad8_function_write()
[all …]
Dcounter-sysfs.c98 struct counter_device *const counter = counter_from_dev(dev); in counter_comp_u8_show() local
104 err = a->comp.device_u8_read(counter, &data); in counter_comp_u8_show()
107 err = a->comp.signal_u8_read(counter, a->parent, &data); in counter_comp_u8_show()
110 err = a->comp.count_u8_read(counter, a->parent, &data); in counter_comp_u8_show()
130 struct counter_device *const counter = counter_from_dev(dev); in counter_comp_u8_store() local
145 err = a->comp.device_u8_write(counter, data); in counter_comp_u8_store()
148 err = a->comp.signal_u8_write(counter, a->parent, data); in counter_comp_u8_store()
151 err = a->comp.count_u8_write(counter, a->parent, data); in counter_comp_u8_store()
166 struct counter_device *const counter = counter_from_dev(dev); in counter_comp_u32_show() local
173 err = a->comp.device_u32_read(counter, &data); in counter_comp_u32_show()
[all …]
Dstm32-lptimer-cnt.c140 static int stm32_lptim_cnt_read(struct counter_device *counter, in stm32_lptim_cnt_read() argument
143 struct stm32_lptim_cnt *const priv = counter_priv(counter); in stm32_lptim_cnt_read()
156 static int stm32_lptim_cnt_function_read(struct counter_device *counter, in stm32_lptim_cnt_function_read() argument
160 struct stm32_lptim_cnt *const priv = counter_priv(counter); in stm32_lptim_cnt_function_read()
175 static int stm32_lptim_cnt_function_write(struct counter_device *counter, in stm32_lptim_cnt_function_write() argument
179 struct stm32_lptim_cnt *const priv = counter_priv(counter); in stm32_lptim_cnt_function_write()
198 static int stm32_lptim_cnt_enable_read(struct counter_device *counter, in stm32_lptim_cnt_enable_read() argument
202 struct stm32_lptim_cnt *const priv = counter_priv(counter); in stm32_lptim_cnt_enable_read()
214 static int stm32_lptim_cnt_enable_write(struct counter_device *counter, in stm32_lptim_cnt_enable_write() argument
218 struct stm32_lptim_cnt *const priv = counter_priv(counter); in stm32_lptim_cnt_enable_write()
[all …]
Dstm32-timer-cnt.c46 static int stm32_count_read(struct counter_device *counter, in stm32_count_read() argument
49 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_read()
58 static int stm32_count_write(struct counter_device *counter, in stm32_count_write() argument
61 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_write()
71 static int stm32_count_function_read(struct counter_device *counter, in stm32_count_function_read() argument
75 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_function_read()
98 static int stm32_count_function_write(struct counter_device *counter, in stm32_count_function_write() argument
102 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_function_write()
138 static int stm32_count_direction_read(struct counter_device *counter, in stm32_count_direction_read() argument
142 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_direction_read()
[all …]
/linux-5.19.10/drivers/comedi/drivers/ !
Dni_tiocmd.c38 static void ni_tio_configure_dma(struct ni_gpct *counter, in ni_tio_configure_dma() argument
41 struct ni_gpct_device *counter_dev = counter->counter_dev; in ni_tio_configure_dma()
42 unsigned int cidx = counter->counter_index; in ni_tio_configure_dma()
55 ni_tio_set_bits(counter, NITIO_INPUT_SEL_REG(cidx), mask, bits); in ni_tio_configure_dma()
69 ni_tio_set_bits(counter, NITIO_DMA_CFG_REG(cidx), mask, bits); in ni_tio_configure_dma()
78 struct ni_gpct *counter = s->private; in ni_tio_input_inttrig() local
86 spin_lock_irqsave(&counter->lock, flags); in ni_tio_input_inttrig()
87 if (counter->mite_chan) in ni_tio_input_inttrig()
88 mite_dma_arm(counter->mite_chan); in ni_tio_input_inttrig()
91 spin_unlock_irqrestore(&counter->lock, flags); in ni_tio_input_inttrig()
[all …]
Dni_tio.c149 void ni_tio_write(struct ni_gpct *counter, unsigned int value, in ni_tio_write() argument
153 counter->counter_dev->write(counter, value, reg); in ni_tio_write()
162 unsigned int ni_tio_read(struct ni_gpct *counter, enum ni_gpct_register reg) in ni_tio_read() argument
165 return counter->counter_dev->read(counter, reg); in ni_tio_read()
170 static void ni_tio_reset_count_and_disarm(struct ni_gpct *counter) in ni_tio_reset_count_and_disarm() argument
172 unsigned int cidx = counter->counter_index; in ni_tio_reset_count_and_disarm()
174 ni_tio_write(counter, GI_RESET(cidx), NITIO_RESET_REG(cidx)); in ni_tio_reset_count_and_disarm()
177 static int ni_tio_clock_period_ps(const struct ni_gpct *counter, in ni_tio_clock_period_ps() argument
201 *period_ps = counter->clock_period_ps; in ni_tio_clock_period_ps()
221 static void ni_tio_set_bits_transient(struct ni_gpct *counter, in ni_tio_set_bits_transient() argument
[all …]
/linux-5.19.10/tools/testing/selftests/netfilter/ !
Dnft_meta.sh30 counter iifcount {}
31 counter iifnamecount {}
32 counter iifgroupcount {}
33 counter iiftypecount {}
34 counter infproto4count {}
35 counter il4protocounter {}
36 counter imarkcounter {}
37 counter icpu0counter {}
38 counter ilastyearcounter {}
39 counter icurrentyearcounter {}
[all …]
/linux-5.19.10/drivers/infiniband/core/ !
Dcounters.c78 static void auto_mode_init_counter(struct rdma_counter *counter, in auto_mode_init_counter() argument
82 struct auto_mode_param *param = &counter->mode.param; in auto_mode_init_counter()
84 counter->mode.mode = RDMA_COUNTER_MODE_AUTO; in auto_mode_init_counter()
85 counter->mode.mask = new_mask; in auto_mode_init_counter()
91 static int __rdma_counter_bind_qp(struct rdma_counter *counter, in __rdma_counter_bind_qp() argument
96 if (qp->counter) in __rdma_counter_bind_qp()
102 mutex_lock(&counter->lock); in __rdma_counter_bind_qp()
103 ret = qp->device->ops.counter_bind_qp(counter, qp); in __rdma_counter_bind_qp()
104 mutex_unlock(&counter->lock); in __rdma_counter_bind_qp()
146 struct rdma_counter *counter; in alloc_and_bind() local
[all …]
/linux-5.19.10/arch/arm/include/asm/ !
Datomic.h25 #define arch_atomic_read(v) READ_ONCE((v)->counter)
26 #define arch_atomic_set(v,i) WRITE_ONCE(((v)->counter), (i))
42 prefetchw(&v->counter); \
49 : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) \
50 : "r" (&v->counter), "Ir" (i) \
60 prefetchw(&v->counter); \
68 : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) \
69 : "r" (&v->counter), "Ir" (i) \
81 prefetchw(&v->counter); \
89 : "=&r" (result), "=&r" (val), "=&r" (tmp), "+Qo" (v->counter) \
[all …]
/linux-5.19.10/drivers/net/ethernet/mellanox/mlx5/core/ !
Dfs_counters.c114 struct mlx5_fc *counter; in mlx5_fc_counters_lookup_next() local
120 counter, tmp, next_id) { in mlx5_fc_counters_lookup_next()
121 if (!list_empty(&counter->list)) in mlx5_fc_counters_lookup_next()
126 return counter ? &counter->list : &fc_stats->counters; in mlx5_fc_counters_lookup_next()
130 struct mlx5_fc *counter) in mlx5_fc_stats_insert() argument
132 struct list_head *next = mlx5_fc_counters_lookup_next(dev, counter->id); in mlx5_fc_stats_insert()
134 list_add_tail(&counter->list, next); in mlx5_fc_stats_insert()
138 struct mlx5_fc *counter) in mlx5_fc_stats_remove() argument
142 list_del(&counter->list); in mlx5_fc_stats_remove()
145 WARN_ON(!idr_remove(&fc_stats->counters_idr, counter->id)); in mlx5_fc_stats_remove()
[all …]
/linux-5.19.10/include/linux/ !
Dpage_counter.h45 static inline void page_counter_init(struct page_counter *counter, in page_counter_init() argument
48 atomic_long_set(&counter->usage, 0); in page_counter_init()
49 counter->max = PAGE_COUNTER_MAX; in page_counter_init()
50 counter->parent = parent; in page_counter_init()
53 static inline unsigned long page_counter_read(struct page_counter *counter) in page_counter_read() argument
55 return atomic_long_read(&counter->usage); in page_counter_read()
58 void page_counter_cancel(struct page_counter *counter, unsigned long nr_pages);
59 void page_counter_charge(struct page_counter *counter, unsigned long nr_pages);
60 bool page_counter_try_charge(struct page_counter *counter,
63 void page_counter_uncharge(struct page_counter *counter, unsigned long nr_pages);
[all …]
Dcounter.h107 int (*action_read)(struct counter_device *counter,
111 int (*device_u8_read)(struct counter_device *counter, u8 *val);
112 int (*count_u8_read)(struct counter_device *counter,
114 int (*signal_u8_read)(struct counter_device *counter,
116 int (*device_u32_read)(struct counter_device *counter,
118 int (*count_u32_read)(struct counter_device *counter,
120 int (*signal_u32_read)(struct counter_device *counter,
122 int (*device_u64_read)(struct counter_device *counter,
124 int (*count_u64_read)(struct counter_device *counter,
126 int (*signal_u64_read)(struct counter_device *counter,
[all …]
/linux-5.19.10/tools/perf/util/ !
Dstat-display.c382 static bool is_mixed_hw_group(struct evsel *counter) in is_mixed_hw_group() argument
384 struct evlist *evlist = counter->evlist; in is_mixed_hw_group()
385 u32 pmu_type = counter->core.attr.type; in is_mixed_hw_group()
388 if (counter->core.nr_members < 2) in is_mixed_hw_group()
407 struct evsel *counter, double uval, in printout() argument
417 .evsel = counter, in printout()
445 if (counter->cgrp) in printout()
454 if (run == 0 || ena == 0 || counter->counts->scaled == -1) { in printout()
459 aggr_printout(config, counter, id, nr); in printout()
463 counter->supported ? CNTR_NOT_COUNTED : CNTR_NOT_SUPPORTED, in printout()
[all …]
/linux-5.19.10/arch/powerpc/include/asm/ !
Datomic.h30 __asm__ __volatile__("lwz%U1%X1 %0,%1" : "=r"(t) : "m<>"(v->counter)); in arch_atomic_read()
37 __asm__ __volatile__("stw%U0%X0 %1,%0" : "=m<>"(v->counter) : "r"(i)); in arch_atomic_set()
50 : "=&r" (t), "+m" (v->counter) \
51 : "r"#sign (a), "r" (&v->counter) \
65 : "=&r" (t), "+m" (v->counter) \
66 : "r"#sign (a), "r" (&v->counter) \
82 : "=&r" (res), "=&r" (t), "+m" (v->counter) \
83 : "r"#sign (a), "r" (&v->counter) \
122 (arch_cmpxchg(&((v)->counter), (o), (n)))
124 arch_cmpxchg_relaxed(&((v)->counter), (o), (n))
[all …]
/linux-5.19.10/arch/x86/kernel/cpu/ !
Dperfctr-watchdog.c110 unsigned int counter; in reserve_perfctr_nmi() local
112 counter = nmi_perfctr_msr_to_bit(msr); in reserve_perfctr_nmi()
114 if (counter > NMI_MAX_COUNTER_BITS) in reserve_perfctr_nmi()
117 if (!test_and_set_bit(counter, perfctr_nmi_owner)) in reserve_perfctr_nmi()
125 unsigned int counter; in release_perfctr_nmi() local
127 counter = nmi_perfctr_msr_to_bit(msr); in release_perfctr_nmi()
129 if (counter > NMI_MAX_COUNTER_BITS) in release_perfctr_nmi()
132 clear_bit(counter, perfctr_nmi_owner); in release_perfctr_nmi()
138 unsigned int counter; in reserve_evntsel_nmi() local
140 counter = nmi_evntsel_msr_to_bit(msr); in reserve_evntsel_nmi()
[all …]
/linux-5.19.10/arch/x86/include/asm/ !
Datomic64_64.h22 return __READ_ONCE((v)->counter); in arch_atomic64_read()
34 __WRITE_ONCE(v->counter, i); in arch_atomic64_set()
47 : "=m" (v->counter) in arch_atomic64_add()
48 : "er" (i), "m" (v->counter) : "memory"); in arch_atomic64_add()
61 : "=m" (v->counter) in arch_atomic64_sub()
62 : "er" (i), "m" (v->counter) : "memory"); in arch_atomic64_sub()
76 return GEN_BINARY_RMWcc(LOCK_PREFIX "subq", v->counter, e, "er", i); in arch_atomic64_sub_and_test()
89 : "=m" (v->counter) in arch_atomic64_inc()
90 : "m" (v->counter) : "memory"); in arch_atomic64_inc()
103 : "=m" (v->counter) in arch_atomic64_dec()
[all …]
Datomic.h29 return __READ_ONCE((v)->counter); in arch_atomic_read()
41 __WRITE_ONCE(v->counter, i); in arch_atomic_set()
54 : "+m" (v->counter) in arch_atomic_add()
68 : "+m" (v->counter) in arch_atomic_sub()
83 return GEN_BINARY_RMWcc(LOCK_PREFIX "subl", v->counter, e, "er", i); in arch_atomic_sub_and_test()
96 : "+m" (v->counter) :: "memory"); in arch_atomic_inc()
109 : "+m" (v->counter) :: "memory"); in arch_atomic_dec()
123 return GEN_UNARY_RMWcc(LOCK_PREFIX "decl", v->counter, e); in arch_atomic_dec_and_test()
137 return GEN_UNARY_RMWcc(LOCK_PREFIX "incl", v->counter, e); in arch_atomic_inc_and_test()
152 return GEN_BINARY_RMWcc(LOCK_PREFIX "addl", v->counter, s, "er", i); in arch_atomic_add_negative()
[all …]
/linux-5.19.10/arch/arm64/include/asm/ !
Darm_dsu_pmu.h53 static inline void __dsu_pmu_select_counter(int counter) in __dsu_pmu_select_counter() argument
55 write_sysreg_s(counter, CLUSTERPMSELR_EL1); in __dsu_pmu_select_counter()
59 static inline u64 __dsu_pmu_read_counter(int counter) in __dsu_pmu_read_counter() argument
61 __dsu_pmu_select_counter(counter); in __dsu_pmu_read_counter()
65 static inline void __dsu_pmu_write_counter(int counter, u64 val) in __dsu_pmu_write_counter() argument
67 __dsu_pmu_select_counter(counter); in __dsu_pmu_write_counter()
72 static inline void __dsu_pmu_set_event(int counter, u32 event) in __dsu_pmu_set_event() argument
74 __dsu_pmu_select_counter(counter); in __dsu_pmu_set_event()
90 static inline void __dsu_pmu_disable_counter(int counter) in __dsu_pmu_disable_counter() argument
92 write_sysreg_s(BIT(counter), CLUSTERPMCNTENCLR_EL1); in __dsu_pmu_disable_counter()
[all …]
/linux-5.19.10/mm/ !
Dpage_counter.c50 void page_counter_cancel(struct page_counter *counter, unsigned long nr_pages) in page_counter_cancel() argument
54 new = atomic_long_sub_return(nr_pages, &counter->usage); in page_counter_cancel()
59 atomic_long_set(&counter->usage, new); in page_counter_cancel()
61 propagate_protected_usage(counter, new); in page_counter_cancel()
71 void page_counter_charge(struct page_counter *counter, unsigned long nr_pages) in page_counter_charge() argument
75 for (c = counter; c; c = c->parent) { in page_counter_charge()
98 bool page_counter_try_charge(struct page_counter *counter, in page_counter_try_charge() argument
104 for (c = counter; c; c = c->parent) { in page_counter_try_charge()
143 for (c = counter; c != *fail; c = c->parent) in page_counter_try_charge()
154 void page_counter_uncharge(struct page_counter *counter, unsigned long nr_pages) in page_counter_uncharge() argument
[all …]
/linux-5.19.10/include/asm-generic/ !
Datomic.h24 c = v->counter; \
25 while ((old = arch_cmpxchg(&v->counter, c, c c_op i)) != c) \
34 c = v->counter; \
35 while ((old = arch_cmpxchg(&v->counter, c, c c_op i)) != c) \
46 c = v->counter; \
47 while ((old = arch_cmpxchg(&v->counter, c, c c_op i)) != c) \
63 v->counter = v->counter c_op i; \
74 ret = (v->counter = v->counter c_op i); \
87 ret = v->counter; \
88 v->counter = v->counter c_op i; \
[all …]

12345678910>>...38