Home
last modified time | relevance | path

Searched refs:addr (Results 1 – 25 of 360) sorted by relevance

12345678910>>...15

/tools/testing/selftests/vm/
Dmap_fixed_noreplace.c30 void *addr; in find_base_addr() local
34 addr = mmap(NULL, size, PROT_NONE, flags, -1, 0); in find_base_addr()
35 if (addr == MAP_FAILED) { in find_base_addr()
40 if (munmap(addr, size) != 0) { in find_base_addr()
44 return (unsigned long)addr; in find_base_addr()
50 unsigned long flags, addr, size, page_size; in main() local
67 addr = base_addr; in main()
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()
80 if (munmap((void *)addr, 5 * page_size) != 0) { in main()
[all …]
Dmadv_populate.c59 char *addr; in sense_support() local
62 addr = mmap(0, pagesize, PROT_READ | PROT_WRITE, in sense_support()
64 if (!addr) in sense_support()
67 ret = madvise(addr, pagesize, MADV_POPULATE_READ); in sense_support()
71 ret = madvise(addr, pagesize, MADV_POPULATE_WRITE); in sense_support()
75 munmap(addr, pagesize); in sense_support()
80 char *addr; in test_prot_read() local
85 addr = mmap(0, SIZE, PROT_READ, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0); in test_prot_read()
86 if (addr == MAP_FAILED) in test_prot_read()
89 ret = madvise(addr, SIZE, MADV_POPULATE_READ); in test_prot_read()
[all …]
Dhugepage-mmap.c39 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 …]
Dmap_hugetlb.c43 static void check_bytes(char *addr) in check_bytes() argument
45 printf("First hex is %x\n", *((unsigned int *)addr)); in check_bytes()
48 static void write_bytes(char *addr, size_t length) in write_bytes() argument
53 *(addr + i) = (char)i; in write_bytes()
56 static int read_bytes(char *addr, size_t length) in read_bytes() argument
60 check_bytes(addr); in read_bytes()
62 if (*(addr + i) != (char)i) { in read_bytes()
71 void *addr; in main() local
91 addr = mmap(ADDR, length, PROTECTION, flags, -1, 0); in main()
92 if (addr == MAP_FAILED) { in main()
[all …]
Dva_128TBswitch.c34 void *addr; member
48 .addr = ((void *)(ADDR_SWITCH_HINT - PAGE_SIZE)),
60 .addr = ((void *)(ADDR_SWITCH_HINT - PAGE_SIZE)),
71 .addr = ((void *)(ADDR_SWITCH_HINT)),
78 .addr = (void *)(ADDR_SWITCH_HINT),
84 .addr = NULL,
91 .addr = LOW_ADDR,
98 .addr = HIGH_ADDR,
105 .addr = HIGH_ADDR,
112 .addr = HIGH_ADDR,
[all …]
/tools/testing/selftests/mincore/
Dmincore_selftest.c35 char *addr; in TEST() local
50 addr = mmap(NULL, page_size, PROT_READ | PROT_WRITE, in TEST()
52 ASSERT_NE(MAP_FAILED, addr) { in TEST()
58 retval = mincore(addr + 1, page_size, vec); in TEST()
64 retval = mincore(addr, -1, vec); in TEST()
70 retval = mincore(addr, page_size, NULL); in TEST()
73 munmap(addr, page_size); in TEST()
86 char *addr; in TEST() local
94 addr = mmap(NULL, page_size, PROT_READ | PROT_WRITE, in TEST()
96 ASSERT_NE(MAP_FAILED, addr) { in TEST()
[all …]
/tools/testing/selftests/kvm/aarch64/
Dvgic_init.c86 uint64_t addr; in subtest_dist_rdist() local
100 addr = 0x1000; in subtest_dist_rdist()
102 KVM_VGIC_V3_ADDR_TYPE_DIST, &addr, true); in subtest_dist_rdist()
106 KVM_VGIC_V3_ADDR_TYPE_REDIST, &addr, true); in subtest_dist_rdist()
111 addr = 1ULL << max_ipa_bits; in subtest_dist_rdist()
113 KVM_VGIC_V3_ADDR_TYPE_DIST, &addr, true); in subtest_dist_rdist()
117 KVM_VGIC_V3_ADDR_TYPE_REDIST, &addr, true); in subtest_dist_rdist()
122 addr = 0x00000; in subtest_dist_rdist()
124 KVM_VGIC_V3_ADDR_TYPE_REDIST, &addr, true); in subtest_dist_rdist()
127 addr = 0xE0000; in subtest_dist_rdist()
[all …]
/tools/include/asm-generic/bitops/
Dnon-atomic.h16 static inline void __set_bit(int nr, volatile unsigned long *addr) in __set_bit() argument
19 unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); in __set_bit()
24 static inline void __clear_bit(int nr, volatile unsigned long *addr) in __clear_bit() argument
27 unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); in __clear_bit()
41 static inline void __change_bit(int nr, volatile unsigned long *addr) in __change_bit() argument
44 unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); in __change_bit()
58 static inline int __test_and_set_bit(int nr, volatile unsigned long *addr) in __test_and_set_bit() argument
61 unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); in __test_and_set_bit()
77 static inline int __test_and_clear_bit(int nr, volatile unsigned long *addr) in __test_and_clear_bit() argument
80 unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); in __test_and_clear_bit()
[all …]
Dfind.h8 extern unsigned long _find_first_bit(const unsigned long *addr, unsigned long size);
9 extern unsigned long _find_first_zero_bit(const unsigned long *addr, unsigned long size);
10 extern unsigned long _find_last_bit(const unsigned long *addr, unsigned long size);
23 unsigned long find_next_bit(const unsigned long *addr, unsigned long size, in find_next_bit() argument
32 val = *addr & GENMASK(size - 1, offset); in find_next_bit()
36 return _find_next_bit(addr, NULL, size, offset, 0UL, 0); in find_next_bit()
81 unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size, in find_next_zero_bit() argument
90 val = *addr | ~GENMASK(size - 1, offset); in find_next_zero_bit()
94 return _find_next_bit(addr, NULL, size, offset, ~0UL, 0); in find_next_zero_bit()
109 unsigned long find_first_bit(const unsigned long *addr, unsigned long size) in find_first_bit() argument
[all …]
/tools/testing/selftests/bpf/progs/
Dget_func_ip_test.c20 __u64 addr = bpf_get_func_ip(ctx); in BPF_PROG() local
22 test1_result = (const void *) addr == &bpf_fentry_test1; in BPF_PROG()
30 __u64 addr = bpf_get_func_ip(ctx); in BPF_PROG() local
32 test2_result = (const void *) addr == &bpf_fentry_test2; in BPF_PROG()
40 __u64 addr = bpf_get_func_ip(ctx); in test3() local
42 test3_result = (const void *) addr == &bpf_fentry_test3; in test3()
50 __u64 addr = bpf_get_func_ip(ctx); in BPF_KRETPROBE() local
52 test4_result = (const void *) addr == &bpf_fentry_test4; in BPF_KRETPROBE()
60 __u64 addr = bpf_get_func_ip(ctx); in BPF_PROG() local
62 test5_result = (const void *) addr == &bpf_modify_return_test; in BPF_PROG()
[all …]
Dconnect_force_port6.c18 __be32 addr[4]; member
50 orig->addr[0] = ctx->user_ip6[0]; in connect6()
51 orig->addr[1] = ctx->user_ip6[1]; in connect6()
52 orig->addr[2] = ctx->user_ip6[2]; in connect6()
53 orig->addr[3] = ctx->user_ip6[3]; in connect6()
94 ctx->user_ip6[0] = orig->addr[0]; in getpeername6()
95 ctx->user_ip6[1] = orig->addr[1]; in getpeername6()
96 ctx->user_ip6[2] = orig->addr[2]; in getpeername6()
97 ctx->user_ip6[3] = orig->addr[3]; in getpeername6()
/tools/testing/selftests/bpf/
Dtrace_helpers.c22 return ((struct ksym *)p1)->addr - ((struct ksym *)p2)->addr; in ksym_cmp()
30 void *addr; in load_kallsyms() local
37 if (sscanf(buf, "%p %c %s", &addr, &symbol, func) != 3) in load_kallsyms()
39 if (!addr) in load_kallsyms()
41 syms[i].addr = (long) addr; in load_kallsyms()
63 result = key - syms[mid].addr; in ksym_search()
72 if (start >= 1 && syms[start - 1].addr < key && in ksym_search()
73 key < syms[start].addr) in ksym_search()
87 return syms[i].addr; in ksym_get_addr()
96 int kallsyms_find(const char *sym, unsigned long long *addr) in kallsyms_find() argument
[all …]
Dnetwork_helpers.c69 static int __start_server(int type, const struct sockaddr *addr, in __start_server() argument
75 fd = socket(addr->sa_family, type, 0); in __start_server()
90 if (bind(fd, addr, addrlen) < 0) { in __start_server()
112 struct sockaddr_storage addr; in start_server() local
115 if (make_sockaddr(family, addr_str, port, &addr, &addrlen)) in start_server()
118 return __start_server(type, (struct sockaddr *)&addr, in start_server()
125 struct sockaddr_storage addr; in start_reuseport_server() local
133 if (make_sockaddr(family, addr_str, port, &addr, &addrlen)) in start_reuseport_server()
140 fds[0] = __start_server(type, (struct sockaddr *)&addr, addrlen, in start_reuseport_server()
146 if (getsockname(fds[0], (struct sockaddr *)&addr, &addrlen)) in start_reuseport_server()
[all …]
Dwith_addr.sh22 ip -6 addr add "${V6_INNER}" dev lo || fail 'failed to setup v6 address'
23 ip -4 addr add "${V4_INNER}" dev lo || fail 'failed to setup v4 address'
30 ip -6 addr add "${V6_SIT}" dev "${SIT_DEV_NAME}" \
32 ip -4 addr add "${V4_SIT}" dev "${SIT_DEV_NAME}" \
41 ip -4 addr del "${V4_SIT}" dev "${SIT_DEV_NAME}"
42 ip -6 addr del "${V6_SIT}" dev "${SIT_DEV_NAME}"
46 ip -4 addr del "${V4_INNER}" dev lo
47 ip -6 addr del "${V6_INNER}" dev lo
/tools/testing/selftests/futex/include/
Datomic.h36 atomic_cmpxchg(atomic_t *addr, int oldval, int newval) in atomic_cmpxchg() argument
38 return __sync_val_compare_and_swap(&addr->val, oldval, newval); in atomic_cmpxchg()
48 atomic_inc(atomic_t *addr) in atomic_inc() argument
50 return __sync_add_and_fetch(&addr->val, 1); in atomic_inc()
60 atomic_dec(atomic_t *addr) in atomic_dec() argument
62 return __sync_sub_and_fetch(&addr->val, 1); in atomic_dec()
73 atomic_set(atomic_t *addr, int newval) in atomic_set() argument
75 addr->val = newval; in atomic_set()
/tools/testing/selftests/powerpc/mm/
Dhugetlb_vs_thp_test.c13 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()
Dsubpage_prot.c52 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/
Dbitops.h36 #define for_each_set_bit(bit, addr, size) \ argument
37 for ((bit) = find_first_bit((addr), (size)); \
39 (bit) = find_next_bit((addr), (size), (bit) + 1))
41 #define for_each_clear_bit(bit, addr, size) \ argument
42 for ((bit) = find_first_zero_bit((addr), (size)); \
44 (bit) = find_next_zero_bit((addr), (size), (bit) + 1))
47 #define for_each_set_bit_from(bit, addr, size) \ argument
48 for ((bit) = find_next_bit((addr), (size), (bit)); \
50 (bit) = find_next_bit((addr), (size), (bit) + 1))
/tools/perf/util/
Dsrcline.h13 char *get_srcline(struct dso *dso, u64 addr, struct symbol *sym,
15 char *__get_srcline(struct dso *dso, u64 addr, struct symbol *sym,
19 char *get_srcline_split(struct dso *dso, u64 addr, unsigned *line);
22 void srcline__tree_insert(struct rb_root_cached *tree, u64 addr, char *srcline);
24 char *srcline__tree_find(struct rb_root_cached *tree, u64 addr);
37 u64 addr; member
43 struct inline_node *dso__parse_addr_inlines(struct dso *dso, u64 addr,
52 struct inline_node *inlines__tree_find(struct rb_root_cached *tree, u64 addr);
Ddwarf-aux.c63 static Dwarf_Line *cu_getsrc_die(Dwarf_Die *cu_die, Dwarf_Addr addr) in cu_getsrc_die() argument
82 if (addr < laddr) in cu_getsrc_die()
92 } while (laddr == addr); in cu_getsrc_die()
100 if (laddr > addr) in cu_getsrc_die()
116 int cu_find_lineinfo(Dwarf_Die *cu_die, Dwarf_Addr addr, in cu_find_lineinfo() argument
123 if (die_find_realfunc(cu_die, addr, &die_mem) in cu_find_lineinfo()
125 faddr == addr) { in cu_find_lineinfo()
131 line = cu_getsrc_die(cu_die, addr); in cu_find_lineinfo()
155 int cu_walk_functions_at(Dwarf_Die *cu_die, Dwarf_Addr addr, in cu_walk_functions_at() argument
163 for (sc_die = die_find_realfunc(cu_die, addr, &die_mem); in cu_walk_functions_at()
[all …]
Dsrcline.c132 u64 addr; member
209 pc = a2l->addr; in find_address_in_section()
292 static int addr2line(const char *dso_name, u64 addr, in addr2line() argument
311 a2l->addr = addr; in addr2line()
364 static struct inline_node *addr2inlines(const char *dso_name, u64 addr, in addr2inlines() argument
376 node->addr = addr; in addr2inlines()
378 addr2line(dso_name, addr, NULL, NULL, dso, true, node, sym); in addr2inlines()
405 static int addr2line(const char *dso_name, u64 addr, in addr2line() argument
419 dso_name, addr); in addr2line()
449 static struct inline_node *addr2inlines(const char *dso_name, u64 addr, in addr2inlines() argument
[all …]
/tools/testing/selftests/net/
Dgre_gso.sh80 local addr
84 addr=$(ip -6 -br $ns addr show dev ${dev} | \
92 addr=${addr/\/*}
94 [ -z "$addr" ] && return 1
96 echo $addr
118 local addr=$2
121 [ "$proto" == 6 ] && addr="[$addr]"
127 cat $TMPFILE | timeout 1 socat -u STDIN TCP:$addr:$port
132 cat $TMPFILE | timeout 1 socat -u STDIN TCP:$addr:$port
152 ip addr add 172.16.2.1/24 dev gre1
[all …]
Dip_defrag.c134 static void send_fragment(int fd_raw, struct sockaddr *addr, socklen_t alen, in send_fragment() argument
194 res = sendto(fd_raw, ip_frame, frag_len, 0, addr, alen); in send_fragment()
203 static void send_udp_frags(int fd_raw, struct sockaddr *addr, in send_udp_frags() argument
221 ((struct sockaddr_in6 *)addr)->sin6_port = 0; in send_udp_frags()
248 send_fragment(fd_raw, addr, alen, offset, ipv6); in send_udp_frags()
259 send_fragment(fd_raw, addr, alen, offset, ipv6); in send_udp_frags()
264 send_fragment(fd_raw, addr, alen, offset, ipv6); in send_udp_frags()
269 send_fragment(fd_raw, addr, alen, offset, ipv6); in send_udp_frags()
278 send_fragment(fd_raw, addr, alen, offset, ipv6); in send_udp_frags()
281 send_fragment(fd_raw, addr, alen, offset, ipv6); in send_udp_frags()
[all …]
/tools/testing/nvdimm/
Ddax-dev.c18 phys_addr_t addr; in dax_pgoff_to_phys() local
23 addr = PFN_PHYS(pgoff - dax_range->pgoff) + range->start; in dax_pgoff_to_phys()
24 if (addr + size - 1 <= range->end) { in dax_pgoff_to_phys()
25 if (get_nfit_res(addr)) { in dax_pgoff_to_phys()
31 page = vmalloc_to_page((void *)addr); in dax_pgoff_to_phys()
34 return addr; in dax_pgoff_to_phys()
/tools/testing/selftests/sgx/
Dmain.c32 static Elf64_Dyn *vdso_get_dyntab(void *addr) in vdso_get_dyntab() argument
34 Elf64_Ehdr *ehdr = addr; in vdso_get_dyntab()
35 Elf64_Phdr *phdrtab = addr + ehdr->e_phoff; in vdso_get_dyntab()
40 return addr + phdrtab[i].p_offset; in vdso_get_dyntab()
45 static void *vdso_get_dyn(void *addr, Elf64_Dyn *dyntab, Elf64_Sxword tag) in vdso_get_dyn() argument
51 return addr + dyntab[i].d_un.d_ptr; in vdso_get_dyn()
56 static bool vdso_get_symtab(void *addr, struct vdso_symtab *symtab) in vdso_get_symtab() argument
58 Elf64_Dyn *dyntab = vdso_get_dyntab(addr); in vdso_get_symtab()
60 symtab->elf_symtab = vdso_get_dyn(addr, dyntab, DT_SYMTAB); in vdso_get_symtab()
64 symtab->elf_symstrtab = vdso_get_dyn(addr, dyntab, DT_STRTAB); in vdso_get_symtab()
[all …]

12345678910>>...15