/external/linux-kselftest/tools/testing/selftests/vm/ |
D | mlock2-tests.c | 228 unsigned long page_size = getpagesize(); in lock_check() local 232 page2_flags = get_pageflags((unsigned long)map + page_size); in lock_check() 256 if (!is_vmflag_set((unsigned long)map + page_size, LOCKED)) { in lock_check() 266 unsigned long page_size = getpagesize(); in unlock_lock_check() local 270 page2_flags = get_pageflags((unsigned long)map + page_size); in unlock_lock_check() 284 if (is_vmflag_set((unsigned long)map + page_size, LOCKED)) { in unlock_lock_check() 296 unsigned long page_size = getpagesize(); in test_mlock_lock() local 298 map = mmap(NULL, 2 * page_size, PROT_READ | PROT_WRITE, in test_mlock_lock() 305 if (mlock2_(map, 2 * page_size, 0)) { in test_mlock_lock() 318 if (munlock(map, 2 * page_size)) { in test_mlock_lock() [all …]
|
D | map_fixed_noreplace.c | 33 unsigned long flags, addr, size, page_size; in main() local 36 page_size = sysconf(_SC_PAGE_SIZE); in main() 43 size = 5 * page_size; in main() 55 if (munmap((void *)addr, 5 * page_size) != 0) { in main() 63 addr = BASE_ADDRESS + page_size; in main() 64 size = 3 * page_size; in main() 84 size = 5 * page_size; in main() 104 addr = BASE_ADDRESS + (2 * page_size); in main() 105 size = page_size; in main() 124 addr = BASE_ADDRESS + (3 * page_size); in main() [all …]
|
D | userfaultfd.c | 64 static unsigned long nr_cpus, nr_pages, nr_pages_per_cpu, page_size; variable 93 ((pthread_mutex_t *) ((___area) + (___nr)*page_size)) 100 ((___area) + (___nr)*page_size + \ 134 if (madvise(rel_area, nr_pages * page_size, MADV_DONTNEED)) { in anon_release_pages() 144 if (posix_memalign(alloc_area, page_size, nr_pages * page_size)) { in anon_allocate_area() 161 nr_pages * page_size, in hugetlb_release_pages() 162 nr_pages * page_size)) { in hugetlb_release_pages() 175 *alloc_area = mmap(NULL, nr_pages * page_size, PROT_READ | PROT_WRITE, in hugetlb_allocate_area() 179 nr_pages * page_size); in hugetlb_allocate_area() 186 area_alias = mmap(NULL, nr_pages * page_size, PROT_READ | PROT_WRITE, in hugetlb_allocate_area() [all …]
|
/external/u-boot/drivers/mtd/nand/ |
D | fsl_ifc_spl.c | 17 static inline int is_blank(uchar *addr, int page_size) in is_blank() argument 21 for (i = 0; i < page_size; i++) { in is_blank() 35 unsigned int bufnum, int page_size) in check_read_ecc() argument 42 if (is_blank(buf, page_size)) in check_read_ecc() 67 static inline void nand_wait(uchar *buf, int bufnum, int page_size) in nand_wait() argument 72 int bufperpage = page_size / 512; in nand_wait() 92 if (check_read_ecc(buf, eccstat, i, page_size)) in nand_wait() 112 int page_size; in nand_spl_load_image() local 136 page_size = 8192; in nand_spl_load_image() 139 page_size = 4096; in nand_spl_load_image() [all …]
|
D | sunxi_nand_spl.c | 86 int page_size; member 208 writel(val | NFC_CTL_RAM_METHOD | NFC_CTL_PAGE_SIZE(conf->page_size), in nand_apply_config() 211 writel(conf->page_size, SUNXI_NFC_BASE + NFC_SPARE_AREA); in nand_apply_config() 216 int page = offs / conf->page_size; in nand_load_page() 260 int page = offs / conf->page_size; in nand_read_page() 264 if (offs % conf->page_size || len % conf->ecc_size || in nand_read_page() 265 len > conf->page_size || len < 0) in nand_read_page() 275 int oob_off = conf->page_size + (i * oob_chunk_sz); in nand_read_page() 330 int nsectors = conf->page_size / conf->ecc_size; in nand_max_ecc_strength() 337 switch (conf->page_size) { in nand_max_ecc_strength() [all …]
|
/external/compiler-rt/lib/sanitizer_common/tests/ |
D | sanitizer_posix_test.cc | 63 const int page_size = GetPageSize(); in TEST() local 64 uptr mem = (uptr)mmap(0, 3 * page_size, PROT_READ | PROT_WRITE, in TEST() 67 mprotect((void *)(mem + page_size), page_size, PROT_NONE); in TEST() 68 EXPECT_TRUE(IsAccessibleMemoryRange(mem, page_size - 1)); in TEST() 69 EXPECT_TRUE(IsAccessibleMemoryRange(mem, page_size)); in TEST() 70 EXPECT_FALSE(IsAccessibleMemoryRange(mem, page_size + 1)); in TEST() 71 EXPECT_TRUE(IsAccessibleMemoryRange(mem + page_size - 1, 1)); in TEST() 72 EXPECT_FALSE(IsAccessibleMemoryRange(mem + page_size - 1, 2)); in TEST() 73 EXPECT_FALSE(IsAccessibleMemoryRange(mem + 2 * page_size - 1, 1)); in TEST() 74 EXPECT_TRUE(IsAccessibleMemoryRange(mem + 2 * page_size, page_size)); in TEST() [all …]
|
/external/strace/tests-m32/ |
D | tail_alloc.c | 35 const size_t page_size = get_page_size(); in tail_alloc() local 36 const size_t len = (size + page_size - 1) & -page_size; in tail_alloc() 37 const size_t alloc_size = len + 6 * page_size; in tail_alloc() 44 void *start_work = p + 3 * page_size; in tail_alloc() 47 if (munmap(p, page_size) || in tail_alloc() 48 munmap(p + 2 * page_size, page_size) || in tail_alloc() 49 munmap(tail_guard, page_size) || in tail_alloc() 50 munmap(tail_guard + 2 * page_size, page_size)) in tail_alloc()
|
D | sendfile64.c | 54 const unsigned int page_size = get_page_size(); in main() local 55 assert(syscall(__NR_sendfile64, 0, 1, NULL, page_size) == -1); in main() 58 printf("sendfile64(0, 1, NULL, %u) = -1 EBADF (%m)\n", page_size); in main() 68 if (file_size / 16 > page_size) in main() 69 file_size = page_size * 16; in main() 86 assert(syscall(__NR_sendfile64, 0, 1, p, page_size) == -1); in main() 87 printf("sendfile64(0, 1, %p, %u) = -1 EFAULT (%m)\n", p, page_size); in main()
|
/external/strace/tests-mx32/ |
D | tail_alloc.c | 35 const size_t page_size = get_page_size(); in tail_alloc() local 36 const size_t len = (size + page_size - 1) & -page_size; in tail_alloc() 37 const size_t alloc_size = len + 6 * page_size; in tail_alloc() 44 void *start_work = p + 3 * page_size; in tail_alloc() 47 if (munmap(p, page_size) || in tail_alloc() 48 munmap(p + 2 * page_size, page_size) || in tail_alloc() 49 munmap(tail_guard, page_size) || in tail_alloc() 50 munmap(tail_guard + 2 * page_size, page_size)) in tail_alloc()
|
D | sendfile64.c | 54 const unsigned int page_size = get_page_size(); in main() local 55 assert(syscall(__NR_sendfile64, 0, 1, NULL, page_size) == -1); in main() 58 printf("sendfile64(0, 1, NULL, %u) = -1 EBADF (%m)\n", page_size); in main() 68 if (file_size / 16 > page_size) in main() 69 file_size = page_size * 16; in main() 86 assert(syscall(__NR_sendfile64, 0, 1, p, page_size) == -1); in main() 87 printf("sendfile64(0, 1, %p, %u) = -1 EFAULT (%m)\n", p, page_size); in main()
|
/external/strace/tests/ |
D | tail_alloc.c | 35 const size_t page_size = get_page_size(); in tail_alloc() local 36 const size_t len = (size + page_size - 1) & -page_size; in tail_alloc() 37 const size_t alloc_size = len + 6 * page_size; in tail_alloc() 44 void *start_work = p + 3 * page_size; in tail_alloc() 47 if (munmap(p, page_size) || in tail_alloc() 48 munmap(p + 2 * page_size, page_size) || in tail_alloc() 49 munmap(tail_guard, page_size) || in tail_alloc() 50 munmap(tail_guard + 2 * page_size, page_size)) in tail_alloc()
|
D | sendfile64.c | 54 const unsigned int page_size = get_page_size(); in main() local 55 assert(syscall(__NR_sendfile64, 0, 1, NULL, page_size) == -1); in main() 58 printf("sendfile64(0, 1, NULL, %u) = -1 EBADF (%m)\n", page_size); in main() 68 if (file_size / 16 > page_size) in main() 69 file_size = page_size * 16; in main() 86 assert(syscall(__NR_sendfile64, 0, 1, p, page_size) == -1); in main() 87 printf("sendfile64(0, 1, %p, %u) = -1 EFAULT (%m)\n", p, page_size); in main()
|
/external/ltp/testcases/kernel/mem/mmapstress/ |
D | mmapstress04.c | 32 static int page_size; variable 37 page_size = getpagesize(); in setup() 43 mmap_area = SAFE_MMAP(NULL, page_size * NUM_PAGES, PROT_NONE, in setup() 64 if (tst_fill_file(TEST_FILE, 'b', page_size, 1)) in mmapstress04() 86 mapoff = page_size * (off_t)(6 * i + j); in mmapstress04() 87 SAFE_MMAP(mmap_area + page_size * mapped_pages++, in mmapstress04() 88 page_size, PROT_READ, in mmapstress04() 97 buf = SAFE_MALLOC(page_size); in mmapstress04() 98 memset(buf, 'a', page_size); in mmapstress04() 100 write_fully(rwfd, buf, page_size); in mmapstress04() [all …]
|
/external/ltp/testcases/kernel/syscalls/madvise/ |
D | madvise09.c | 67 static size_t page_size; variable 78 size_t i, page_size = getpagesize(); in memory_pressure_child() local 82 ptr = mmap(NULL, 500 * page_size, PROT_READ | PROT_WRITE, in memory_pressure_child() 86 ptr[i * page_size] = i % 100; in memory_pressure_child() 121 if (!ptr[i * page_size]) in count_freed() 138 for (i = 1; i < page_size; i++) { in check_page_baaa() 155 for (i = 0; i < page_size; i++) { in check_page() 178 ptr = SAFE_MMAP(NULL, PAGES * page_size, PROT_READ | PROT_WRITE, in child() 181 for (i = 0; i < PAGES * page_size; i++) in child() 184 if (madvise(ptr, PAGES * page_size, MADV_FREE)) { in child() [all …]
|
/external/linux-kselftest/tools/testing/selftests/powerpc/primitives/ |
D | load_unaligned_zeropad.c | 42 static int page_size; variable 47 if (mprotect(mem_region + page_size, page_size, PROT_NONE)) { in protect_region() 57 if (mprotect(mem_region + page_size, page_size, PROT_READ|PROT_WRITE)) { in unprotect_region() 129 page_size = getpagesize(); in test_body() 130 mem_region = mmap(NULL, page_size * 2, PROT_READ|PROT_WRITE, in test_body() 135 for (i = 0; i < page_size; i++) in test_body() 138 memset(mem_region+page_size, 0, page_size); in test_body() 142 for (i = 0; i < page_size; i++) in test_body()
|
/external/u-boot/tools/ |
D | sunxi-spl-image-builder.c | 24 int page_size; member 91 unsigned seedmod = info->eraseblock_size / info->page_size; in scramble() 126 memset(buffer, 0xff, info->page_size + info->oob_size); in write_page() 138 fwrite(buffer, info->page_size + info->oob_size, 1, dst); in write_page() 160 cnt = info->page_size + info->oob_size - offs; in write_page() 168 offs = info->page_size + (steps * (eccbytes + 4)); in write_page() 169 cnt = info->page_size + info->oob_size - offs; in write_page() 188 ecc_offs = info->page_size + 4 + (i * (eccbytes + 4)); in write_page() 228 fseek(dst, pos + info->page_size, SEEK_SET); in write_page() 233 fseek(dst, pos + info->page_size + info->oob_size, SEEK_SET); in write_page() [all …]
|
/external/ltp/testcases/kernel/syscalls/mincore/ |
D | mincore02.c | 46 static int page_size; variable 53 munlock(addr, page_size * num_pages); in cleanup() 54 munmap(addr, page_size * num_pages); in cleanup() 66 page_size = getpagesize(); in setup() 67 if (page_size == -1) in setup() 70 size = page_size * num_pages; in setup() 74 vec = malloc((size + page_size - 1) / page_size); in setup() 111 if (mincore(addr, num_pages * page_size, vec) == -1) { in main()
|
/external/ltp/testcases/kernel/syscalls/writev/ |
D | writev06.c | 57 int page_size; variable 174 page_size = getpagesize(); in setup() 178 bad_addr[0] = mmap(NULL, page_size * 3, PROT_NONE, in setup() 183 good_addr[0] = mmap(NULL, page_size, PROT_READ | PROT_WRITE, in setup() 188 bad_addr[1] = mmap(NULL, page_size * 3, PROT_NONE, in setup() 193 good_addr[1] = mmap(NULL, page_size, PROT_READ | PROT_WRITE, in setup() 199 memset(good_addr[0], 'a', page_size); in setup() 200 memset(good_addr[1], 'b', page_size); in setup() 202 wr_iovec[0].iov_base = good_addr[0] + page_size - 1; in setup() 203 wr_iovec[1].iov_base = good_addr[1] + page_size - 1; in setup()
|
/external/u-boot/common/ |
D | image-android.c | 31 return (ulong)hdr + hdr->page_size; in android_image_get_kernel_addr() 97 *os_data += hdr->page_size; in android_image_get_kernel() 117 end += hdr->page_size; in android_image_get_end() 118 end += ALIGN(hdr->kernel_size, hdr->page_size); in android_image_get_end() 119 end += ALIGN(hdr->ramdisk_size, hdr->page_size); in android_image_get_end() 120 end += ALIGN(hdr->second_size, hdr->page_size); in android_image_get_end() 142 *rd_data += hdr->page_size; in android_image_get_ramdisk() 143 *rd_data += ALIGN(hdr->kernel_size, hdr->page_size); in android_image_get_ramdisk() 208 *second_data += hdr->page_size; in android_image_get_second() 209 *second_data += ALIGN(hdr->kernel_size, hdr->page_size); in android_image_get_second() [all …]
|
/external/u-boot/drivers/mtd/spi/ |
D | sf_dataflash.c | 128 blocksize = spi_flash->page_size << 3; in spi_dataflash_erase() 135 div_u64_rem(len, spi_flash->page_size, &rem); in spi_dataflash_erase() 138 dev->name, len, spi_flash->page_size); in spi_dataflash_erase() 141 div_u64_rem(offset, spi_flash->page_size, &rem); in spi_dataflash_erase() 144 dev->name, offset, spi_flash->page_size); in spi_dataflash_erase() 161 pageaddr = div_u64(offset, spi_flash->page_size); in spi_dataflash_erase() 191 offset += spi_flash->page_size; in spi_dataflash_erase() 192 len -= spi_flash->page_size; in spi_dataflash_erase() 229 addr = (((unsigned)offset / spi_flash->page_size) in spi_dataflash_read() 231 + ((unsigned)offset % spi_flash->page_size); in spi_dataflash_read() [all …]
|
/external/linux-kselftest/tools/testing/selftests/kvm/lib/ |
D | kvm_util.c | 140 vm->page_size = 0x1000; in vm_create() 147 vm->page_size = 0x10000; in vm_create() 155 vm->page_size = 0x1000; in vm_create() 162 vm->page_size = 0x10000; in vm_create() 463 amt = vm->page_size - (ptr1 % vm->page_size); in kvm_memcmp_hva_gva() 465 amt = vm->page_size - (ptr2 % vm->page_size); in kvm_memcmp_hva_gva() 517 size_t huge_page_size = KVM_UTIL_PGS_PER_HUGEPG * vm->page_size; in vm_userspace_mem_region_add() 519 TEST_ASSERT((guest_paddr % vm->page_size) == 0, "Guest physical " in vm_userspace_mem_region_add() 522 guest_paddr, vm->page_size); in vm_userspace_mem_region_add() 528 guest_paddr, npages, vm->max_gfn, vm->page_size); in vm_userspace_mem_region_add() [all …]
|
/external/compiler-rt/test/sanitizer_common/TestCases/Linux/ |
D | signal_segv_handler.cc | 23 unsigned long page_size; variable 27 mprotect(guard, page_size, PROT_READ | PROT_WRITE); in handler() 31 page_size = sysconf(_SC_PAGESIZE); in main() 38 guard = mmap(0, 3 * page_size, PROT_NONE, MAP_ANON | MAP_PRIVATE, -1, 0); in main() 39 guard = (char*)guard + page_size; // work around a kernel bug in main() 41 mprotect(guard, page_size, PROT_NONE); in main()
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/ |
D | 24-2.c | 44 unsigned long page_size = sysconf(_SC_PAGE_SIZE); in main() local 46 shm_size = 2 * page_size; in main() 82 if ((unsigned long)addr % page_size) { in main() 84 addr += page_size; in main() 85 addr = (void *)((unsigned long)addr & ~(page_size - 1)); in main() 87 if (len % page_size) { in main() 89 len &= ~(page_size - 1); in main()
|
/external/v8/src/base/ |
D | sys-info.cc | 67 int pages, page_size; in AmountOfPhysicalMemory() 70 sysctlbyname("vm.stats.vm.v_page_size", &page_size, &size, nullptr, 0); in AmountOfPhysicalMemory() 71 if (pages == -1 || page_size == -1) { in AmountOfPhysicalMemory() 74 return static_cast<int64_t>(pages) * page_size; in AmountOfPhysicalMemory() 95 long page_size = sysconf(_SC_PAGESIZE); // NOLINT(runtime/int) in AmountOfPhysicalMemory() 96 if (pages == -1 || page_size == -1) { in AmountOfPhysicalMemory() 99 return static_cast<int64_t>(pages) * page_size; in AmountOfPhysicalMemory()
|
/external/ltp/testcases/kernel/syscalls/migrate_pages/ |
D | migrate_pages03.c | 50 static unsigned int page_size; variable 81 page_size = getpagesize(); in setup() 84 test_pages[n] = SAFE_MMAP(NULL, page_size, PROT_READ | PROT_WRITE | PROT_EXEC, in setup() 86 if (madvise(test_pages[n], page_size, MADV_MERGEABLE)) { in setup() 96 if (mbind(test_pages[n], page_size, MPOL_BIND, new_nodes[0], in setup() 100 memset(test_pages[n], 0, page_size); in setup() 114 SAFE_MUNMAP(test_pages[n], page_size); in cleanup()
|