Home
last modified time | relevance | path

Searched refs:val (Results 1 – 25 of 296) sorted by relevance

12345678910>>...12

/tools/include/linux/
Dhash.h16 #define hash_long(val, bits) hash_32(val, bits) argument
18 #define hash_long(val, bits) hash_64(val, bits) argument
60 static inline u32 __hash_32_generic(u32 val) in __hash_32_generic() argument
62 return val * GOLDEN_RATIO_32; in __hash_32_generic()
68 static inline u32 hash_32_generic(u32 val, unsigned int bits) in hash_32_generic() argument
71 return __hash_32(val) >> (32 - bits); in hash_32_generic()
77 static __always_inline u32 hash_64_generic(u64 val, unsigned int bits) in hash_64_generic() argument
81 return val * GOLDEN_RATIO_64 >> (64 - bits); in hash_64_generic()
84 return hash_32((u32)val ^ __hash_32(val >> 32), bits); in hash_64_generic()
96 unsigned long val = (unsigned long)ptr; in hash32_ptr() local
[all …]
Drefcount.h78 unsigned int old, new, val = atomic_read(&r->refs); in refcount_inc_not_zero() local
81 new = val + 1; in refcount_inc_not_zero()
83 if (!val) in refcount_inc_not_zero()
89 old = atomic_cmpxchg_relaxed(&r->refs, val, new); in refcount_inc_not_zero()
90 if (old == val) in refcount_inc_not_zero()
93 val = old; in refcount_inc_not_zero()
123 unsigned int old, new, val = atomic_read(&r->refs); in refcount_sub_and_test() local
126 if (unlikely(val == UINT_MAX)) in refcount_sub_and_test()
129 new = val - i; in refcount_sub_and_test()
130 if (new > val) { in refcount_sub_and_test()
[all …]
/tools/include/tools/
Dbe_byteshift.h23 static inline void __put_unaligned_be16(uint16_t val, uint8_t *p) in __put_unaligned_be16() argument
25 *p++ = val >> 8; in __put_unaligned_be16()
26 *p++ = val; in __put_unaligned_be16()
29 static inline void __put_unaligned_be32(uint32_t val, uint8_t *p) in __put_unaligned_be32() argument
31 __put_unaligned_be16(val >> 16, p); in __put_unaligned_be32()
32 __put_unaligned_be16(val, p + 2); in __put_unaligned_be32()
35 static inline void __put_unaligned_be64(uint64_t val, uint8_t *p) in __put_unaligned_be64() argument
37 __put_unaligned_be32(val >> 32, p); in __put_unaligned_be64()
38 __put_unaligned_be32(val, p + 4); in __put_unaligned_be64()
56 static inline void put_unaligned_be16(uint16_t val, void *p) in put_unaligned_be16() argument
[all …]
Dle_byteshift.h23 static inline void __put_unaligned_le16(uint16_t val, uint8_t *p) in __put_unaligned_le16() argument
25 *p++ = val; in __put_unaligned_le16()
26 *p++ = val >> 8; in __put_unaligned_le16()
29 static inline void __put_unaligned_le32(uint32_t val, uint8_t *p) in __put_unaligned_le32() argument
31 __put_unaligned_le16(val >> 16, p + 2); in __put_unaligned_le32()
32 __put_unaligned_le16(val, p); in __put_unaligned_le32()
35 static inline void __put_unaligned_le64(uint64_t val, uint8_t *p) in __put_unaligned_le64() argument
37 __put_unaligned_le32(val >> 32, p + 4); in __put_unaligned_le64()
38 __put_unaligned_le32(val, p); in __put_unaligned_le64()
56 static inline void put_unaligned_le16(uint16_t val, void *p) in put_unaligned_le16() argument
[all …]
/tools/lib/traceevent/plugins/
Dplugin_sched_switch.c27 static void write_state(struct trace_seq *s, int val) in write_state() argument
34 if (!(val & (1 << i))) in write_state()
73 unsigned long long val; in sched_wakeup_handler() local
75 if (tep_get_field_val(s, event, "pid", record, &val, 1)) in sched_wakeup_handler()
80 write_and_save_comm(field, record, s, val); in sched_wakeup_handler()
83 trace_seq_printf(s, "%lld", val); in sched_wakeup_handler()
85 if (tep_get_field_val(s, event, "prio", record, &val, 0) == 0) in sched_wakeup_handler()
86 trace_seq_printf(s, " [%lld]", val); in sched_wakeup_handler()
88 if (tep_get_field_val(s, event, "success", record, &val, 1) == 0) in sched_wakeup_handler()
89 trace_seq_printf(s, " success=%lld", val); in sched_wakeup_handler()
[all …]
/tools/power/cpupower/utils/helpers/
Dmsr.c27 int read_msr(int cpu, unsigned int idx, unsigned long long *val) in read_msr() argument
38 if (read(fd, val, sizeof *val) != sizeof *val) in read_msr()
56 int write_msr(int cpu, unsigned int idx, unsigned long long val) in write_msr() argument
67 if (write(fd, &val, sizeof val) != sizeof val) in write_msr()
78 unsigned long long val; in msr_intel_get_perf_bias() local
84 ret = read_msr(cpu, MSR_IA32_ENERGY_PERF_BIAS, &val); in msr_intel_get_perf_bias()
87 return val; in msr_intel_get_perf_bias()
90 int msr_intel_set_perf_bias(unsigned int cpu, unsigned int val) in msr_intel_set_perf_bias() argument
97 ret = write_msr(cpu, MSR_IA32_ENERGY_PERF_BIAS, val); in msr_intel_set_perf_bias()
105 unsigned long long val; in msr_intel_get_turbo_ratio() local
[all …]
Damd.c39 unsigned long long val; member
47 t = pstate.val & 0xf; in get_did()
93 unsigned long long val; in decode_pstates() local
102 if (read_msr(cpu, MSR_AMD_PSTATE_LIMIT, &val)) in decode_pstates()
105 psmax = (val >> 4) & 0x7; in decode_pstates()
107 if (read_msr(cpu, MSR_AMD_PSTATE_STATUS, &val)) in decode_pstates()
110 pscur = val & 0x7; in decode_pstates()
120 if (read_msr(cpu, MSR_AMD_PSTATE + i, &pstate.val)) in decode_pstates()
137 uint8_t val = 0; in amd_pci_get_num_boost_states() local
146 val = pci_read_byte(device, 0x15c); in amd_pci_get_num_boost_states()
[all …]
/tools/include/uapi/linux/
Dlirc.h24 #define LIRC_SPACE(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_SPACE) argument
25 #define LIRC_PULSE(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_PULSE) argument
26 #define LIRC_FREQUENCY(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_FREQUENCY) argument
27 #define LIRC_TIMEOUT(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_TIMEOUT) argument
29 #define LIRC_VALUE(val) ((val)&LIRC_VALUE_MASK) argument
30 #define LIRC_MODE2(val) ((val)&LIRC_MODE2_MASK) argument
32 #define LIRC_IS_SPACE(val) (LIRC_MODE2(val) == LIRC_MODE2_SPACE) argument
33 #define LIRC_IS_PULSE(val) (LIRC_MODE2(val) == LIRC_MODE2_PULSE) argument
34 #define LIRC_IS_FREQUENCY(val) (LIRC_MODE2(val) == LIRC_MODE2_FREQUENCY) argument
35 #define LIRC_IS_TIMEOUT(val) (LIRC_MODE2(val) == LIRC_MODE2_TIMEOUT) argument
/tools/virtio/linux/
Dvirtio_config.h64 static inline u16 virtio16_to_cpu(struct virtio_device *vdev, __virtio16 val) in virtio16_to_cpu() argument
66 return __virtio16_to_cpu(virtio_is_little_endian(vdev), val); in virtio16_to_cpu()
69 static inline __virtio16 cpu_to_virtio16(struct virtio_device *vdev, u16 val) in cpu_to_virtio16() argument
71 return __cpu_to_virtio16(virtio_is_little_endian(vdev), val); in cpu_to_virtio16()
74 static inline u32 virtio32_to_cpu(struct virtio_device *vdev, __virtio32 val) in virtio32_to_cpu() argument
76 return __virtio32_to_cpu(virtio_is_little_endian(vdev), val); in virtio32_to_cpu()
79 static inline __virtio32 cpu_to_virtio32(struct virtio_device *vdev, u32 val) in cpu_to_virtio32() argument
81 return __cpu_to_virtio32(virtio_is_little_endian(vdev), val); in cpu_to_virtio32()
84 static inline u64 virtio64_to_cpu(struct virtio_device *vdev, __virtio64 val) in virtio64_to_cpu() argument
86 return __virtio64_to_cpu(virtio_is_little_endian(vdev), val); in virtio64_to_cpu()
[all …]
/tools/perf/trace/beauty/
Dfcntl.c12 static size_t fcntl__scnprintf_getfd(unsigned long val, char *bf, size_t size, bool show_prefix) in fcntl__scnprintf_getfd() argument
14 return val ? scnprintf(bf, size, "%s", "0") : in fcntl__scnprintf_getfd()
20 return fcntl__scnprintf_getfd(arg->val, bf, size, arg->show_string_prefix); in syscall_arg__scnprintf_fcntl_getfd()
23 static size_t fcntl__scnprintf_getlease(unsigned long val, char *bf, size_t size, bool show_prefix) in fcntl__scnprintf_getlease() argument
28 return strarray__scnprintf(&strarray__fcntl_setlease, bf, size, "%x", show_prefix, val); in fcntl__scnprintf_getlease()
33 return fcntl__scnprintf_getlease(arg->val, bf, size, arg->show_string_prefix); in syscall_arg__scnprintf_fcntl_getlease()
38 if (arg->val == F_GETFL) { in syscall_arg__scnprintf_fcntl_cmd()
42 if (arg->val == F_GETFD) { in syscall_arg__scnprintf_fcntl_cmd()
46 if (arg->val == F_DUPFD_CLOEXEC || arg->val == F_DUPFD) { in syscall_arg__scnprintf_fcntl_cmd()
50 if (arg->val == F_GETOWN) { in syscall_arg__scnprintf_fcntl_cmd()
[all …]
/tools/perf/arch/x86/tests/
Dinsn-x86.c39 int val; in get_op() member
53 struct val_data *val; in get_op() local
58 for (val = vals; val->name; val++) { in get_op()
59 if (!strcmp(val->name, op_str)) in get_op()
60 return val->val; in get_op()
72 int val; in get_branch() member
80 struct val_data *val; in get_branch() local
85 for (val = vals; val->name; val++) { in get_branch()
86 if (!strcmp(val->name, branch_str)) in get_branch()
87 return val->val; in get_branch()
/tools/testing/selftests/powerpc/ptrace/
Dptrace-gpr.h21 int validate_gpr(unsigned long *gpr, unsigned long val) in validate_gpr() argument
26 if (gpr[i] != val) { in validate_gpr()
28 i+14, gpr[i], val); in validate_gpr()
39 int validate_fpr(unsigned long *fpr, unsigned long val) in validate_fpr() argument
44 if (fpr[i] != val) { in validate_fpr()
45 printf("FPR[%d]: %lx Expected: %lx\n", i, fpr[i], val); in validate_fpr()
56 int validate_fpr_float(float *fpr, float val) in validate_fpr_float() argument
61 if (fpr[i] != val) { in validate_fpr_float()
62 printf("FPR[%d]: %f Expected: %f\n", i, fpr[i], val); in validate_fpr_float()
/tools/perf/scripts/python/
Dstat-cpi.py23 def store(time, event, cpu, thread, val, ena, run): argument
29 data[key] = [ val, ena, run]
35 def stat__cycles_k(cpu, thread, time, val, ena, run): argument
36 store(time, "cycles", cpu, thread, val, ena, run);
38 def stat__instructions_k(cpu, thread, time, val, ena, run): argument
39 store(time, "instructions", cpu, thread, val, ena, run);
41 def stat__cycles_u(cpu, thread, time, val, ena, run): argument
42 store(time, "cycles", cpu, thread, val, ena, run);
44 def stat__instructions_u(cpu, thread, time, val, ena, run): argument
45 store(time, "instructions", cpu, thread, val, ena, run);
[all …]
/tools/testing/selftests/bpf/progs/
Dtest_spin_lock.c52 struct hmap_elem zero = {}, *val; in bpf_sping_lock_test() local
59 val = bpf_map_lookup_elem(&hmap, &key); in bpf_sping_lock_test()
60 if (!val) { in bpf_sping_lock_test()
62 val = bpf_map_lookup_elem(&hmap, &key); in bpf_sping_lock_test()
63 if (!val) { in bpf_sping_lock_test()
69 bpf_spin_lock(&val->lock); in bpf_sping_lock_test()
70 if (val->cnt) in bpf_sping_lock_test()
71 val->cnt--; in bpf_sping_lock_test()
73 val->cnt++; in bpf_sping_lock_test()
74 if (val->cnt != 0 && val->cnt != 1) in bpf_sping_lock_test()
[all …]
/tools/testing/selftests/powerpc/dscr/
Ddscr.h51 inline void set_dscr(unsigned long val) in set_dscr() argument
53 asm volatile("mtspr %1,%0" : : "r" (val), "i" (SPRN_DSCR_PRIV)); in set_dscr()
66 inline void set_dscr_usr(unsigned long val) in set_dscr_usr() argument
68 asm volatile("mtspr %1,%0" : : "r" (val), "i" (SPRN_DSCR)); in set_dscr_usr()
76 unsigned long val; in get_default_dscr() local
92 sscanf(buf, "%lx", &val); in get_default_dscr()
94 return val; in get_default_dscr()
97 void set_default_dscr(unsigned long val) in set_default_dscr() argument
109 sprintf(buf, "%lx\n", val); in set_default_dscr()
Ddscr_sysfs_thread_test.c15 static int test_thread_dscr(unsigned long val) in test_thread_dscr() argument
22 if (val != cur_dscr) { in test_thread_dscr()
24 sched_getcpu(), val, cur_dscr); in test_thread_dscr()
28 if (val != cur_dscr_usr) { in test_thread_dscr()
30 sched_getcpu(), val, cur_dscr_usr); in test_thread_dscr()
36 static int check_cpu_dscr_thread(unsigned long val) in check_cpu_dscr_thread() argument
47 if (test_thread_dscr(val)) in check_cpu_dscr_thread()
/tools/power/cpupower/utils/idle_monitor/
Damd_fam14h_idle.c127 uint32_t val; in amd_fam14h_init() local
135 val = pci_read_long(amd_fam14h_pci_dev, pci_offset); in amd_fam14h_init()
136 val |= 1 << enable_bit; in amd_fam14h_init()
137 val = pci_write_long(amd_fam14h_pci_dev, pci_offset, val); in amd_fam14h_init()
142 val = pci_read_long(amd_fam14h_pci_dev, PCI_MONITOR_ENABLE_REG); in amd_fam14h_init()
144 PCI_MONITOR_ENABLE_REG, (unsigned int) val); in amd_fam14h_init()
145 val |= 1 << enable_bit; in amd_fam14h_init()
146 pci_write_long(amd_fam14h_pci_dev, PCI_MONITOR_ENABLE_REG, val); in amd_fam14h_init()
150 (unsigned int) val, cpu); in amd_fam14h_init()
162 uint32_t val; in amd_fam14h_disable() local
[all …]
/tools/testing/radix-tree/linux/
Dpercpu.h2 #define DECLARE_PER_CPU(type, val) extern type val argument
3 #define DEFINE_PER_CPU(type, val) type val argument
8 #define this_cpu_xchg(var, val) uatomic_xchg(&var, val) argument
/tools/power/cpupower/bench/
Dparse.c158 char opt[16], val[32], *line = NULL; in prepare_config() local
178 if (sscanf(line, "%14s = %30s", opt, val) < 2) in prepare_config()
181 dprintf("parsing: %s -> %s\n", opt, val); in prepare_config()
184 sscanf(val, "%li", &config->sleep); in prepare_config()
187 sscanf(val, "%li", &config->load); in prepare_config()
190 sscanf(val, "%li", &config->load_step); in prepare_config()
193 sscanf(val, "%li", &config->sleep_step); in prepare_config()
196 sscanf(val, "%u", &config->cycles); in prepare_config()
199 sscanf(val, "%u", &config->rounds); in prepare_config()
202 sscanf(val, "%u", &config->verbose); in prepare_config()
[all …]
/tools/testing/selftests/powerpc/pmu/ebb/
Dcycles_with_freeze_test.c26 uint64_t mask, val; in ebb_callee() local
30 val = mfspr(SPRN_BESCR); in ebb_callee()
31 if (!(val & BESCR_PMEO)) { in ebb_callee()
39 val = mfspr(SPRN_MMCR0); in ebb_callee()
40 trace_log_reg(ebb_state.trace, SPRN_MMCR0, val); in ebb_callee()
56 uint64_t val; in cycles_with_freeze() local
92 val = mfspr(SPRN_MMCR0); in cycles_with_freeze()
93 if (! (val & MMCR0_FC)) { in cycles_with_freeze()
94 printf("Outside of loop, FC NOT set MMCR0 0x%lx\n", val); in cycles_with_freeze()
Dreg_access_test.c18 uint64_t val, expected; in reg_access() local
24 val = mfspr(SPRN_BESCR); in reg_access()
26 FAIL_IF(val != expected); in reg_access()
30 val = mfspr(SPRN_EBBHR); in reg_access()
32 FAIL_IF(val != expected); in reg_access()
Dpmc56_overflow_test.c21 uint64_t val; in ebb_callee() local
23 val = mfspr(SPRN_BESCR); in ebb_callee()
24 if (!(val & BESCR_PMEO)) { in ebb_callee()
32 val = mfspr(SPRN_PMC5); in ebb_callee()
33 if (val >= COUNTER_OVERFLOW) in ebb_callee()
38 val = mfspr(SPRN_PMC6); in ebb_callee()
39 if (val >= COUNTER_OVERFLOW) in ebb_callee()
Debb.c35 u64 val; in reset_ebb_with_clear_mask() local
39 val = mfspr(SPRN_MMCR0); in reset_ebb_with_clear_mask()
40 mtspr(SPRN_MMCR0, (val & ~mmcr0_clear_mask) | MMCR0_PMAE); in reset_ebb_with_clear_mask()
59 u64 val; in ebb_check_mmcr0() local
61 val = mfspr(SPRN_MMCR0); in ebb_check_mmcr0()
62 if ((val & (MMCR0_FC | MMCR0_PMAO)) == MMCR0_FC) { in ebb_check_mmcr0()
64 printf("Outside of loop, only FC set 0x%llx\n", val); in ebb_check_mmcr0()
102 u64 val; in standard_ebb_callee() local
104 val = mfspr(SPRN_BESCR); in standard_ebb_callee()
105 if (!(val & BESCR_PMEO)) { in standard_ebb_callee()
[all …]
/tools/testing/selftests/futex/include/
Datomic.h22 volatile int val; member
38 return __sync_val_compare_and_swap(&addr->val, oldval, newval); in atomic_cmpxchg()
50 return __sync_add_and_fetch(&addr->val, 1); in atomic_inc()
62 return __sync_sub_and_fetch(&addr->val, 1); in atomic_dec()
75 addr->val = newval; in atomic_set()
Dfutextest.h70 #define futex(uaddr, op, val, timeout, uaddr2, val3, opflags) \ argument
71 syscall(SYS_futex, uaddr, op | opflags, val, timeout, uaddr2, val3)
78 futex_wait(futex_t *uaddr, futex_t val, struct timespec *timeout, int opflags) in futex_wait() argument
80 return futex(uaddr, FUTEX_WAIT, val, timeout, NULL, 0, opflags); in futex_wait()
98 futex_wait_bitset(futex_t *uaddr, futex_t val, struct timespec *timeout, in futex_wait_bitset() argument
101 return futex(uaddr, FUTEX_WAIT_BITSET, val, timeout, NULL, bitset, in futex_wait_bitset()
169 futex_cmp_requeue(futex_t *uaddr, futex_t val, futex_t *uaddr2, int nr_wake, in futex_cmp_requeue() argument
173 val, opflags); in futex_cmp_requeue()
185 futex_wait_requeue_pi(futex_t *uaddr, futex_t val, futex_t *uaddr2, in futex_wait_requeue_pi() argument
188 return futex(uaddr, FUTEX_WAIT_REQUEUE_PI, val, timeout, uaddr2, 0, in futex_wait_requeue_pi()
[all …]

12345678910>>...12