| /linux-6.15/drivers/net/ethernet/marvell/prestera/ |
| H A D | prestera_counter.c | 126 arr = krealloc(counter->block_list, (counter->block_list_len + 1) * in prestera_counter_block_list_add() 134 counter->block_list[counter->block_list_len] = block; in prestera_counter_block_list_add() 374 err = prestera_hw_counters_get(counter->sw, counter->total_read, in prestera_counter_stats_work() 406 prestera_counter_block_idx_next(counter, counter->curr_idx); in prestera_counter_stats_work() 441 counter = kzalloc(sizeof(*counter), GFP_KERNEL); in prestera_counter_init() 442 if (!counter) in prestera_counter_init() 447 kfree(counter); in prestera_counter_init() 453 counter->sw = sw; in prestera_counter_init() 454 sw->counter = counter; in prestera_counter_init() 464 struct prestera_counter *counter = sw->counter; in prestera_counter_fini() local [all …]
|
| /linux-6.15/drivers/counter/ |
| H A D | counter-chrdev.c | 72 if (!counter->ops) in counter_chrdev_read() 85 !counter->ops); in counter_chrdev_read() 88 if (!counter->ops) in counter_chrdev_read() 109 if (!counter->ops) in counter_chrdev_poll() 208 err = counter->ops->events_configure(counter); in counter_enable_events() 226 err = counter->ops->events_configure(counter); in counter_disable_events() 287 ext = counter->ext; in counter_add_watch() 367 err = counter->ops->watch_validate(counter, &watch); in counter_add_watch() 390 if (!counter->ops) in counter_chrdev_ioctl() 433 if (!counter->ops) { in counter_chrdev_release() [all …]
|
| H A D | counter-core.c | 49 kfree(container_of(counter, struct counter_device_allochelper, counter)); in counter_device_release() 73 container_of(counter, struct counter_device_allochelper, counter); in counter_priv() 99 counter = &ch->counter; in counter_alloc() 100 dev = &counter->dev; in counter_alloc() 123 return counter; in counter_alloc() 180 if (!counter) in counter_unregister() 183 cdev_device_del(&counter->chrdev, &counter->dev); in counter_unregister() 187 counter->ops = NULL; in counter_unregister() 201 counter_put(counter); in devm_counter_put() 218 if (!counter) in devm_counter_alloc() [all …]
|
| H A D | rz-mtu3-cnt.c | 447 rz_mtu3_32bit_cnt_setting(counter); in rz_mtu3_initialize_counter() 838 struct counter_device *counter; in rz_mtu3_cnt_probe() local 845 if (!counter) in rz_mtu3_cnt_probe() 848 priv = counter_priv(counter); in rz_mtu3_cnt_probe() 868 counter->name = dev_name(dev); in rz_mtu3_cnt_probe() 869 counter->parent = dev; in rz_mtu3_cnt_probe() 870 counter->ops = &rz_mtu3_cnt_ops; in rz_mtu3_cnt_probe() 871 counter->counts = rz_mtu3_counts; in rz_mtu3_cnt_probe() 873 counter->signals = rz_mtu3_signals; in rz_mtu3_cnt_probe() 875 counter->ext = rz_mtu3_device_ext; in rz_mtu3_cnt_probe() [all …]
|
| H A D | ti-ecap-capture.c | 105 pm_runtime_get_sync(counter->parent); in ecap_cnt_capture_get_evmode() 107 pm_runtime_put_sync(counter->parent); in ecap_cnt_capture_get_evmode() 116 pm_runtime_get_sync(counter->parent); in ecap_cnt_capture_set_evmode() 118 pm_runtime_put_sync(counter->parent); in ecap_cnt_capture_set_evmode() 125 pm_runtime_get_sync(counter->parent); in ecap_cnt_capture_enable() 146 pm_runtime_put_sync(counter->parent); in ecap_cnt_capture_disable() 154 pm_runtime_get_sync(counter->parent); in ecap_cnt_count_get_val() 156 pm_runtime_put_sync(counter->parent); in ecap_cnt_count_get_val() 165 pm_runtime_get_sync(counter->parent); in ecap_cnt_count_set_val() 340 ecap_cnt_capture_enable(counter); in ecap_cnt_enable_write() [all …]
|
| H A D | interrupt-cnt.c | 164 struct counter_device *counter; in interrupt_cnt_probe() local 169 if (!counter) in interrupt_cnt_probe() 171 priv = counter_priv(counter); in interrupt_cnt_probe() 202 counter->signals = &priv->signals; in interrupt_cnt_probe() 203 counter->num_signals = 1; in interrupt_cnt_probe() 217 counter->name = dev_name(dev); in interrupt_cnt_probe() 218 counter->parent = dev; in interrupt_cnt_probe() 219 counter->ops = &interrupt_cnt_ops; in interrupt_cnt_probe() 220 counter->counts = &priv->cnts; in interrupt_cnt_probe() 221 counter->num_counts = 1; in interrupt_cnt_probe() [all …]
|
| H A D | ti-eqep.c | 498 struct counter_device *counter; in ti_eqep_probe() local 505 if (!counter) in ti_eqep_probe() 507 priv = counter_priv(counter); in ti_eqep_probe() 532 counter->name = dev_name(dev); in ti_eqep_probe() 533 counter->parent = dev; in ti_eqep_probe() 534 counter->ops = &ti_eqep_counter_ops; in ti_eqep_probe() 535 counter->counts = ti_eqep_counts; in ti_eqep_probe() 537 counter->signals = ti_eqep_signals; in ti_eqep_probe() 540 platform_set_drvdata(pdev, counter); in ti_eqep_probe() 554 err = counter_add(counter); in ti_eqep_probe() [all …]
|
| H A D | stm32-timer-cnt.c | 619 struct counter_device *counter = ptr; in stm32_timer_cnt_isr() local 721 struct counter_device *counter; in stm32_timer_cnt_probe() local 728 if (!counter) in stm32_timer_cnt_probe() 731 priv = counter_priv(counter); in stm32_timer_cnt_probe() 744 counter->name = dev_name(dev); in stm32_timer_cnt_probe() 745 counter->parent = dev; in stm32_timer_cnt_probe() 746 counter->ops = &stm32_timer_cnt_ops; in stm32_timer_cnt_probe() 747 counter->counts = &stm32_counts; in stm32_timer_cnt_probe() 748 counter->num_counts = 1; in stm32_timer_cnt_probe() 749 counter->signals = stm32_signals; in stm32_timer_cnt_probe() [all …]
|
| H A D | microchip-tcb-capture.c | 432 dev_name(counter->parent), counter); in mchp_tc_irq_enable() 458 struct counter_device *counter; in mchp_tc_probe() local 467 if (!counter) in mchp_tc_probe() 469 priv = counter_priv(counter); in mchp_tc_probe() 543 counter->name = dev_name(&pdev->dev); in mchp_tc_probe() 544 counter->parent = &pdev->dev; in mchp_tc_probe() 545 counter->ops = &mchp_tc_ops; in mchp_tc_probe() 547 counter->counts = mchp_tc_counts; in mchp_tc_probe() 549 counter->signals = mchp_tc_count_signals; in mchp_tc_probe() 555 ret = mchp_tc_irq_enable(counter, i); in mchp_tc_probe() [all …]
|
| /linux-6.15/drivers/comedi/drivers/ |
| H A D | ni_tiocmd.c | 78 struct ni_gpct *counter = s->private; in ni_tio_input_inttrig() local 87 if (counter->mite_chan) in ni_tio_input_inttrig() 88 mite_dma_arm(counter->mite_chan); in ni_tio_input_inttrig() 130 mite_dma_arm(counter->mite_chan); in ni_tio_input_cmd() 213 if (!counter->mite_chan) { in ni_tio_cmd() 337 ni_tio_arm(counter, false, 0); in ni_tio_cancel() 339 if (counter->mite_chan) in ni_tio_cancel() 372 if (!counter->mite_chan || in should_ack_gate() 424 if (should_ack_gate(counter)) in ni_tio_acknowledge_and_confirm() 480 if (counter->mite_chan) in ni_tio_handle_interrupt() [all …]
|
| H A D | ni_tio.c | 153 counter->counter_dev->write(counter, value, reg); in ni_tio_write() 165 return counter->counter_dev->read(counter, reg); in ni_tio_read() 541 ni_tio_set_sync_mode(counter); in ni_tio_set_counter_mode() 804 ni_tio_set_sync_mode(counter); in ni_tio_set_clock_src() 829 ni_tio_set_bits(counter, NITIO_INPUT_SEL_REG(counter->counter_index), in ni_tio_set_gate_raw() 836 ni_tio_set_bits(counter, NITIO_GATE2_REG(counter->counter_index), in ni_tio_set_gate2_raw() 860 ni_tio_set_bits(counter, NITIO_MODE_REG(counter->counter_index), in ni_tio_set_gate_mode() 892 ni_tio_set_bits(counter, NITIO_GATE2_REG(counter->counter_index), in ni_tio_set_gate2_mode() 1035 ni_tio_set_gate_raw(counter, src); in ni_tio_set_gate_src_raw() 1775 struct ni_gpct *counter; in ni_gpct_device_construct() local [all …]
|
| /linux-6.15/security/landlock/ |
| H A D | id.c | 48 init_id(&counter, 0); in test_init_min() 65 init_id(&counter, 0); in test_init_once() 124 atomic64_t counter; in test_range1_rand0() local 137 atomic64_t counter; in test_range1_rand1() local 150 atomic64_t counter; in test_range1_rand15() local 163 atomic64_t counter; in test_range1_rand16() local 176 atomic64_t counter; in test_range2_rand0() local 189 atomic64_t counter; in test_range2_rand1() local 202 atomic64_t counter; in test_range2_rand2() local 215 atomic64_t counter; in test_range2_rand15() local [all …]
|
| /linux-6.15/tools/testing/selftests/net/netfilter/ |
| H A D | nft_meta.sh | 30 counter iifcount {} 31 counter iifnamecount {} 32 counter iifgroupcount {} 33 counter iiftypecount {} 36 counter imarkcounter {} 37 counter icpu0counter {} 41 counter oifcount {} 42 counter oifnamecount {} 44 counter oiftypecount {} 68 meta oif lo counter name "oifcount" counter [all …]
|
| /linux-6.15/drivers/infiniband/core/ |
| H A D | counters.c | 100 if (qp->counter) in __rdma_counter_bind_qp() 158 if (!counter) in alloc_and_bind() 167 counter->stats = dev->ops.counter_alloc_stats(counter); in alloc_and_bind() 252 struct rdma_counter *counter = qp->counter; in __rdma_counter_unbind_qp() local 311 if (counter && !kref_get_unless_zero(&counter->kref)) in rdma_get_counter_auto_mode() 324 counter->device->ops.counter_dealloc(counter); in counter_release() 350 if (counter) { in rdma_counter_bind_qp_auto() 359 if (!counter) in rdma_counter_bind_qp_auto() 373 struct rdma_counter *counter = qp->counter; in rdma_counter_unbind_qp() local 376 if (!counter) in rdma_counter_unbind_qp() [all …]
|
| /linux-6.15/drivers/net/ethernet/mellanox/mlx5/core/ |
| H A D | fs_counters.c | 156 kfree(counter); in mlx5_fc_free() 228 counter = kzalloc(sizeof(*counter), GFP_KERNEL); in mlx5_fc_single_alloc() 229 if (!counter) in mlx5_fc_single_alloc() 238 return counter; in mlx5_fc_single_alloc() 270 counter->lastbytes = counter->cache.bytes; in mlx5_fc_create() 271 counter->lastpackets = counter->cache.packets; in mlx5_fc_create() 278 return counter; in mlx5_fc_create() 296 if (!counter) in mlx5_fc_destroy() 552 counter = kzalloc(sizeof(*counter), GFP_KERNEL); in mlx5_fc_local_create() 553 if (!counter) in mlx5_fc_local_create() [all …]
|
| /linux-6.15/include/linux/ |
| H A D | page_counter.h | 60 counter->max = PAGE_COUNTER_MAX; in page_counter_init() 61 counter->parent = parent; in page_counter_init() 62 counter->protection_support = protection_support; in page_counter_init() 63 counter->track_failcnt = false; in page_counter_init() 68 return atomic_long_read(&counter->usage); in page_counter_read() 83 WRITE_ONCE(counter->high, nr_pages); in page_counter_set_high() 92 unsigned long usage = page_counter_read(counter); in page_counter_reset_watermark() 98 counter->local_watermark = usage; in page_counter_reset_watermark() 99 counter->watermark = usage; in page_counter_reset_watermark() 104 struct page_counter *counter, [all …]
|
| H A D | counter.h | 158 int (*action_read)(struct counter_device *counter, 163 int (*count_u8_read)(struct counter_device *counter, 165 int (*signal_u8_read)(struct counter_device *counter, 192 int (*action_write)(struct counter_device *counter, 326 int (*signal_read)(struct counter_device *counter, 329 int (*count_read)(struct counter_device *counter, 331 int (*count_write)(struct counter_device *counter, 333 int (*function_read)(struct counter_device *counter, 339 int (*action_read)(struct counter_device *counter, 343 int (*action_write)(struct counter_device *counter, [all …]
|
| /linux-6.15/arch/arm/include/asm/ |
| H A D | atomic.h | 134 prefetchw(&v->counter); in arch_atomic_fetch_add_unless() 180 val = v->counter; \ 193 val = v->counter; \ 216 ret = v->counter; in arch_atomic_cmpxchg() 218 v->counter = new; in arch_atomic_cmpxchg() 254 s64 counter; member 267 : "r" (&v->counter), "Qo" (v->counter) in arch_atomic64_read() 277 : "=Qo" (v->counter) in arch_atomic64_set() 289 : "r" (&v->counter), "Qo" (v->counter) in arch_atomic64_read() 299 prefetchw(&v->counter); in arch_atomic64_set() [all …]
|
| /linux-6.15/mm/ |
| H A D | page_counter.c | 65 if (track_protection(counter)) in page_counter_cancel() 81 for (c = counter; c; c = c->parent) { in page_counter_charge() 183 for (c = counter; c; c = c->parent) in page_counter_uncharge() 224 counter->max = old; in page_counter_set_max() 240 WRITE_ONCE(counter->min, nr_pages); in page_counter_set_min() 242 for (c = counter; c; c = c->parent) in page_counter_set_min() 438 if (root == counter) in page_counter_calculate_protection() 446 counter->emin = READ_ONCE(counter->min); in page_counter_calculate_protection() 447 counter->elow = READ_ONCE(counter->low); in page_counter_calculate_protection() 454 READ_ONCE(counter->min), in page_counter_calculate_protection() [all …]
|
| /linux-6.15/arch/s390/include/asm/ |
| H A D | atomic.h | 20 return __atomic_read(&v->counter); in arch_atomic_read() 26 __atomic_set(&v->counter, i); in arch_atomic_set() 38 return __atomic_add_barrier(i, &v->counter); in arch_atomic_fetch_add() 44 __atomic_add(i, &v->counter); in arch_atomic_add() 50 __atomic_add_const(1, &v->counter); in arch_atomic_inc() 56 __atomic_add_const(-1, &v->counter); in arch_atomic_dec() 85 __atomic_##op(i, &v->counter); \ 107 return arch_xchg(&v->counter, new); in ATOMIC_OPS() 133 __atomic64_set((long *)&v->counter, i); in arch_atomic64_set() 151 __atomic64_add(i, (long *)&v->counter); in arch_atomic64_add() [all …]
|
| /linux-6.15/arch/x86/kernel/cpu/ |
| H A D | perfctr-watchdog.c | 110 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() 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 142 if (counter > NMI_MAX_COUNTER_BITS) in reserve_evntsel_nmi() 153 unsigned int counter; in release_evntsel_nmi() local [all …]
|
| /linux-6.15/arch/powerpc/include/asm/ |
| H A D | atomic.h | 44 __asm__ __volatile__("stw %1,0(%2)" : "=m"(v->counter) : "r"(i), "b"(&v->counter)); in arch_atomic_set() 182 : "r" (&v->counter) in arch_atomic_dec_if_positive() 210 __asm__ __volatile__("std %1,0(%2)" : "=m"(v->counter) : "r"(i), "b"(&v->counter)); in arch_atomic64_set() 307 : "=&r" (t), "+m" (v->counter) in ATOMIC64_OPS() 308 : "r" (&v->counter) in ATOMIC64_OPS() 322 : "=&r" (t), "+m" (v->counter) in arch_atomic64_inc_return_relaxed() 323 : "r" (&v->counter) in arch_atomic64_inc_return_relaxed() 339 : "r" (&v->counter) in arch_atomic64_dec() 354 : "r" (&v->counter) in arch_atomic64_dec_return_relaxed() 381 : "r" (&v->counter) in arch_atomic64_dec_if_positive() [all …]
|
| /linux-6.15/arch/arm64/include/asm/ |
| H A D | arm_dsu_pmu.h | 53 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() 67 __dsu_pmu_select_counter(counter); in __dsu_pmu_write_counter() 74 __dsu_pmu_select_counter(counter); in __dsu_pmu_set_event() 92 write_sysreg_s(BIT(counter), CLUSTERPMCNTENCLR_EL1); in __dsu_pmu_disable_counter() 96 static inline void __dsu_pmu_enable_counter(int counter) in __dsu_pmu_enable_counter() argument 98 write_sysreg_s(BIT(counter), CLUSTERPMCNTENSET_EL1); in __dsu_pmu_enable_counter() 104 write_sysreg_s(BIT(counter), CLUSTERPMINTENSET_EL1); in __dsu_pmu_counter_interrupt_enable() [all …]
|
| /linux-6.15/arch/x86/include/asm/ |
| H A D | atomic64_64.h | 15 return __READ_ONCE((v)->counter); in arch_atomic64_read() 20 __WRITE_ONCE(v->counter, i); in arch_atomic64_set() 26 : "=m" (v->counter) in arch_atomic64_add() 33 : "=m" (v->counter) in arch_atomic64_sub() 46 : "=m" (v->counter) in arch_atomic64_inc() 54 : "=m" (v->counter) in arch_atomic64_dec() 79 return i + xadd(&v->counter, i); in arch_atomic64_add_return() 87 return xadd(&v->counter, i); in arch_atomic64_fetch_add() 114 : "+m" (v->counter) in arch_atomic64_and() 132 : "+m" (v->counter) in arch_atomic64_or() [all …]
|
| /linux-6.15/tools/testing/selftests/kvm/riscv/ |
| H A D | sbi_pmu_test.c | 260 unsigned long counter; in test_pmu_event() local 265 counter_value_pre = read_counter(counter, ctrinfo_arr[counter]); in test_pmu_event() 270 stop_counter(counter, 0); in test_pmu_event() 272 counter_value_post = read_counter(counter, ctrinfo_arr[counter]); in test_pmu_event() 283 stop_counter(counter, 0); in test_pmu_event() 284 counter_value_pre = read_counter(counter, ctrinfo_arr[counter]); in test_pmu_event() 288 counter_value_post = read_counter(counter, ctrinfo_arr[counter]); in test_pmu_event() 298 counter_value_post = read_counter(counter, ctrinfo_arr[counter]); in test_pmu_event() 308 unsigned long counter; in test_pmu_event_snapshot() local 314 counter_value_pre = read_counter(counter, ctrinfo_arr[counter]); in test_pmu_event_snapshot() [all …]
|