/linux-6.8/drivers/net/ethernet/marvell/prestera/ |
D | prestera_counter.c | 1 // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 40 COUNTER_FLAG_READY = 0, 47 return block->counter_flag[id - block->offset] == COUNTER_FLAG_READY; in prestera_counter_is_ready() 50 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() 62 mutex_lock(&block->mtx); in prestera_counter_block_lock() 67 mutex_unlock(&block->mtx); in prestera_counter_block_unlock() 72 return refcount_inc_not_zero(&block->refcnt); in prestera_counter_block_incref() [all …]
|
/linux-6.8/tools/testing/selftests/netfilter/ |
D | nft_meta.sh | 5 # Kselftest framework requirement - SKIP code is 4. 7 sfx=$(mktemp -u "XXXXXXXX") 8 ns0="ns0-$sfx" 10 if ! nft --version > /dev/null 2>&1; then 21 ip -net "$ns0" link set lo up 22 ip -net "$ns0" addr add 127.0.0.1 dev lo 27 lastyear=$((currentyear-1)) 28 ip netns exec "$ns0" nft -f /dev/stdin <<EOF 30 counter iifcount {} 31 counter iifnamecount {} [all …]
|
/linux-6.8/drivers/comedi/drivers/ |
D | ni_tio.c | 1 // SPDX-License-Identifier: GPL-2.0+ 11 * Author: J.P. Mellor <jpmellor@rose-hulman.edu>, 19 * This module is not used directly by end-users. Rather, it 22 * originally based on the counter code from ni_660x.c and 26 * DAQ 660x Register-Level Programmer Manual (NI 370505A-01) 27 * DAQ 6601/6602 User Manual (NI 322137B-01) 28 * 340934b.pdf DAQ-STC reference manual 42 #define NI_M_TIMEBASE_1_CLK 0x0 /* 20MHz */ 43 #define NI_M_PFI_CLK(x) (((x) < 10) ? (1 + (x)) : (0xb + (x))) 44 #define NI_M_RTSI_CLK(x) (((x) == 7) ? 0x1b : (0xb + (x))) [all …]
|
D | ni_tiocmd.c | 1 // SPDX-License-Identifier: GPL-2.0+ 11 * Author: J.P. Mellor <jpmellor@rose-hulman.edu>, 19 * This module is not used directly by end-users. Rather, it 26 * DAQ 660x Register-Level Programmer Manual (NI 370505A-01) 27 * DAQ 6601/6602 User Manual (NI 322137B-01) 28 * 340934b.pdf DAQ-STC reference manual 38 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() 47 bits = 0; in ni_tio_configure_dma() [all …]
|
D | comedi_8254.c | 1 // SPDX-License-Identifier: GPL-2.0+ 4 * Generic 8254 timer/counter support 9 * COMEDI - Linux Control and Measurement Device Interface 15 * Description: Generic 8254 timer/counter support 20 * This module is not used directly by end-users. Rather, it is used by other 33 * dev->pacer and will be freed by the comedi core during the driver 45 * I8254_MODE1 Hardware retriggerable one-shot 56 * Writes an initial value to a counter. 58 * The largest possible initial count is 0; this is equivalent to 2^16 61 * NOTE: The counter does not stop when it reaches zero. In Mode 0, 1, 4, [all …]
|
/linux-6.8/drivers/counter/ |
D | counter-core.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Generic Counter interface 7 #include <linux/counter.h> 22 #include "counter-chrdev.h" 23 #include "counter-sysfs.h" 25 #define COUNTER_NAME "counter" 27 /* Provides a unique ID for each counter device */ 31 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() [all …]
|
D | counter-chrdev.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Generic Counter character device interface 7 #include <linux/counter.h> 24 #include "counter-chrdev.h" 68 struct counter_device *const counter = filp->private_data; in counter_chrdev_read() local 72 if (!counter->ops) in counter_chrdev_read() 73 return -ENODEV; in counter_chrdev_read() 76 return -EINVAL; in counter_chrdev_read() 79 if (kfifo_is_empty(&counter->events)) { in counter_chrdev_read() 80 if (filp->f_flags & O_NONBLOCK) in counter_chrdev_read() [all …]
|
D | rz-mtu3-cnt.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Renesas RZ/G2L MTU3a Counter driver 9 #include <linux/counter.h> 10 #include <linux/mfd/rz-mtu3.h> 23 * TCNT: Timer Counter 25 * TCNTLW: Timer Longword Counter 36 #define RZ_MTU3_TMDR1_PH_CNT_MODE_MASK (0xf) 40 * 0: 16-bit, 1: 32-bit 42 #define RZ_MTU3_TMDR3_LWA (0) 46 * 0: MTCLKA and MTCLKB, 1: MTCLKC and MTCLKD [all …]
|
D | ti-ecap-capture.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 10 #include <linux/counter.h> 24 #define ECAP_CEVT1 0 37 #define ECAP_TSCNT_REG 0x00 39 #define ECAP_CAP_REG(i) (((i) << 2) + 0x08) 41 #define ECAP_ECCTL_REG 0x28 43 #define ECAP_EV_MODE_MASK GENMASK(7, 0) 55 #define ECAP_ECINT_EN_FLG_REG 0x2c 59 #define ECAP_ECINT_CLR_FRC_REG 0x30 60 #define ECAP_INT_CLR_BIT BIT(0) [all …]
|
D | interrupt-cnt.c | 1 // SPDX-License-Identifier: GPL-2.0 6 #include <linux/counter.h> 15 #define INTERRUPT_CNT_NAME "interrupt-cnt" 29 struct counter_device *counter = dev_id; in interrupt_cnt_isr() local 30 struct interrupt_cnt_priv *priv = counter_priv(counter); in interrupt_cnt_isr() 32 atomic_inc(&priv->count); 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() 44 *enable = priv->enabled; in interrupt_cnt_enable_read() [all …]
|
D | ti-eqep.c | 1 // SPDX-License-Identifier: GPL-2.0-only 5 * Counter driver for Texas Instruments Enhanced Quadrature Encoder Pulse (eQEP) 9 #include <linux/counter.h> 18 /* 32-bit registers */ 19 #define QPOSCNT 0x0 20 #define QPOSINIT 0x4 21 #define QPOSMAX 0x8 22 #define QPOSCMP 0xc 23 #define QPOSILAT 0x10 24 #define QPOSSLAT 0x14 [all …]
|
D | i8254.c | 1 // SPDX-License-Identifier: GPL-2.0 8 #include <linux/counter.h> 21 #define I8254_CONTROL_REG 0x3 30 #define I8254_RW_TWO_BYTE 0x3 31 #define I8254_MODE_INTERRUPT_ON_TERMINAL_COUNT 0 38 #define I8254_COUNTER_LATCH(_counter) I8254_CONTROL(_counter, 0x0, 0x0) 44 * struct i8254 - I8254 device private data structure 46 * @preset: array of Counter Register states 57 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() [all …]
|
D | stm32-timer-cnt.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * STM32 Timer Encoder and Counter driver 10 #include <linux/counter.h> 11 #include <linux/mfd/stm32-timers.h> 18 #define TIM_CCMR_CCXS (BIT(8) | BIT(0)) 46 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() 52 regmap_read(priv->regmap, TIM_CNT, &cnt); in stm32_count_read() 55 return 0; in stm32_count_read() 58 static int stm32_count_write(struct counter_device *counter, in stm32_count_write() argument [all …]
|
D | counter-sysfs.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Generic Counter sysfs interface 6 #include <linux/counter.h> 20 #include "counter-sysfs.h" 28 * struct counter_attribute - Counter sysfs attribute 30 * @l: node to add Counter attribute to attribute group list 31 * @comp: Counter component callbacks and data 32 * @scope: Counter scope of the attribute 48 * struct counter_attribute_group - container for attribute group 62 [COUNTER_FUNCTION_PULSE_DIRECTION] = "pulse-direction", [all …]
|
D | stm32-lptimer-cnt.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * STM32 Low-Power Timer Encoder and Counter driver 9 * Inspired by 104-quad-8 and stm32-timer-trigger drivers. 14 #include <linux/counter.h> 15 #include <linux/mfd/stm32-lptimer.h> 37 ret = regmap_read(priv->regmap, STM32_LPTIM_CR, &val); in stm32_lptim_is_enabled() 51 ret = regmap_write(priv->regmap, STM32_LPTIM_CR, val); in stm32_lptim_set_enable_state() 56 clk_disable(priv->clk); in stm32_lptim_set_enable_state() 57 priv->enabled = false; in stm32_lptim_set_enable_state() 58 return 0; in stm32_lptim_set_enable_state() [all …]
|
D | 104-quad-8.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Counter driver for the ACCES 104-QUAD-8 6 * This driver supports the ACCES 104-QUAD-8 and ACCES 104-QUAD-4. 10 #include <linux/counter.h> 31 module_param_hw_array(base, uint, ioport, &num_quad8, 0); 32 MODULE_PARM_DESC(base, "ACCES 104-QUAD-8 base addresses"); 36 module_param_hw_array(irq, uint, irq, &num_irq, 0); 37 MODULE_PARM_DESC(irq, "ACCES 104-QUAD-8 interrupt line numbers"); 43 #define QUAD8_INTERRUPT_STATUS 0x10 44 #define QUAD8_CHANNEL_OPERATION 0x11 [all …]
|
D | ftm-quaddec.c | 1 // SPDX-License-Identifier: GPL-2.0 15 #include <linux/counter.h> 37 if (ftm->big_endian) in ftm_read() 38 *data = ioread32be(ftm->ftm_base + offset); in ftm_read() 40 *data = ioread32(ftm->ftm_base + offset); in ftm_read() 45 if (ftm->big_endian) in ftm_write() 46 iowrite32be(data, ftm->ftm_base + offset); in ftm_write() 48 iowrite32(data, ftm->ftm_base + offset); in ftm_write() 70 /* Reset hardware counter to CNTIN */ in ftm_reset_counter() 71 ftm_write(ftm, FTM_CNT, 0x0); in ftm_reset_counter() [all …]
|
/linux-6.8/drivers/infiniband/core/ |
D | counters.c | 1 // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB 19 return -EINVAL; in __counter_set_mode() 20 if (port_counter->num_counters) in __counter_set_mode() 21 return -EBUSY; in __counter_set_mode() 24 port_counter->mode.mode = new_mode; in __counter_set_mode() 25 port_counter->mode.mask = new_mask; in __counter_set_mode() 26 return 0; in __counter_set_mode() 30 * rdma_counter_set_auto_mode() - Turn on/off per-port auto mode 37 * Return 0 on success. If counter mode wasn't changed then it is considered 39 * Return -EBUSY when changing to auto mode while there are bounded counters. [all …]
|
/linux-6.8/arch/arm/include/asm/ |
D | atomic.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 25 #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); \ 44 "1: ldrex %0, [%3]\n" \ 45 " " #asm_op " %0, %0, %4\n" \ 46 " strex %1, %0, [%3]\n" \ 47 " teq %1, #0\n" \ 49 : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) \ 50 : "r" (&v->counter), "Ir" (i) \ [all …]
|
/linux-6.8/mm/ |
D | page_counter.c | 1 // SPDX-License-Identifier: GPL-2.0 22 if (!c->parent) in propagate_protected_usage() 25 protected = min(usage, READ_ONCE(c->min)); in propagate_protected_usage() 26 old_protected = atomic_long_read(&c->min_usage); in propagate_protected_usage() 28 old_protected = atomic_long_xchg(&c->min_usage, protected); in propagate_protected_usage() 29 delta = protected - old_protected; in propagate_protected_usage() 31 atomic_long_add(delta, &c->parent->children_min_usage); in propagate_protected_usage() 34 protected = min(usage, READ_ONCE(c->low)); in propagate_protected_usage() 35 old_protected = atomic_long_read(&c->low_usage); in propagate_protected_usage() 37 old_protected = atomic_long_xchg(&c->low_usage, protected); in propagate_protected_usage() [all …]
|
/linux-6.8/drivers/net/ethernet/mellanox/mlx5/core/ |
D | fs_counters.c | 14 * - Redistributions of source code must retain the above 18 * - Redistributions in binary form must reproduce the above 83 * dump (access to struct mlx5_fc) after a counter is destroyed. 85 * access to counter list: 86 * - create (user context) 87 * - mlx5_fc_create() only adds to an addlist to be used by 91 * - spawn thread to do the actual destroy 93 * - destroy (user context) 94 * - add a counter to lockless dellist 95 * - spawn thread to do the actual del [all …]
|
/linux-6.8/tools/perf/ |
D | design.txt | 3 ------------------------------ 7 as instructions executed, cachemisses suffered, or branches mis-predicted - 9 trigger interrupts when a threshold number of events have passed - and can 12 The Linux Performance Counter subsystem provides an abstraction of these 13 hardware capabilities. It provides per task and per CPU counters, counter 15 provides "virtual" 64-bit counters, regardless of the width of the 19 There's one file descriptor per virtual counter used. 29 VFS system calls: read() can be used to read the counter, fcntl() 35 When creating a new counter fd, 'perf_event_attr' is: 40 * specific (raw) counter configuration data, if unset, the next [all …]
|
/linux-6.8/arch/arm/kernel/ |
D | perf_event_v6.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * ARMv6 Performance counter handling code. 7 * ARMv6 has 2 configurable performance counters and a single cycle counter. 16 * the event bus. The procedure for disabling a configurable counter is: 17 * - change the counter to count the ETMEXTOUT[0] signal (0x20). This 18 * effectively stops the counter from counting. 19 * - disable the counter's interrupt generation (each counter has it's 21 * Once stopped, the counter value can be written as 0 to reset. 23 * To enable a counter: 24 * - enable the counter's interrupt generation. [all …]
|
/linux-6.8/Documentation/driver-api/ |
D | generic-counter.rst | 1 .. SPDX-License-Identifier: GPL-2.0 4 Generic Counter Interface 10 Counter devices are prevalent among a diverse spectrum of industries. 13 resolve the issue of duplicate code found among existing counter device 14 drivers by introducing a generic counter interface for consumption. The 15 Generic Counter interface enables drivers to support and expose a common 16 set of components and functionality present in counter devices. 21 Counter devices can vary greatly in design, but regardless of whether 23 counter devices consist of a core set of components. This core set of 24 components, shared by all counter devices, is what forms the essence of [all …]
|
/linux-6.8/tools/perf/pmu-events/arch/x86/graniterapids/ |
D | pipeline.json | 4 "EventCode": "0xc4", 12 "EventCode": "0xc5", 21 …counter. This event can approximate elapsed time while the core was not in a halt state. It is cou… 23 "UMask": "0x3" 27 "EventCode": "0x3c", 29 …counter. This event can approximate elapsed time while the core was not in a halt state. It is cou… 31 "UMask": "0x1" 36 …e the core was not in the halt state. It is counted on a dedicated fixed counter, leaving the eigh… 38 "UMask": "0x2" 42 "EventCode": "0x3c", [all …]
|