/tools/testing/selftests/vm/ |
D | map_hugetlb.c | 35 static void check_bytes(char *addr) in check_bytes() argument 37 printf("First hex is %x\n", *((unsigned int *)addr)); in check_bytes() 40 static void write_bytes(char *addr) in write_bytes() argument 45 *(addr + i) = (char)i; in write_bytes() 48 static int read_bytes(char *addr) in read_bytes() argument 52 check_bytes(addr); in read_bytes() 54 if (*(addr + i) != (char)i) { in read_bytes() 63 void *addr; in main() local 66 addr = mmap(ADDR, LENGTH, PROTECTION, FLAGS, -1, 0); in main() 67 if (addr == MAP_FAILED) { in main() [all …]
|
D | hugepage-mmap.c | 39 static void check_bytes(char *addr) in check_bytes() argument 41 printf("First hex is %x\n", *((unsigned int *)addr)); in check_bytes() 44 static void write_bytes(char *addr) in write_bytes() argument 49 *(addr + i) = (char)i; in write_bytes() 52 static int read_bytes(char *addr) in read_bytes() argument 56 check_bytes(addr); in read_bytes() 58 if (*(addr + i) != (char)i) { in read_bytes() 67 void *addr; in main() local 76 addr = mmap(ADDR, LENGTH, PROTECTION, FLAGS, fd, 0); in main() 77 if (addr == MAP_FAILED) { in main() [all …]
|
D | virtual_address_range.c | 67 unsigned long addr = (unsigned long) ptr; in validate_addr() local 70 if (addr < HIGH_ADDR_MARK) { in validate_addr() 71 printf("Bad address %lx\n", addr); in validate_addr() 77 if (addr > HIGH_ADDR_MARK) { in validate_addr() 78 printf("Bad address %lx\n", addr); in validate_addr()
|
D | mlock2.h | 25 static FILE *seek_to_smaps_entry(unsigned long addr) in seek_to_smaps_entry() argument 48 if (start <= addr && addr < end) in seek_to_smaps_entry()
|
/tools/include/asm-generic/bitops/ |
D | atomic.h | 8 static inline void set_bit(int nr, unsigned long *addr) in set_bit() argument 10 addr[nr / __BITS_PER_LONG] |= 1UL << (nr % __BITS_PER_LONG); in set_bit() 13 static inline void clear_bit(int nr, unsigned long *addr) in clear_bit() argument 15 addr[nr / __BITS_PER_LONG] &= ~(1UL << (nr % __BITS_PER_LONG)); in clear_bit() 18 static __always_inline int test_bit(unsigned int nr, const unsigned long *addr) in test_bit() argument 21 (((unsigned long *)addr)[nr / __BITS_PER_LONG])) != 0; in test_bit() 24 #define __set_bit(nr, addr) set_bit(nr, addr) argument 25 #define __clear_bit(nr, addr) clear_bit(nr, addr) argument
|
D | find.h | 15 extern unsigned long find_next_bit(const unsigned long *addr, unsigned long 30 unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size, 44 extern unsigned long find_first_bit(const unsigned long *addr, 59 unsigned long find_first_zero_bit(const unsigned long *addr, unsigned long size);
|
/tools/lib/ |
D | find_bit.c | 32 static unsigned long _find_next_bit(const unsigned long *addr, in _find_next_bit() argument 40 tmp = addr[start / BITS_PER_LONG] ^ invert; in _find_next_bit() 51 tmp = addr[start / BITS_PER_LONG] ^ invert; in _find_next_bit() 62 unsigned long find_next_bit(const unsigned long *addr, unsigned long size, in find_next_bit() argument 65 return _find_next_bit(addr, size, offset, 0UL); in find_next_bit() 73 unsigned long find_first_bit(const unsigned long *addr, unsigned long size) in find_first_bit() argument 78 if (addr[idx]) in find_first_bit() 79 return min(idx * BITS_PER_LONG + __ffs(addr[idx]), size); in find_first_bit() 90 unsigned long find_first_zero_bit(const unsigned long *addr, unsigned long size) in find_first_zero_bit() argument 95 if (addr[idx] != ~0UL) in find_first_zero_bit() [all …]
|
/tools/testing/selftests/futex/include/ |
D | atomic.h | 40 atomic_cmpxchg(atomic_t *addr, int oldval, int newval) in atomic_cmpxchg() argument 42 return __sync_val_compare_and_swap(&addr->val, oldval, newval); in atomic_cmpxchg() 52 atomic_inc(atomic_t *addr) in atomic_inc() argument 54 return __sync_add_and_fetch(&addr->val, 1); in atomic_inc() 64 atomic_dec(atomic_t *addr) in atomic_dec() argument 66 return __sync_sub_and_fetch(&addr->val, 1); in atomic_dec() 77 atomic_set(atomic_t *addr, int newval) in atomic_set() argument 79 addr->val = newval; in atomic_set()
|
/tools/testing/nvdimm/ |
D | dax-dev.c | 21 phys_addr_t addr; in dax_pgoff_to_phys() local 26 addr = pgoff * PAGE_SIZE + res->start; in dax_pgoff_to_phys() 27 if (addr >= res->start && addr <= res->end) in dax_pgoff_to_phys() 34 if (addr + size - 1 <= res->end) { in dax_pgoff_to_phys() 35 if (get_nfit_res(addr)) { in dax_pgoff_to_phys() 41 page = vmalloc_to_page((void *)addr); in dax_pgoff_to_phys() 44 return addr; in dax_pgoff_to_phys()
|
/tools/testing/selftests/powerpc/mm/ |
D | hugetlb_vs_thp_test.c | 13 void *addr; in test_body() local 16 addr = (void *)0xa0000000; in test_body() 18 p = mmap(addr, SIZE, PROT_READ | PROT_WRITE, in test_body() 28 if (munmap(addr, SIZE)) { in test_body() 34 p = mmap(addr, SIZE, PROT_READ | PROT_WRITE, in test_body() 37 printf("Mapping failed @ %p\n", addr); in test_body() 57 munmap(addr, SIZE); in test_body()
|
D | subpage_prot.c | 52 static inline void do_read(const volatile void *addr) in do_read() argument 57 : "=r" (ret) : "r" (addr) : "memory"); in do_read() 60 static inline void do_write(const volatile void *addr) in do_write() argument 65 : : "r" (val), "r" (addr) : "memory"); in do_write() 68 static inline void check_faulted(void *addr, long page, long subpage, int write) in check_faulted() argument 77 addr, page, subpage, write, in check_faulted() 84 if (dar != addr) { in check_faulted() 86 addr, dar); in check_faulted() 93 static int run_test(void *addr, unsigned long size) in run_test() argument 111 err = syscall(__NR_subpage_prot, addr, size, map); in run_test() [all …]
|
/tools/include/linux/ |
D | bitops.h | 34 #define for_each_set_bit(bit, addr, size) \ argument 35 for ((bit) = find_first_bit((addr), (size)); \ 37 (bit) = find_next_bit((addr), (size), (bit) + 1)) 39 #define for_each_clear_bit(bit, addr, size) \ argument 40 for ((bit) = find_first_zero_bit((addr), (size)); \ 42 (bit) = find_next_zero_bit((addr), (size), (bit) + 1)) 45 #define for_each_set_bit_from(bit, addr, size) \ argument 46 for ((bit) = find_next_bit((addr), (size), (bit)); \ 48 (bit) = find_next_bit((addr), (size), (bit) + 1))
|
/tools/perf/util/ |
D | dwarf-aux.c | 84 int cu_find_lineinfo(Dwarf_Die *cu_die, unsigned long addr, in cu_find_lineinfo() argument 90 line = dwarf_getsrc_die(cu_die, (Dwarf_Addr)addr); in cu_find_lineinfo() 92 addr == (unsigned long)laddr && dwarf_lineno(line, lineno) == 0) { in cu_find_lineinfo() 114 int cu_walk_functions_at(Dwarf_Die *cu_die, Dwarf_Addr addr, in cu_walk_functions_at() argument 122 for (sc_die = die_find_realfunc(cu_die, addr, &die_mem); in cu_walk_functions_at() 124 sc_die = die_find_child(sc_die, __die_find_inline_cb, &addr, in cu_walk_functions_at() 332 int die_entrypc(Dwarf_Die *dw_die, Dwarf_Addr *addr) in die_entrypc() argument 336 if (!addr) in die_entrypc() 339 if (dwarf_entrypc(dw_die, addr) == 0) in die_entrypc() 342 return dwarf_ranges(dw_die, 0, &base, addr, &end) < 0 ? -ENOENT : 0; in die_entrypc() [all …]
|
D | dwarf-aux.h | 34 int cu_find_lineinfo(Dwarf_Die *cudie, unsigned long addr, 38 int cu_walk_functions_at(Dwarf_Die *cu_die, Dwarf_Addr addr, 45 int die_entrypc(Dwarf_Die *dw_die, Dwarf_Addr *addr); 91 Dwarf_Die *die_find_realfunc(Dwarf_Die *cu_die, Dwarf_Addr addr, 95 Dwarf_Die *die_find_tailfunc(Dwarf_Die *cu_die, Dwarf_Addr addr, 99 Dwarf_Die *die_find_top_inlinefunc(Dwarf_Die *sp_die, Dwarf_Addr addr, 103 Dwarf_Die *die_find_inlinefunc(Dwarf_Die *sp_die, Dwarf_Addr addr, 112 Dwarf_Addr addr, void *data); 122 Dwarf_Addr addr, Dwarf_Die *die_mem);
|
D | unwind-libdw.c | 79 e->ip = al.addr; in entry() 100 static int access_dso_mem(struct unwind_info *ui, Dwarf_Addr addr, in access_dso_mem() argument 107 MAP__FUNCTION, addr, &al); in access_dso_mem() 115 MAP__VARIABLE, addr, &al); in access_dso_mem() 119 pr_debug("unwind: no map for %lx\n", (unsigned long)addr); in access_dso_mem() 127 addr, (u8 *) data, sizeof(*data)); in access_dso_mem() 132 static bool memory_read(Dwfl *dwfl __maybe_unused, Dwarf_Addr addr, Dwarf_Word *result, in memory_read() argument 148 if (addr + sizeof(Dwarf_Word) < addr) in memory_read() 151 if (addr < start || addr + sizeof(Dwarf_Word) > end) { in memory_read() 152 ret = access_dso_mem(ui, addr, result); in memory_read() [all …]
|
D | srcline.c | 78 u64 addr; member 149 pc = a2l->addr; in find_address_in_section() 220 static int addr2line(const char *dso_name, u64 addr, in addr2line() argument 237 a2l->addr = addr; in addr2line() 290 static struct inline_node *addr2inlines(const char *dso_name, u64 addr, in addr2inlines() argument 302 node->addr = addr; in addr2inlines() 304 if (!addr2line(dso_name, addr, NULL, NULL, dso, TRUE, node)) in addr2inlines() 340 static int addr2line(const char *dso_name, u64 addr, in addr2line() argument 353 dso_name, addr); in addr2line() 383 static struct inline_node *addr2inlines(const char *dso_name, u64 addr, in addr2inlines() argument [all …]
|
D | srcline.h | 12 char *get_srcline(struct dso *dso, u64 addr, struct symbol *sym, 14 char *__get_srcline(struct dso *dso, u64 addr, struct symbol *sym, 28 u64 addr; member 32 struct inline_node *dso__parse_addr_inlines(struct dso *dso, u64 addr);
|
D | probe-finder.c | 175 static int convert_variable_location(Dwarf_Die *vr_die, Dwarf_Addr addr, in convert_variable_location() argument 196 if (dwarf_getlocation_addr(&attr, addr, &op, &nops, 1) <= 0) { in convert_variable_location() 204 } else if (addr != tmp || in convert_variable_location() 216 for (addr += 1; addr <= tmp; addr++) { in convert_variable_location() 217 if (dwarf_getlocation_addr(&attr, addr, &op, in convert_variable_location() 549 ret = convert_variable_location(vr_die, pf->addr, pf->fb_ops, in convert_variable() 597 if (!die_find_variable_at(sc_die, pf->pvar->var, pf->addr, &vr_die)) { in find_variable() 679 if (!die_find_realfunc(&pf->cu_die, pf->addr, &pf->sp_die)) { in call_probe_finder() 680 if (die_find_tailfunc(&pf->cu_die, pf->addr, &pf->sp_die)) { in call_probe_finder() 695 ret = dwarf_getlocation_addr(&fb_attr, pf->addr, &pf->fb_ops, &nops, 1); in call_probe_finder() [all …]
|
/tools/testing/selftests/breakpoints/ |
D | breakpoint_test_arm64.c | 43 volatile uint8_t *addr = &var[32 + wr]; in child() local 58 if ((uintptr_t) addr % size) { in child() 67 *addr = 47; in child() 70 *(uint16_t *)addr = 47; in child() 73 *(uint32_t *)addr = 47; in child() 76 *(uint64_t *)addr = 47; in child() 79 __asm__ volatile ("stp x29, x30, %0" : "=m" (addr[0])); in child() 82 __asm__ volatile ("stp q29, q30, %0" : "=m" (addr[0])); in child() 91 const volatile uint8_t *addr = &var[32 + wp]; in set_watchpoint() local 92 const int offset = (uintptr_t)addr % 8; in set_watchpoint() [all …]
|
/tools/perf/arch/x86/tests/ |
D | rdpmc.c | 35 static u64 mmap_read_self(void *addr) in mmap_read_self() argument 37 struct perf_event_mmap_page *pc = addr; in mmap_read_self() 99 void *addr; in __test__rdpmc() local 123 addr = mmap(NULL, page_size, PROT_READ, MAP_SHARED, fd, 0); in __test__rdpmc() 124 if (addr == (void *)(-1)) { in __test__rdpmc() 133 stamp = mmap_read_self(addr); in __test__rdpmc() 138 now = mmap_read_self(addr); in __test__rdpmc() 147 munmap(addr, page_size); in __test__rdpmc()
|
/tools/perf/ |
D | builtin-lock.c | 54 void *addr; /* address of lockdep_map, used as ID */ member 108 void *addr; member 317 static struct lock_stat *lock_stat_findnew(void *addr, const char *name) in lock_stat_findnew() argument 319 struct list_head *entry = lockhashentry(addr); in lock_stat_findnew() 323 if (ret->addr == addr) in lock_stat_findnew() 331 new->addr = addr; in lock_stat_findnew() 363 static struct lock_seq_stat *get_seq(struct thread_stat *ts, void *addr) in get_seq() argument 368 if (seq->addr == addr) in get_seq() 378 seq->addr = addr; in get_seq() 402 void *addr; in report_lock_acquire_event() local [all …]
|
/tools/perf/tests/ |
D | code-reading.c | 130 u64 addr, last_addr = start_addr; in read_objdump_output() local 150 if (sscanf(line, "%"PRIx64, &addr) != 1) in read_objdump_output() 152 if (addr < last_addr) { in read_objdump_output() 156 last_addr = addr; in read_objdump_output() 160 off = addr - start_addr; in read_objdump_output() 176 static int read_via_objdump(const char *filename, u64 addr, void *buf, in read_via_objdump() argument 185 ret = snprintf(cmd, sizeof(cmd), fmt, "objdump", addr, addr + len, in read_via_objdump() 201 ret = read_objdump_output(f, buf, &len, addr); in read_via_objdump() 225 static int read_object_code(u64 addr, size_t len, u8 cpumode, in read_object_code() argument 237 pr_debug("Reading object code for memory address: %#"PRIx64"\n", addr); in read_object_code() [all …]
|
/tools/testing/selftests/net/ |
D | reuseaddr_conflict.c | 28 struct sockaddr *addr; in open_port() local 44 addr = (struct sockaddr*)&addr6; in open_port() 47 addr = (struct sockaddr*)&addr4; in open_port() 68 if (bind(fd, addr, addrlen) < 0) { in open_port()
|
D | reuseport_bpf.c | 47 struct sockaddr_storage *addr; in new_any_sockaddr() local 51 addr = malloc(sizeof(struct sockaddr_storage)); in new_any_sockaddr() 52 memset(addr, 0, sizeof(struct sockaddr_storage)); in new_any_sockaddr() 56 addr4 = (struct sockaddr_in *)addr; in new_any_sockaddr() 62 addr6 = (struct sockaddr_in6 *)addr; in new_any_sockaddr() 70 return (struct sockaddr *)addr; in new_any_sockaddr() 75 struct sockaddr *addr = new_any_sockaddr(family, port); in new_loopback_sockaddr() local 81 addr4 = (struct sockaddr_in *)addr; in new_loopback_sockaddr() 85 addr6 = (struct sockaddr_in6 *)addr; in new_loopback_sockaddr() 91 return addr; in new_loopback_sockaddr() [all …]
|
D | rtnetlink.sh | 50 ip addr add dev "$vlandev" 10.200.7.23/30 52 ip -6 addr add dev "$vlandev" dead:42::1234/64 58 ip -6 addr del dev "$vlandev" dead:42::1234/64 85 ip addr add 10.23.7.10 dev $gredev 89 ip addr add dev "$devdummy" 10.23.7.11/24 93 ip addr > /dev/null 95 ip addr del dev "$devdummy" 10.23.7.11/24 183 ip addr add dev "$devdummy" 10.23.7.11/24 187 ip addr del dev "$devdummy" 10.23.7.11/24 202 ip addr add 10.23.11.$i/32 dev "$devdummy" preferred_lft $lft valid_lft $((lft+1)) [all …]
|