/tools/include/tools/ |
D | be_byteshift.h | 7 static inline uint16_t __get_unaligned_be16(const uint8_t *p) in __get_unaligned_be16() argument 9 return p[0] << 8 | p[1]; in __get_unaligned_be16() 12 static inline uint32_t __get_unaligned_be32(const uint8_t *p) in __get_unaligned_be32() argument 14 return p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3]; in __get_unaligned_be32() 17 static inline uint64_t __get_unaligned_be64(const uint8_t *p) in __get_unaligned_be64() argument 19 return (uint64_t)__get_unaligned_be32(p) << 32 | in __get_unaligned_be64() 20 __get_unaligned_be32(p + 4); in __get_unaligned_be64() 23 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() [all …]
|
D | le_byteshift.h | 7 static inline uint16_t __get_unaligned_le16(const uint8_t *p) in __get_unaligned_le16() argument 9 return p[0] | p[1] << 8; in __get_unaligned_le16() 12 static inline uint32_t __get_unaligned_le32(const uint8_t *p) in __get_unaligned_le32() argument 14 return p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24; in __get_unaligned_le32() 17 static inline uint64_t __get_unaligned_le64(const uint8_t *p) in __get_unaligned_le64() argument 19 return (uint64_t)__get_unaligned_le32(p + 4) << 32 | in __get_unaligned_le64() 20 __get_unaligned_le32(p); in __get_unaligned_le64() 23 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() [all …]
|
/tools/testing/selftests/proc/ |
D | proc-uptime.h | 28 char buf[64], *p; in proc_uptime() local 37 p = buf; in proc_uptime() 39 val1 = xstrtoull(p, &p); in proc_uptime() 40 assert(p[0] == '.'); in proc_uptime() 41 assert('0' <= p[1] && p[1] <= '9'); in proc_uptime() 42 assert('0' <= p[2] && p[2] <= '9'); in proc_uptime() 43 assert(p[3] == ' '); in proc_uptime() 45 val2 = (p[1] - '0') * 10 + p[2] - '0'; in proc_uptime() 48 p += 4; in proc_uptime() 50 val1 = xstrtoull(p, &p); in proc_uptime() [all …]
|
/tools/testing/selftests/vm/ |
D | khugepaged.c | 443 void *p; in alloc_mapping() local 445 p = mmap(BASE_ADDR, hpage_pmd_size, PROT_READ | PROT_WRITE, in alloc_mapping() 447 if (p != BASE_ADDR) { in alloc_mapping() 452 return p; in alloc_mapping() 455 static void fill_memory(int *p, unsigned long start, unsigned long end) in fill_memory() argument 460 p[i * page_size / sizeof(*p)] = i + 0xdead0000; in fill_memory() 463 static void validate_memory(int *p, unsigned long start, unsigned long end) in validate_memory() argument 468 if (p[i * page_size / sizeof(*p)] != i + 0xdead0000) { in validate_memory() 470 i, p[i * page_size / sizeof(*p)]); in validate_memory() 477 static bool wait_for_scan(const char *msg, char *p) in wait_for_scan() argument [all …]
|
D | map_fixed_noreplace.c | 51 char *p; in main() local 69 p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0); in main() 71 printf("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); in main() 73 if (p == MAP_FAILED) { in main() 90 p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0); in main() 91 printf("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); in main() 93 if (p == MAP_FAILED) { in main() 110 p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0); in main() 111 printf("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); in main() 113 if (p != MAP_FAILED) { in main() [all …]
|
D | mlock-random-test.c | 138 int test_mlock_within_limit(char *p, int alloc_size) in test_mlock_within_limit() argument 166 ret = mlock(p + start_offset, lock_size); in test_mlock_within_limit() 168 ret = mlock2_(p + start_offset, lock_size, in test_mlock_within_limit() 174 p, alloc_size, in test_mlock_within_limit() 175 p + start_offset, lock_size); in test_mlock_within_limit() 184 page_size = get_proc_page_size((unsigned long)p); in test_mlock_within_limit() 215 int test_mlock_outof_limit(char *p, int alloc_size) in test_mlock_outof_limit() argument 238 ret = mlock(p + start_offset, lock_size); in test_mlock_outof_limit() 240 ret = mlock2_(p + start_offset, lock_size, in test_mlock_outof_limit() 245 p, alloc_size, in test_mlock_outof_limit() [all …]
|
/tools/perf/ui/ |
D | progress.c | 5 static void null_progress__update(struct ui_progress *p __maybe_unused) in null_progress__update() 16 void ui_progress__update(struct ui_progress *p, u64 adv) in ui_progress__update() argument 18 u64 last = p->curr; in ui_progress__update() 20 p->curr += adv; in ui_progress__update() 22 if (p->curr >= p->next) { in ui_progress__update() 23 u64 nr = DIV_ROUND_UP(p->curr - last, p->step); in ui_progress__update() 25 p->next += nr * p->step; in ui_progress__update() 26 ui_progress__ops->update(p); in ui_progress__update() 30 void __ui_progress__init(struct ui_progress *p, u64 total, in __ui_progress__init() argument 33 p->curr = 0; in __ui_progress__init() [all …]
|
/tools/testing/selftests/powerpc/cache_shape/ |
D | cache_shape.c | 54 ElfW(auxv_t) *p; in test_cache_shape() 61 p = find_auxv_entry(AT_L1I_CACHESIZE, buffer); in test_cache_shape() 62 if (p) { in test_cache_shape() 64 print_size("L1I ", (uint32_t)p->a_un.a_val); in test_cache_shape() 67 p = find_auxv_entry(AT_L1I_CACHEGEOMETRY, buffer); in test_cache_shape() 68 if (p) { in test_cache_shape() 70 print_geo("L1I ", (uint32_t)p->a_un.a_val); in test_cache_shape() 73 p = find_auxv_entry(AT_L1D_CACHESIZE, buffer); in test_cache_shape() 74 if (p) { in test_cache_shape() 76 print_size("L1D ", (uint32_t)p->a_un.a_val); in test_cache_shape() [all …]
|
/tools/lib/traceevent/plugins/ |
D | plugin_scsi.c | 157 scsi_trace_rw6(struct trace_seq *p, unsigned char *cdb, int len) in scsi_trace_rw6() argument 159 const char *ret = p->buffer + p->len; in scsi_trace_rw6() 167 trace_seq_printf(p, "lba=%llu txlen=%llu", in scsi_trace_rw6() 169 trace_seq_putc(p, 0); in scsi_trace_rw6() 174 scsi_trace_rw10(struct trace_seq *p, unsigned char *cdb, int len) in scsi_trace_rw10() argument 176 const char *ret = p->buffer + p->len; in scsi_trace_rw10() 186 trace_seq_printf(p, "lba=%llu txlen=%llu protect=%u", in scsi_trace_rw10() 191 trace_seq_printf(p, " unmap=%u", cdb[1] >> 3 & 1); in scsi_trace_rw10() 193 trace_seq_putc(p, 0); in scsi_trace_rw10() 198 scsi_trace_rw12(struct trace_seq *p, unsigned char *cdb, int len) in scsi_trace_rw12() argument [all …]
|
/tools/testing/radix-tree/ |
D | regression1.c | 57 struct page *p; in page_alloc() local 58 p = malloc(sizeof(struct page)); in page_alloc() 59 p->count = 1; in page_alloc() 60 p->index = index; in page_alloc() 61 pthread_mutex_init(&p->lock, NULL); in page_alloc() 63 return p; in page_alloc() 68 struct page *p = container_of(rcu, struct page, rcu); in page_rcu_free() local 69 assert(!p->count); in page_rcu_free() 70 pthread_mutex_destroy(&p->lock); in page_rcu_free() 71 free(p); in page_rcu_free() [all …]
|
/tools/arch/arm64/include/asm/ |
D | barrier.h | 27 #define smp_store_release(p, v) \ argument 29 union { typeof(*p) __val; char __c[1]; } __u = \ 32 switch (sizeof(*p)) { \ 35 : "=Q" (*p) \ 41 : "=Q" (*p) \ 47 : "=Q" (*p) \ 53 : "=Q" (*p) \ 64 #define smp_load_acquire(p) \ argument 66 union { typeof(*p) __val; char __c[1]; } __u = \ 69 switch (sizeof(*p)) { \ [all …]
|
/tools/io_uring/ |
D | setup.c | 10 static int io_uring_mmap(int fd, struct io_uring_params *p, in io_uring_mmap() argument 17 sq->ring_sz = p->sq_off.array + p->sq_entries * sizeof(unsigned); in io_uring_mmap() 22 sq->khead = ptr + p->sq_off.head; in io_uring_mmap() 23 sq->ktail = ptr + p->sq_off.tail; in io_uring_mmap() 24 sq->kring_mask = ptr + p->sq_off.ring_mask; in io_uring_mmap() 25 sq->kring_entries = ptr + p->sq_off.ring_entries; in io_uring_mmap() 26 sq->kflags = ptr + p->sq_off.flags; in io_uring_mmap() 27 sq->kdropped = ptr + p->sq_off.dropped; in io_uring_mmap() 28 sq->array = ptr + p->sq_off.array; in io_uring_mmap() 30 size = p->sq_entries * sizeof(struct io_uring_sqe); in io_uring_mmap() [all …]
|
/tools/perf/bench/ |
D | numa.c | 47 #define tprintf(x...) do { if (g && g->p.show_details >= 0) printf(x); } while (0) 53 #define dprintf(x...) do { if (g && g->p.show_details >= 1) printf(x); } while (0) 159 struct params p; member 230 for (i = 0; i < g->p.nr_nodes; i++) { in nr_numa_nodes() 282 for (cpu = 0; cpu < g->p.nr_cpus; cpu++) in bind_to_cpu() 285 BUG_ON(target_cpu < 0 || target_cpu >= g->p.nr_cpus); in bind_to_cpu() 307 for (cpu = 0; cpu < g->p.nr_cpus; cpu++) in bind_to_node() 340 ret = set_mempolicy(MPOL_DEFAULT, NULL, g->p.nr_nodes-1); in mempol_restore() 353 BUG_ON(g->p.nr_nodes > (int)sizeof(nodemask)*8); in bind_to_memnode() 455 return alloc_data(bytes, MAP_SHARED, 1, g->p.init_cpu0, g->p.thp, g->p.init_random); in zalloc_shared_data() [all …]
|
/tools/include/asm-generic/bitops/ |
D | non-atomic.h | 19 unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); in __set_bit() local 21 *p |= mask; in __set_bit() 27 unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); in __clear_bit() local 29 *p &= ~mask; in __clear_bit() 44 unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); in __change_bit() local 46 *p ^= mask; in __change_bit() 61 unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); in __test_and_set_bit() local 62 unsigned long old = *p; in __test_and_set_bit() 64 *p = old | mask; in __test_and_set_bit() 80 unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); in __test_and_clear_bit() local [all …]
|
/tools/virtio/linux/ |
D | kernel.h | 42 #define virt_to_phys(p) ((unsigned long)p) argument 45 #define page_to_phys(p) ((dma_addr_t)(unsigned long)(p)) argument 46 #define virt_to_page(p) ((struct page *)((unsigned long)p & PAGE_MASK)) argument 48 #define offset_in_page(p) (((unsigned long)p) % PAGE_SIZE) argument 68 void *p = kmalloc(s, gfp); in kzalloc() local 70 memset(p, 0, s); in kzalloc() 71 return p; in kzalloc() 79 static inline void kfree(void *p) in kfree() argument 81 if (p >= __kfree_ignore_start && p < __kfree_ignore_end) in kfree() 83 free(p); in kfree() [all …]
|
/tools/perf/ui/tui/ |
D | progress.c | 10 static void __tui_progress__init(struct ui_progress *p) in __tui_progress__init() argument 12 p->next = p->step = p->total / (SLtt_Screen_Cols - 2) ?: 1; in __tui_progress__init() 15 static int get_title(struct ui_progress *p, char *buf, size_t size) in get_title() argument 21 ret = unit_number__scnprintf(buf_cur, sizeof(buf_cur), p->curr); in get_title() 22 ret += unit_number__scnprintf(buf_tot, sizeof(buf_tot), p->total); in get_title() 25 p->title, buf_cur, buf_tot); in get_title() 28 static void tui_progress__update(struct ui_progress *p) in tui_progress__update() argument 30 char buf[100], *title = (char *) p->title; in tui_progress__update() 39 if (p->total == 0) in tui_progress__update() 42 if (p->size) { in tui_progress__update() [all …]
|
/tools/include/linux/unaligned/ |
D | packed_struct.h | 11 static inline u16 __get_unaligned_cpu16(const void *p) in __get_unaligned_cpu16() argument 13 const struct __una_u16 *ptr = (const struct __una_u16 *)p; in __get_unaligned_cpu16() 17 static inline u32 __get_unaligned_cpu32(const void *p) in __get_unaligned_cpu32() argument 19 const struct __una_u32 *ptr = (const struct __una_u32 *)p; in __get_unaligned_cpu32() 23 static inline u64 __get_unaligned_cpu64(const void *p) in __get_unaligned_cpu64() argument 25 const struct __una_u64 *ptr = (const struct __una_u64 *)p; in __get_unaligned_cpu64() 29 static inline void __put_unaligned_cpu16(u16 val, void *p) in __put_unaligned_cpu16() argument 31 struct __una_u16 *ptr = (struct __una_u16 *)p; in __put_unaligned_cpu16() 35 static inline void __put_unaligned_cpu32(u32 val, void *p) in __put_unaligned_cpu32() argument 37 struct __una_u32 *ptr = (struct __una_u32 *)p; in __put_unaligned_cpu32() [all …]
|
/tools/usb/usbip/libsrc/ |
D | names.c | 96 struct product *p; in names_product() local 98 p = products[hashnum((vendorid << 16) | productid)]; in names_product() 99 for (; p; p = p->next) in names_product() 100 if (p->vendorid == vendorid && p->productid == productid) in names_product() 101 return p->name; in names_product() 130 struct protocol *p; in names_protocol() local 132 p = protocols[hashnum((classid << 16) | (subclassid << 8) in names_protocol() 134 for (; p; p = p->next) in names_protocol() 135 if (p->classid == classid && p->subclassid == subclassid && in names_protocol() 136 p->protocolid == protocolid) in names_protocol() [all …]
|
/tools/testing/selftests/powerpc/pmu/ebb/ |
D | trace.c | 38 static bool trace_check_bounds(struct trace_buffer *tb, void *p) in trace_check_bounds() argument 40 return p < ((void *)tb + tb->size); in trace_check_bounds() 43 static bool trace_check_alloc(struct trace_buffer *tb, void *p) in trace_check_alloc() argument 54 if (!trace_check_bounds(tb, p)) { in trace_check_alloc() 64 void *p, *newtail; in trace_alloc() local 66 p = tb->tail; in trace_alloc() 73 return p; in trace_alloc() 90 u64 *p; in trace_log_reg() local 97 p = (u64 *)e->data; in trace_log_reg() 98 *p++ = reg; in trace_log_reg() [all …]
|
/tools/testing/radix-tree/linux/ |
D | rcupdate.h | 7 #define rcu_dereference_raw(p) rcu_dereference(p) argument 8 #define rcu_dereference_protected(p, cond) rcu_dereference(p) argument 9 #define rcu_dereference_check(p, cond) rcu_dereference(p) argument 10 #define RCU_INIT_POINTER(p, v) do { (p) = (v); } while (0) argument
|
/tools/testing/selftests/bpf/progs/ |
D | socket_cookie_prog.c | 25 struct socket_cookie *p; in set_cookie() local 30 p = bpf_sk_storage_get(&socket_cookies, ctx->sk, 0, in set_cookie() 32 if (!p) in set_cookie() 35 p->cookie_value = 0xFF; in set_cookie() 36 p->cookie_key = bpf_get_socket_cookie(ctx); in set_cookie() 45 struct socket_cookie *p; in update_cookie() local 56 p = bpf_sk_storage_get(&socket_cookies, ctx->sk, 0, 0); in update_cookie() 57 if (!p) in update_cookie() 60 if (p->cookie_key != bpf_get_socket_cookie(ctx)) in update_cookie() 63 p->cookie_value = (ctx->local_port << 8) | p->cookie_value; in update_cookie()
|
D | test_rdonly_maps.c | 28 unsigned * volatile p = (void *)&rdonly_values.a; in skip_loop() local 32 while (*p & 1) { in skip_loop() 34 sum += *p; in skip_loop() 35 p++; in skip_loop() 47 unsigned * volatile p = (void *)&rdonly_values.a; in part_loop() local 51 while (*p < 5) { in part_loop() 53 sum += *p; in part_loop() 54 p++; in part_loop() 66 unsigned * volatile p = (void *)&rdonly_values.a; in full_loop() local 73 sum += *p; in full_loop() [all …]
|
/tools/testing/selftests/resctrl/ |
D | fill_buf.c | 44 static void cl_flush(void *p) in cl_flush() argument 48 : : "r"(p) : "memory"); in cl_flush() 52 static void mem_flush(void *p, size_t s) in mem_flush() argument 54 char *cp = (char *)p; in mem_flush() 70 void *p = memalign(PAGE_SIZE, s); in malloc_and_init_memory() local 71 if (!p) in malloc_and_init_memory() 74 p64 = (uint64_t *)p; in malloc_and_init_memory() 83 return p; in malloc_and_init_memory() 88 unsigned char sum, *p; in fill_one_span_read() local 91 p = start_ptr; in fill_one_span_read() [all …]
|
/tools/perf/util/ |
D | rblist.c | 15 struct rb_node **p = &rblist->entries.rb_root.rb_node; in rblist__add_node() local 19 while (*p != NULL) { in rblist__add_node() 22 parent = *p; in rblist__add_node() 26 p = &(*p)->rb_left; in rblist__add_node() 28 p = &(*p)->rb_right; in rblist__add_node() 39 rb_link_node(new_node, parent, p); in rblist__add_node() 57 struct rb_node **p = &rblist->entries.rb_root.rb_node; in __rblist__findnew() local 61 while (*p != NULL) { in __rblist__findnew() 64 parent = *p; in __rblist__findnew() 68 p = &(*p)->rb_left; in __rblist__findnew() [all …]
|
/tools/testing/selftests/net/ |
D | reuseport_bpf.c | 143 struct sock_fprog p = { in attach_cbpf() local 148 if (setsockopt(fd, SOL_SOCKET, SO_ATTACH_REUSEPORT_CBPF, &p, sizeof(p))) in attach_cbpf() 152 static void build_recv_group(const struct test_params p, int fd[], uint16_t mod, in build_recv_group() argument 156 new_any_sockaddr(p.recv_family, p.recv_port); in build_recv_group() 159 for (i = 0; i < p.recv_socks; ++i) { in build_recv_group() 160 fd[i] = socket(p.recv_family, p.protocol, 0); in build_recv_group() 175 if (p.protocol == SOCK_STREAM) { in build_recv_group() 181 if (listen(fd[i], p.recv_socks * 10)) in build_recv_group() 188 static void send_from(struct test_params p, uint16_t sport, char *buf, in send_from() argument 191 struct sockaddr * const saddr = new_any_sockaddr(p.send_family, sport); in send_from() [all …]
|