Home
last modified time | relevance | path

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

12345678910>>...13

/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 …]
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.c44 static void check_bytes(char *addr) in check_bytes() argument
46 printf("First hex is %x\n", *((unsigned int *)addr)); in check_bytes()
49 static void write_bytes(char *addr, size_t length) in write_bytes() argument
54 *(addr + i) = (char)i; in write_bytes()
57 static int read_bytes(char *addr, size_t length) in read_bytes() argument
61 check_bytes(addr); in read_bytes()
63 if (*(addr + i) != (char)i) { in read_bytes()
72 void *addr; in main() local
98 addr = mmap(ADDR, length, PROTECTION, flags, -1, 0); in main()
99 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.c36 char *addr; in TEST() local
51 addr = mmap(NULL, page_size, PROT_READ | PROT_WRITE, in TEST()
53 ASSERT_NE(MAP_FAILED, addr) { in TEST()
59 retval = mincore(addr + 1, page_size, vec); in TEST()
65 retval = mincore(addr, -1, vec); in TEST()
71 retval = mincore(addr, page_size, NULL); in TEST()
74 munmap(addr, page_size); in TEST()
87 char *addr; in TEST() local
95 addr = mmap(NULL, page_size, PROT_READ | PROT_WRITE, in TEST()
97 ASSERT_NE(MAP_FAILED, addr) { in TEST()
[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 …]
Datomic.h8 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()
/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/bpf/
Dnetwork_helpers.c72 struct sockaddr_storage addr = {}; in start_server() local
76 if (make_sockaddr(family, addr_str, port, &addr, &len)) in start_server()
88 if (bind(fd, (const struct sockaddr *)&addr, len) < 0) { in start_server()
110 struct sockaddr_storage addr; in fastopen_connect() local
111 socklen_t addrlen = sizeof(addr); in fastopen_connect()
115 if (getsockname(server_fd, (struct sockaddr *)&addr, &addrlen)) { in fastopen_connect()
120 addr_in = (struct sockaddr_in *)&addr; in fastopen_connect()
130 ret = sendto(fd, data, data_len, MSG_FASTOPEN, (struct sockaddr *)&addr, in fastopen_connect()
145 const struct sockaddr_storage *addr, in connect_fd_to_addr() argument
148 if (connect(fd, (const struct sockaddr *)addr, addrlen)) { in connect_fd_to_addr()
[all …]
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 …]
Dtest_socket_cookie.c28 struct sockaddr_in6 addr; in start_server() local
37 memset(&addr, 0, sizeof(addr)); in start_server()
38 addr.sin6_family = AF_INET6; in start_server()
39 addr.sin6_addr = in6addr_loopback; in start_server()
40 addr.sin6_port = 0; in start_server()
42 if (bind(fd, (const struct sockaddr *)&addr, sizeof(addr)) == -1) { in start_server()
63 struct sockaddr_storage addr; in connect_to_server() local
64 socklen_t len = sizeof(addr); in connect_to_server()
73 if (getsockname(server_fd, (struct sockaddr *)&addr, &len)) { in connect_to_server()
78 if (connect(fd, (const struct sockaddr *)&addr, len) == -1) { in connect_to_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/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/lib/
Dfind_bit.c68 unsigned long find_next_bit(const unsigned long *addr, unsigned long size, in find_next_bit() argument
71 return _find_next_bit(addr, NULL, size, offset, 0UL); in find_next_bit()
79 unsigned long find_first_bit(const unsigned long *addr, unsigned long size) in find_first_bit() argument
84 if (addr[idx]) in find_first_bit()
85 return min(idx * BITS_PER_LONG + __ffs(addr[idx]), size); in find_first_bit()
96 unsigned long find_first_zero_bit(const unsigned long *addr, unsigned long size) in find_first_zero_bit() argument
101 if (addr[idx] != ~0UL) in find_first_zero_bit()
102 return min(idx * BITS_PER_LONG + ffz(addr[idx]), size); in find_first_zero_bit()
110 unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size, in find_next_zero_bit() argument
113 return _find_next_bit(addr, NULL, size, offset, ~0UL); in find_next_zero_bit()
/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, unsigned long addr, in cu_find_lineinfo() argument
123 if (die_find_realfunc(cu_die, (Dwarf_Addr)addr, &die_mem) in cu_find_lineinfo()
125 faddr == addr) { in cu_find_lineinfo()
131 line = cu_getsrc_die(cu_die, (Dwarf_Addr)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 …]
Ddwarf-aux.h22 int cu_find_lineinfo(Dwarf_Die *cudie, unsigned long addr,
26 int cu_walk_functions_at(Dwarf_Die *cu_die, Dwarf_Addr addr,
33 int die_entrypc(Dwarf_Die *dw_die, Dwarf_Addr *addr);
79 Dwarf_Die *die_find_realfunc(Dwarf_Die *cu_die, Dwarf_Addr addr,
83 Dwarf_Die *die_find_tailfunc(Dwarf_Die *cu_die, Dwarf_Addr addr,
87 Dwarf_Die *die_find_top_inlinefunc(Dwarf_Die *sp_die, Dwarf_Addr addr,
91 Dwarf_Die *die_find_inlinefunc(Dwarf_Die *sp_die, Dwarf_Addr addr,
100 Dwarf_Addr addr, void *data);
110 Dwarf_Addr addr, Dwarf_Die *die_mem);
/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/testing/selftests/bpf/progs/
Dconnect_force_port6.c16 __be32 addr[4]; member
48 orig->addr[0] = ctx->user_ip6[0]; in connect6()
49 orig->addr[1] = ctx->user_ip6[1]; in connect6()
50 orig->addr[2] = ctx->user_ip6[2]; in connect6()
51 orig->addr[3] = ctx->user_ip6[3]; in connect6()
86 ctx->user_ip6[0] = orig->addr[0]; in getpeername6()
87 ctx->user_ip6[1] = orig->addr[1]; in getpeername6()
88 ctx->user_ip6[2] = orig->addr[2]; in getpeername6()
89 ctx->user_ip6[3] = orig->addr[3]; in getpeername6()
/tools/testing/selftests/net/
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/bpf/prog_tests/
Dsk_assign.c77 start_server(const struct sockaddr *addr, socklen_t len, int type) in start_server() argument
81 fd = socket(addr->sa_family, type, 0); in start_server()
87 if (CHECK_FAIL(bind(fd, addr, len) == -1)) in start_server()
101 connect_to_server(const struct sockaddr *addr, socklen_t len, int type) in connect_to_server() argument
105 fd = socket(addr->sa_family, type, 0); in connect_to_server()
111 if (CHECK_FAIL(connect(fd, addr, len))) in connect_to_server()
157 run_test(int server_fd, const struct sockaddr *addr, socklen_t len, int type) in run_test() argument
164 client = connect_to_server(addr, len, type); in run_test()
217 prepare_addr(struct sockaddr *addr, int family, __u16 port, bool rewrite_addr) in prepare_addr() argument
224 addr4 = (struct sockaddr_in *)addr; in prepare_addr()
[all …]
/tools/testing/selftests/breakpoints/
Dbreakpoint_test_arm64.c35 volatile uint8_t *addr = &var[32 + wr]; in child() local
50 if ((uintptr_t) addr % size) { in child()
59 *addr = 47; in child()
62 *(uint16_t *)addr = 47; in child()
65 *(uint32_t *)addr = 47; in child()
68 *(uint64_t *)addr = 47; in child()
71 __asm__ volatile ("stp x29, x30, %0" : "=m" (addr[0])); in child()
74 __asm__ volatile ("stp q29, q30, %0" : "=m" (addr[0])); in child()
83 const volatile uint8_t *addr = &var[32 + wp]; in set_watchpoint() local
84 const int offset = (uintptr_t)addr % 8; in set_watchpoint()
[all …]

12345678910>>...13