/third_party/elfutils/lib/ |
H A D | crc32_file.c | 53 void *mapped = mmap (NULL, mapsize, PROT_READ, MAP_PRIVATE, fd, 0); in crc32_file() 59 && (mapped = mmap (NULL, mapsize, PROT_READ, MAP_PRIVATE, in crc32_file() 76 } while (mmap (mapped, mapsize, PROT_READ, MAP_FIXED|MAP_PRIVATE, in crc32_file()
|
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/ |
H A D | 27-1.c | 9 * The mmap() function shall fail if: 17 * 1. Try mmap with MAP_PRIVATE should either fail with ENOTSUP or SUCCEED 60 pa = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); in main() 75 pa = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); in main() 77 printf("Error at mmap(): %s\n", strerror(errno)); in main() 81 pa = mmap(pa, len / 2, PROT_READ, MAP_SHARED | MAP_FIXED, fd, 0); in main()
|
/kernel/linux/linux-5.10/tools/perf/arch/x86/tests/ |
H A D | perf-time-to-tsc.c | 12 #include <perf/mmap.h> 21 #include "util/mmap.h" 70 struct mmap *md; in test__perf_time_to_tsc() 97 pc = evlist->mmap[0].core.base; in test__perf_time_to_tsc() 120 md = &evlist->mmap[i]; in test__perf_time_to_tsc()
|
/kernel/linux/linux-6.6/tools/testing/selftests/mm/ |
H A D | soft-dirty.c | 22 ksft_exit_fail_msg("mmap failed\n"); in test_simple() 52 map = mmap(NULL, pagesize, (PROT_READ | PROT_WRITE), (MAP_PRIVATE | MAP_ANON), -1, 0); in test_vma_reuse() 54 ksft_exit_fail_msg("mmap failed"); in test_vma_reuse() 63 map2 = mmap(NULL, pagesize, (PROT_READ | PROT_WRITE), (MAP_PRIVATE | MAP_ANON), -1, 0); in test_vma_reuse() 65 ksft_exit_fail_msg("mmap failed"); in test_vma_reuse() 135 map = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, in test_mprotect() 138 ksft_exit_fail_msg("anon mmap failed\n"); in test_mprotect() 147 map = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, in test_mprotect() 150 ksft_exit_fail_msg("file mmap failed\n"); in test_mprotect()
|
H A D | mlock2-tests.c | 196 map = mmap(NULL, 2 * page_size, PROT_READ | PROT_WRITE, in test_mlock_lock() 199 perror("test_mlock_locked mmap"); in test_mlock_lock() 259 map = mmap(NULL, 2 * page_size, PROT_READ | PROT_WRITE, in test_mlock_onfault() 262 perror("test_mlock_locked mmap"); in test_mlock_onfault() 301 map = mmap(NULL, 2 * page_size, PROT_READ | PROT_WRITE, in test_lock_onfault_of_present() 304 perror("test_mlock_locked mmap"); in test_lock_onfault_of_present() 337 map = mmap(NULL, 2 * page_size, PROT_READ | PROT_WRITE, in test_munlockall() 341 perror("test_munlockall mmap"); in test_munlockall() 363 map = mmap(NULL, 2 * page_size, PROT_READ | PROT_WRITE, in test_munlockall() 367 perror("test_munlockall second mmap"); in test_munlockall() [all...] |
H A D | hmm-tests.c | 314 buffer->ptr = mmap(NULL, size, in TEST_F() 377 buffer->ptr = mmap(NULL, size, in TEST_F() 436 buffer->ptr = mmap(NULL, size, in TEST_F() 484 buffer->ptr = mmap(NULL, size, in TEST_F() 552 buffer->ptr = mmap(NULL, size, in TEST_F() 630 buffer->ptr = mmap(NULL, size, in TEST_F() 705 buffer->ptr = mmap(NULL, size, in TEST_F() 809 buffer->ptr = mmap(NULL, size, in TEST_F() 843 * Read mmap'ed file memory. 878 buffer->ptr = mmap(NUL in TEST_F() [all...] |
H A D | virtual_address_range.c | 17 * Maximum address range mapped with a single mmap() 32 * first argument into mmap() system call. 94 ptr = mmap((void *) (1UL << 45), MAP_CHUNK_SIZE, PROT_READ | in validate_lower_address_hint() 111 ptr[i] = mmap(NULL, MAP_CHUNK_SIZE, PROT_READ | PROT_WRITE, in main() 130 hptr[i] = mmap(hint, MAP_CHUNK_SIZE, PROT_READ | PROT_WRITE, in main()
|
/kernel/linux/linux-5.10/tools/testing/selftests/vm/ |
H A D | mlock2-tests.c | 197 map = mmap(NULL, 2 * page_size, PROT_READ | PROT_WRITE, in test_mlock_lock() 200 perror("test_mlock_locked mmap"); in test_mlock_lock() 260 map = mmap(NULL, 2 * page_size, PROT_READ | PROT_WRITE, in test_mlock_onfault() 263 perror("test_mlock_locked mmap"); in test_mlock_onfault() 302 map = mmap(NULL, 2 * page_size, PROT_READ | PROT_WRITE, in test_lock_onfault_of_present() 305 perror("test_mlock_locked mmap"); in test_lock_onfault_of_present() 338 map = mmap(NULL, 2 * page_size, PROT_READ | PROT_WRITE, in test_munlockall() 342 perror("test_munlockall mmap"); in test_munlockall() 364 map = mmap(NULL, 2 * page_size, PROT_READ | PROT_WRITE, in test_munlockall() 368 perror("test_munlockall second mmap"); in test_munlockall() [all...] |
/kernel/linux/linux-5.10/tools/testing/selftests/powerpc/mm/ |
H A D | hugetlb_vs_thp_test.c | 18 p = mmap(addr, SIZE, PROT_READ | PROT_WRITE, in test_body() 22 * Typically the mmap will fail because no huge pages are in test_body() 24 * allocated the mmap will succeed. That's fine too, we just in test_body() 34 p = mmap(addr, SIZE, PROT_READ | PROT_WRITE, in test_body() 38 perror("mmap"); in test_body()
|
/kernel/linux/linux-6.6/tools/testing/selftests/powerpc/mm/ |
H A D | hugetlb_vs_thp_test.c | 18 p = mmap(addr, SIZE, PROT_READ | PROT_WRITE, in test_body() 22 * Typically the mmap will fail because no huge pages are in test_body() 24 * allocated the mmap will succeed. That's fine too, we just in test_body() 34 p = mmap(addr, SIZE, PROT_READ | PROT_WRITE, in test_body() 38 perror("mmap"); in test_body()
|
/kernel/liteos_a/testsuites/unittest/basic/mem/vm/smoke/ |
H A D | mmap_test_010.cpp | 43 ptr = (int *)mmap(0, MMAP_SIZE, PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); in Testcase() 50 ptr = (int *)mmap(0, MMAP_SIZE, PROT_EXEC, MAP_ANON | MAP_PRIVATE, -1, 0); in Testcase()
|
/kernel/linux/linux-5.10/drivers/vfio/mdev/ |
H A D | vfio_mdev.c | 95 if (unlikely(!parent->ops->mmap)) in vfio_mdev_mmap() 98 return parent->ops->mmap(mdev, vma); in vfio_mdev_mmap() 108 .mmap = vfio_mdev_mmap,
|
/kernel/linux/linux-5.10/tools/perf/tests/ |
H A D | keep-tracking.c | 8 #include <perf/mmap.h> 17 #include "util/mmap.h" 36 struct mmap *md; in find_comm() 41 md = &evlist->mmap[i]; in find_comm()
|
H A D | openat-syscall-tp-fields.c | 14 #include "util/mmap.h" 16 #include <perf/mmap.h> 93 struct mmap *md; in test__syscall_openat_tp_fields() 95 md = &evlist->mmap[i]; in test__syscall_openat_tp_fields()
|
H A D | task-exit.c | 8 #include "util/mmap.h" 15 #include <perf/mmap.h> 56 struct mmap *md; in test__task_exit() 113 pr_debug("failed to mmap events: %d (%s)\n", errno, in test__task_exit() 122 md = &evlist->mmap[0]; in test__task_exit()
|
H A D | sw-clock.c | 15 #include "util/mmap.h" 18 #include <perf/mmap.h> 47 struct mmap *md; in __test__sw_clock_freq() 89 pr_debug("failed to mmap event: %d (%s)\n", errno, in __test__sw_clock_freq() 102 md = &evlist->mmap[0]; in __test__sw_clock_freq()
|
/kernel/linux/linux-5.10/tools/perf/util/ |
H A D | sideband_evlist.c | 6 #include "util/mmap.h" 8 #include <perf/mmap.h> 59 struct mmap *map = &evlist->mmap[i]; in perf_evlist__poll_thread()
|
/kernel/linux/linux-6.6/tools/perf/tests/ |
H A D | task-exit.c | 8 #include "util/mmap.h" 15 #include <perf/mmap.h> 56 struct mmap *md; in test__task_exit() 109 pr_debug("failed to mmap events: %d (%s)\n", errno, in test__task_exit() 118 md = &evlist->mmap[0]; in test__task_exit()
|
H A D | sw-clock.c | 15 #include "util/mmap.h" 19 #include <perf/mmap.h> 48 struct mmap *md; in __test__sw_clock_freq() 87 pr_debug("failed to mmap event: %d (%s)\n", errno, in __test__sw_clock_freq() 100 md = &evlist->mmap[0]; in __test__sw_clock_freq()
|
H A D | openat-syscall-tp-fields.c | 14 #include "util/mmap.h" 16 #include <perf/mmap.h> 95 struct mmap *md; in test__syscall_openat_tp_fields() 97 md = &evlist->mmap[i]; in test__syscall_openat_tp_fields()
|
H A D | keep-tracking.c | 8 #include <perf/mmap.h> 17 #include "util/mmap.h" 36 struct mmap *md; in find_comm() 41 md = &evlist->mmap[i]; in find_comm()
|
/kernel/linux/linux-6.6/tools/perf/util/ |
H A D | sideband_evlist.c | 6 #include "util/mmap.h" 8 #include <perf/mmap.h> 59 struct mmap *map = &evlist->mmap[i]; in perf_evlist__poll_thread()
|
/third_party/ltp/testcases/kernel/mem/mmapstress/ |
H A D | mmapstress03.c | 27 * it into two segments (i.e. |---brk---|-mmap-|--more brk--|). Next it 35 * for a huge mmap which is refused. 143 /* Ask for a ridiculously large mmap region at a high address */ in main() 144 if (mmap((void*) (((uintptr_t)1) << ((sizeof(void*)<<3) - 1)) - pagesize, in main() 149 ERROR("really large mmap didn't fail"); in main() 153 ERROR("really large mmap didn't set errno = ENOMEM nor EINVAL"); in main() 167 if (mmap((void*) ((long)brk_max - 3 * pagesize), (2 * pagesize), in do_test() 171 ERROR("mmap failed"); in do_test() 174 /* extend mmap */ in do_test() 175 if (mmap((voi in do_test() [all...] |
H A D | mmapstress05.c | 26 * original mmap. It then mmaps the preceding portion of the file behind 27 * the original mmap. None of the mmaps can be concatenated. 179 if (mmap(mmapaddr + pagesize, pagesize, PROT_READ, in main() 183 CERROR("first mmap (of third page) failed"); in main() 186 if (mmap(mmapaddr, pagesize, PROT_READ, in main() 190 CERROR("second mmap (of fifth page) failed"); in main() 193 if (mmap(mmapaddr + 2 * pagesize, pagesize, PROT_READ, in main() 195 CERROR("third mmap (of first page) failed"); in main()
|
/third_party/ltp/testcases/kernel/mem/hugetlb/hugemmap/ |
H A D | hugemmap02.c | 60 addr = mmap(0, 256 * 1024 * 1024, PROT_READ, in test_hugemmap() 71 /* mmap using normal pages and a low memory address */ in test_hugemmap() 72 addr = mmap((void *)low_addr, page_sz, PROT_READ, in test_hugemmap() 75 tst_brk(TBROK | TERRNO, "mmap failed on nfildes"); in test_hugemmap() 83 /* Attempt to mmap a huge page into a low memory address */ in test_hugemmap() 84 addr2 = mmap((void *)low_addr2, map_sz, PROT_READ | PROT_WRITE, in test_hugemmap() 88 tst_res(TFAIL | TERRNO, "huge mmap failed unexpectedly" in test_hugemmap() 91 tst_res(TPASS, "huge mmap succeeded (64-bit)"); in test_hugemmap() 95 tst_res(TFAIL | TERRNO, "huge mmap failed unexpectedly" in test_hugemmap() 99 "huge mmap faile in test_hugemmap() [all...] |