Home
last modified time | relevance | path

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

12345678910>>...33

/linux/drivers/counter/
H A Dcounter-chrdev.c68 struct counter_device *const counter = filp->private_data; in counter_chrdev_read() local
72 if (!counter->ops) in counter_chrdev_read()
79 if (kfifo_is_empty(&counter->events)) { in counter_chrdev_read()
83 err = wait_event_interruptible(counter->events_wait, in counter_chrdev_read()
84 !kfifo_is_empty(&counter->events) || in counter_chrdev_read()
85 !counter->ops); in counter_chrdev_read()
88 if (!counter->ops) in counter_chrdev_read()
92 if (mutex_lock_interruptible(&counter->events_out_lock)) in counter_chrdev_read()
94 err = kfifo_to_user(&counter->events, buf, len, &copied); in counter_chrdev_read()
95 mutex_unlock(&counter->events_out_lock); in counter_chrdev_read()
[all …]
H A Dcounter-core.c31 struct counter_device counter; member
43 struct counter_device *const counter = in counter_device_release() local
46 counter_chrdev_remove(counter); in counter_device_release()
49 kfree(container_of(counter, struct counter_device_allochelper, counter)); in counter_device_release()
70 void *counter_priv(const struct counter_device *const counter) in counter_priv() argument
73 container_of(counter, struct counter_device_allochelper, counter); in counter_priv()
91 struct counter_device *counter; in counter_alloc() local
99 counter = &ch->counter; in counter_alloc()
100 dev = &counter->dev; in counter_alloc()
108 mutex_init(&counter->ops_exist_lock); in counter_alloc()
[all …]
H A Drz-mtu3-cnt.c97 static inline struct rz_mtu3_channel *rz_mtu3_get_ch(struct counter_device *counter, int id) in rz_mtu3_get_ch() argument
99 struct rz_mtu3_cnt *const priv = counter_priv(counter); in rz_mtu3_get_ch()
105 static bool rz_mtu3_is_counter_invalid(struct counter_device *counter, int id) in rz_mtu3_is_counter_invalid() argument
107 struct rz_mtu3_cnt *const priv = counter_priv(counter); in rz_mtu3_is_counter_invalid()
123 static int rz_mtu3_lock_if_counter_is_valid(struct counter_device *counter, in rz_mtu3_lock_if_counter_is_valid() argument
135 if (rz_mtu3_is_counter_invalid(counter, id)) { in rz_mtu3_lock_if_counter_is_valid()
157 static int rz_mtu3_count_read(struct counter_device *counter, in rz_mtu3_count_read() argument
160 struct rz_mtu3_channel *const ch = rz_mtu3_get_ch(counter, count->id); in rz_mtu3_count_read()
161 struct rz_mtu3_cnt *const priv = counter_priv(counter); in rz_mtu3_count_read()
164 ret = rz_mtu3_lock_if_counter_is_valid(counter, ch, priv, count->id); in rz_mtu3_count_read()
[all …]
H A Dinterrupt-cnt.c32 struct counter_device *counter = dev_id; in interrupt_cnt_isr() local
33 struct interrupt_cnt_priv *priv = counter_priv(counter); in interrupt_cnt_isr()
37 counter_push_event(counter, COUNTER_EVENT_CHANGE_OF_STATE, 0); in interrupt_cnt_isr()
42 static int interrupt_cnt_enable_read(struct counter_device *counter, in interrupt_cnt_enable_read() argument
45 struct interrupt_cnt_priv *priv = counter_priv(counter); in interrupt_cnt_enable_read()
54 static int interrupt_cnt_enable_write(struct counter_device *counter, in interrupt_cnt_enable_write() argument
57 struct interrupt_cnt_priv *priv = counter_priv(counter); in interrupt_cnt_enable_write()
84 static int interrupt_cnt_action_read(struct counter_device *counter, in interrupt_cnt_action_read() argument
94 static int interrupt_cnt_read(struct counter_device *counter, in interrupt_cnt_read() argument
97 struct interrupt_cnt_priv *priv = counter_priv(counter); in interrupt_cnt_read()
[all …]
H A Dstm32-timer-cnt.c59 static int stm32_count_read(struct counter_device *counter, in stm32_count_read() argument
62 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_read()
71 static int stm32_count_write(struct counter_device *counter, in stm32_count_write() argument
74 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_write()
84 static int stm32_count_function_read(struct counter_device *counter, in stm32_count_function_read() argument
88 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_function_read()
111 static int stm32_count_function_write(struct counter_device *counter, in stm32_count_function_write() argument
115 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_function_write()
157 static int stm32_count_direction_read(struct counter_device *counter, in stm32_count_direction_read() argument
161 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_direction_read()
[all …]
H A Dcounter-sysfs.c109 struct counter_device *const counter = counter_from_dev(dev); in counter_comp_u8_show() local
115 err = a->comp.device_u8_read(counter, &data); in counter_comp_u8_show()
118 err = a->comp.signal_u8_read(counter, a->parent, &data); in counter_comp_u8_show()
121 err = a->comp.count_u8_read(counter, a->parent, &data); in counter_comp_u8_show()
141 struct counter_device *const counter = counter_from_dev(dev); in counter_comp_u8_store() local
156 err = a->comp.device_u8_write(counter, data); in counter_comp_u8_store()
159 err = a->comp.signal_u8_write(counter, a->parent, data); in counter_comp_u8_store()
162 err = a->comp.count_u8_write(counter, a->parent, data); in counter_comp_u8_store()
177 struct counter_device *const counter = counter_from_dev(dev); in counter_comp_u32_show() local
184 err = a->comp.device_u32_read(counter, &data); in counter_comp_u32_show()
[all …]
H A Dmicrochip-tcb-capture.c74 static int mchp_tc_count_function_read(struct counter_device *counter, in mchp_tc_count_function_read() argument
78 struct mchp_tc_data *const priv = counter_priv(counter); in mchp_tc_count_function_read()
88 static int mchp_tc_count_function_write(struct counter_device *counter, in mchp_tc_count_function_write() argument
92 struct mchp_tc_data *const priv = counter_priv(counter); in mchp_tc_count_function_write()
150 static int mchp_tc_count_signal_read(struct counter_device *counter, in mchp_tc_count_signal_read() argument
154 struct mchp_tc_data *const priv = counter_priv(counter); in mchp_tc_count_signal_read()
170 static int mchp_tc_count_action_read(struct counter_device *counter, in mchp_tc_count_action_read() argument
175 struct mchp_tc_data *const priv = counter_priv(counter); in mchp_tc_count_action_read()
209 static int mchp_tc_count_action_write(struct counter_device *counter, in mchp_tc_count_action_write() argument
214 struct mchp_tc_data *const priv = counter_priv(counter); in mchp_tc_count_action_write()
[all …]
H A D104-quad-8.c215 static int quad8_signal_read(struct counter_device *counter, in quad8_signal_read() argument
219 const struct quad8 *const priv = counter_priv(counter); in quad8_signal_read()
235 static int quad8_count_read(struct counter_device *counter, in quad8_count_read() argument
238 struct quad8 *const priv = counter_priv(counter); in quad8_count_read()
283 static int quad8_count_write(struct counter_device *counter, in quad8_count_write() argument
286 struct quad8 *const priv = counter_priv(counter); in quad8_count_write()
345 static int quad8_function_read(struct counter_device *counter, in quad8_function_read() argument
349 struct quad8 *const priv = counter_priv(counter); in quad8_function_read()
362 static int quad8_function_write(struct counter_device *counter, in quad8_function_write() argument
366 struct quad8 *const priv = counter_priv(counter); in quad8_function_write()
[all …]
H A Di8254.c57 static int i8254_count_read(struct counter_device *const counter, struct counter_count *const count, in i8254_count_read() argument
60 struct i8254 *const priv = counter_priv(counter); in i8254_count_read()
84 static int i8254_function_read(struct counter_device *const counter, in i8254_function_read() argument
96 static int i8254_action_read(struct counter_device *const counter, in i8254_action_read() argument
101 struct i8254 *const priv = counter_priv(counter); in i8254_action_read()
125 static int i8254_count_ceiling_read(struct counter_device *const counter, in i8254_count_ceiling_read() argument
128 struct i8254 *const priv = counter_priv(counter); in i8254_count_ceiling_read()
156 static int i8254_count_mode_read(struct counter_device *const counter, in i8254_count_mode_read() argument
160 const struct i8254 *const priv = counter_priv(counter); in i8254_count_mode_read()
187 static int i8254_count_mode_write(struct counter_device *const counter, in i8254_count_mode_write() argument
[all …]
H A Dintel-qep.c108 static int intel_qep_count_read(struct counter_device *counter, in intel_qep_count_read() argument
111 struct intel_qep *const qep = counter_priv(counter); in intel_qep_count_read()
124 static int intel_qep_function_read(struct counter_device *counter, in intel_qep_function_read() argument
137 static int intel_qep_action_read(struct counter_device *counter, in intel_qep_action_read() argument
175 static int intel_qep_ceiling_read(struct counter_device *counter, in intel_qep_ceiling_read() argument
178 struct intel_qep *qep = counter_priv(counter); in intel_qep_ceiling_read()
187 static int intel_qep_ceiling_write(struct counter_device *counter, in intel_qep_ceiling_write() argument
190 struct intel_qep *qep = counter_priv(counter); in intel_qep_ceiling_write()
212 static int intel_qep_enable_read(struct counter_device *counter, in intel_qep_enable_read() argument
215 struct intel_qep *qep = counter_priv(counter); in intel_qep_enable_read()
[all …]
H A Dftm-quaddec.c117 static int ftm_quaddec_get_prescaler(struct counter_device *counter, in ftm_quaddec_get_prescaler() argument
120 struct ftm_quaddec *ftm = counter_priv(counter); in ftm_quaddec_get_prescaler()
130 static int ftm_quaddec_set_prescaler(struct counter_device *counter, in ftm_quaddec_set_prescaler() argument
133 struct ftm_quaddec *ftm = counter_priv(counter); in ftm_quaddec_set_prescaler()
160 static int ftm_quaddec_count_read(struct counter_device *counter, in ftm_quaddec_count_read() argument
164 struct ftm_quaddec *const ftm = counter_priv(counter); in ftm_quaddec_count_read()
174 static int ftm_quaddec_count_write(struct counter_device *counter, in ftm_quaddec_count_write() argument
178 struct ftm_quaddec *const ftm = counter_priv(counter); in ftm_quaddec_count_write()
190 static int ftm_quaddec_count_function_read(struct counter_device *counter, in ftm_quaddec_count_function_read() argument
199 static int ftm_quaddec_action_read(struct counter_device *counter, in ftm_quaddec_action_read() argument
[all …]
/linux/drivers/comedi/drivers/
H A 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 …]
H A 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 …]
/linux/security/landlock/
H A Did.c21 static void __init init_id(atomic64_t *const counter, const u32 random_32bits) in init_id() argument
39 atomic64_cmpxchg(counter, COUNTER_PRE_INIT, init); in init_id()
46 atomic64_t counter = ATOMIC64_INIT(COUNTER_PRE_INIT); in test_init_min() local
48 init_id(&counter, 0); in test_init_min()
49 KUNIT_EXPECT_EQ(test, atomic64_read(&counter), 1ULL + U32_MAX); in test_init_min()
54 atomic64_t counter = ATOMIC64_INIT(COUNTER_PRE_INIT); in test_init_max() local
56 init_id(&counter, ~0); in test_init_max()
57 KUNIT_EXPECT_EQ(test, atomic64_read(&counter), 1 + (2ULL * U32_MAX)); in test_init_max()
63 atomic64_t counter = ATOMIC64_INIT(COUNTER_PRE_INIT); in test_init_once() local
65 init_id(&counter, 0); in test_init_once()
[all …]
/linux/tools/testing/selftests/net/netfilter/
H A 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 …]
H A Dconntrack_icmp_related.sh52 if ! ip netns exec "$ns" nft list counter inet filter "$name" | grep -q "$expect"; then
54 ip netns exec "$ns" nft list counter inet filter "$name" 1>&2
116 counter unknown { }
117 counter related { }
120 meta l4proto icmpv6 icmpv6 type "packet-too-big" ct state "related" counter name "related" accept
121 …meta l4proto icmp icmp type "destination-unreachable" ct state "related" counter name "related" ac…
123 counter name "unknown" drop
131 counter unknown { }
132 counter related { }
133 counter redir4 { }
[all …]
/linux/drivers/net/ethernet/mellanox/mlx5/core/
H A Dfs_counters.c117 struct mlx5_fc *counter; in mlx5_fc_stats_query_all_counters() local
124 xas_for_each(&xas, counter, U32_MAX) { in mlx5_fc_stats_query_all_counters()
125 if (xas_retry(&xas, counter)) in mlx5_fc_stats_query_all_counters()
127 if (unlikely(counter->id >= last_bulk_id)) { in mlx5_fc_stats_query_all_counters()
130 bulk_base_id = counter->id & ~0x3; in mlx5_fc_stats_query_all_counters()
146 if (time_after64(bulk_query_time, counter->cache.lastuse)) in mlx5_fc_stats_query_all_counters()
147 update_counter_cache(counter->id - bulk_base_id, data, in mlx5_fc_stats_query_all_counters()
148 &counter->cache); in mlx5_fc_stats_query_all_counters()
153 static void mlx5_fc_free(struct mlx5_core_dev *dev, struct mlx5_fc *counter) in mlx5_fc_free() argument
155 mlx5_cmd_fc_free(dev, counter->id); in mlx5_fc_free()
[all …]
/linux/arch/arm/include/asm/
H A 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/arch/powerpc/include/asm/
H A Datomic.h33 __asm__ __volatile__("lwz %0,0(%1)" : "=r"(t) : "b"(&v->counter)); in arch_atomic_read()
35 __asm__ __volatile__("lwz%U1%X1 %0,%1" : "=r"(t) : "m<>"(v->counter)); in arch_atomic_read()
44 __asm__ __volatile__("stw %1,0(%2)" : "=m"(v->counter) : "r"(i), "b"(&v->counter)); in arch_atomic_set()
46 __asm__ __volatile__("stw%U0%X0 %1,%0" : "=m<>"(v->counter) : "r"(i)); in arch_atomic_set()
59 : "=&r" (t), "+m" (v->counter) \
60 : "r"#sign (a), "r" (&v->counter) \
74 : "=&r" (t), "+m" (v->counter) \
75 : "r"#sign (a), "r" (&v->counter) \
91 : "=&r" (res), "=&r" (t), "+m" (v->counter) \
92 : "r"#sign (a), "r" (&v->counter) \
[all …]
/linux/arch/x86/kernel/cpu/
H A 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/arch/arm64/include/asm/
H A 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/tools/testing/selftests/kvm/riscv/
H A Dsbi_pmu_test.c99 static void start_counter(unsigned long counter, unsigned long start_flags, in start_counter() argument
104 ret = sbi_ecall(SBI_EXT_PMU, SBI_EXT_PMU_COUNTER_START, counter, 1, start_flags, in start_counter()
106 __GUEST_ASSERT(ret.error == 0, "Unable to start counter %ld\n", counter); in start_counter()
110 static void stop_reset_counter(unsigned long counter, unsigned long stop_flags) in stop_reset_counter() argument
114 ret = sbi_ecall(SBI_EXT_PMU, SBI_EXT_PMU_COUNTER_STOP, counter, 1, in stop_reset_counter()
117 "Unable to stop counter %ld\n", counter); in stop_reset_counter()
120 static void stop_counter(unsigned long counter, unsigned long stop_flags) in stop_counter() argument
124 ret = sbi_ecall(SBI_EXT_PMU, SBI_EXT_PMU_COUNTER_STOP, counter, 1, stop_flags, in stop_counter()
127 "Unable to stop counter %ld error %ld\n", counter, ret.error); in stop_counter()
278 unsigned long counter; in test_pmu_event() local
[all …]
/linux/include/asm-generic/
H A 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 …]
/linux/net/dccp/ccids/lib/
H A Dloss_interval.c
/linux/drivers/perf/
H A Dfsl_imx9_ddr_perf.c193 #define ID(counter, id) ((counter << COUNTER_OFFSET_IN_EVENT) | id) argument
346 PMU_FORMAT_ATTR(counter, "config:8-15");
371 static void ddr_perf_clear_counter(struct ddr_pmu *pmu, int counter) in ddr_perf_clear_counter() argument
373 if (counter == CYCLES_COUNTER) { in ddr_perf_clear_counter()
374 writel(0, pmu->base + PMC(counter) + 0x4); in ddr_perf_clear_counter()
375 writel(0, pmu->base + PMC(counter)); in ddr_perf_clear_counter()
377 writel(0, pmu->base + PMC(counter)); in ddr_perf_clear_counter()
381 static u64 ddr_perf_read_counter(struct ddr_pmu *pmu, int counter) in ddr_perf_read_counter() argument
386 if (counter != CYCLES_COUNTER) { in ddr_perf_read_counter()
387 val = readl_relaxed(pmu->base + PMC(counter)); in ddr_perf_read_counter()
[all …]

12345678910>>...33