Home
last modified time | relevance | path

Searched refs:page_size (Results 1 – 25 of 258) sorted by relevance

1234567891011

/external/linux-kselftest/tools/testing/selftests/vm/
Dmlock2-tests.c228 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 …]
Dmap_fixed_noreplace.c33 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 …]
Duserfaultfd.c62 static unsigned long nr_cpus, nr_pages, nr_pages_per_cpu, page_size; variable
91 ((pthread_mutex_t *) ((___area) + (___nr)*page_size))
98 ((___area) + (___nr)*page_size + \
132 if (madvise(rel_area, nr_pages * page_size, MADV_DONTNEED)) { in anon_release_pages()
142 if (posix_memalign(alloc_area, page_size, nr_pages * page_size)) { in anon_allocate_area()
159 nr_pages * page_size, in hugetlb_release_pages()
160 nr_pages * page_size)) { in hugetlb_release_pages()
173 *alloc_area = mmap(NULL, nr_pages * page_size, PROT_READ | PROT_WRITE, in hugetlb_allocate_area()
177 nr_pages * page_size); in hugetlb_allocate_area()
184 area_alias = mmap(NULL, nr_pages * page_size, PROT_READ | PROT_WRITE, in hugetlb_allocate_area()
[all …]
/external/compiler-rt/lib/sanitizer_common/tests/
Dsanitizer_posix_test.cc63 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-mx32/
Dtail_alloc.c35 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()
/external/strace/tests-m32/
Dtail_alloc.c35 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()
/external/strace/tests/
Dtail_alloc.c35 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()
Dsendfile64.c54 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/u-boot/drivers/mtd/nand/raw/
Dfsl_ifc_spl.c18 static inline int is_blank(uchar *addr, int page_size) in is_blank() argument
22 for (i = 0; i < page_size; i++) { in is_blank()
36 unsigned int bufnum, int page_size) in check_read_ecc() argument
43 if (is_blank(buf, page_size)) in check_read_ecc()
68 static inline void nand_wait(uchar *buf, int bufnum, int page_size) in nand_wait() argument
73 int bufperpage = page_size / 512; in nand_wait()
93 if (check_read_ecc(buf, eccstat, i, page_size)) in nand_wait()
113 int page_size; in nand_spl_load_image() local
137 page_size = 8192; in nand_spl_load_image()
140 page_size = 4096; in nand_spl_load_image()
[all …]
Dsunxi_nand_spl.c86 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/ltp/testcases/kernel/mem/mmapstress/
Dmmapstress04.c20 static int page_size; variable
25 page_size = getpagesize(); in setup()
31 mmap_area = SAFE_MMAP(NULL, page_size * NUM_PAGES, PROT_NONE, in setup()
52 if (tst_fill_file(TEST_FILE, 'b', page_size, 1)) in mmapstress04()
74 mapoff = page_size * (off_t)(6 * i + j); in mmapstress04()
75 SAFE_MMAP(mmap_area + page_size * mapped_pages++, in mmapstress04()
76 page_size, PROT_READ, in mmapstress04()
85 buf = SAFE_MALLOC(page_size); in mmapstress04()
86 memset(buf, 'a', page_size); in mmapstress04()
88 write_fully(rwfd, buf, page_size); in mmapstress04()
[all …]
/external/ltp/testcases/kernel/syscalls/madvise/
Dmadvise09.c55 static size_t page_size; variable
66 size_t i, page_size = getpagesize(); in memory_pressure_child() local
70 ptr = mmap(NULL, 500 * page_size, PROT_READ | PROT_WRITE, in memory_pressure_child()
74 ptr[i * page_size] = i % 100; in memory_pressure_child()
109 if (!ptr[i * page_size]) in count_freed()
126 for (i = 1; i < page_size; i++) { in check_page_baaa()
143 for (i = 0; i < page_size; i++) { in check_page()
166 ptr = SAFE_MMAP(NULL, PAGES * page_size, PROT_READ | PROT_WRITE, in child()
169 for (i = 0; i < PAGES * page_size; i++) in child()
172 if (madvise(ptr, PAGES * page_size, MADV_FREE)) { in child()
[all …]
/external/linux-kselftest/tools/testing/selftests/powerpc/primitives/
Dload_unaligned_zeropad.c38 static int page_size; variable
43 if (mprotect(mem_region + page_size, page_size, PROT_NONE)) { in protect_region()
53 if (mprotect(mem_region + page_size, page_size, PROT_READ|PROT_WRITE)) { in unprotect_region()
125 page_size = getpagesize(); in test_body()
126 mem_region = mmap(NULL, page_size * 2, PROT_READ|PROT_WRITE, in test_body()
131 for (i = 0; i < page_size; i++) in test_body()
134 memset(mem_region+page_size, 0, page_size); in test_body()
138 for (i = 0; i < page_size; i++) in test_body()
/external/u-boot/common/
Dimage-android.c32 return (ulong)hdr + hdr->page_size; in android_image_get_kernel_addr()
57 ((uintptr_t)hdr + hdr->page_size); in android_image_get_kernel()
103 *os_data += hdr->page_size; in android_image_get_kernel()
129 end += hdr->page_size; in android_image_get_end()
130 end += ALIGN(hdr->kernel_size, hdr->page_size); in android_image_get_end()
131 end += ALIGN(hdr->ramdisk_size, hdr->page_size); in android_image_get_end()
132 end += ALIGN(hdr->second_size, hdr->page_size); in android_image_get_end()
135 end += ALIGN(hdr->recovery_dtbo_size, hdr->page_size); in android_image_get_end()
138 end += ALIGN(hdr->dtb_size, hdr->page_size); in android_image_get_end()
150 const void *p = (void *)((uintptr_t)hdr + hdr->page_size); in android_image_get_kcomp()
[all …]
/external/linux-kselftest/tools/testing/selftests/bpf/prog_tests/
Dmmap.c16 long page_size = sysconf(_SC_PAGE_SIZE); in roundup_page() local
17 return (sz + page_size - 1) / page_size * page_size; in roundup_page()
28 const long page_size = sysconf(_SC_PAGE_SIZE); in test_mmap() local
171 tmp1 = mmap(NULL, 3 * page_size, PROT_READ, MAP_SHARED, in test_mmap()
177 err = munmap(tmp1 + page_size, page_size); in test_mmap()
184 tmp2 = mmap(tmp1 + page_size, page_size, PROT_READ, in test_mmap()
187 munmap(tmp1, page_size); in test_mmap()
188 munmap(tmp1 + 2*page_size, page_size); in test_mmap()
191 CHECK(tmp1 + page_size != tmp2, "adv_mmap4", in test_mmap()
195 tmp2 = mmap(tmp1, 4 * page_size, PROT_READ, MAP_SHARED | MAP_FIXED, in test_mmap()
[all …]
/external/ltp/testcases/kernel/syscalls/mincore/
Dmincore02.c46 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/u-boot/tools/
Dsunxi-spl-image-builder.c24 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/writev/
Dwritev06.c57 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/ltp/lib/
Dtst_buffers.c48 size_t page_size = getpagesize(); in tst_alloc() local
49 unsigned int pages = (size / page_size) + !!(size % page_size) + 1; in tst_alloc()
59 ret = SAFE_MMAP(NULL, page_size * pages, PROT_READ | PROT_WRITE, in tst_alloc()
62 mprotect(ret + (pages-1) * page_size, page_size, PROT_NONE); in tst_alloc()
65 map->size = pages * page_size; in tst_alloc()
69 if (size % page_size) in tst_alloc()
70 map->buf_shift = page_size - (size % page_size); in tst_alloc()
/external/linux-kselftest/tools/testing/selftests/kvm/lib/s390x/
Dprocessor.c22 TEST_ASSERT(vm->page_size == 4096, "Unsupported page size: 0x%x", in virt_pgd_alloc()
23 vm->page_size); in virt_pgd_alloc()
30 memset(addr_gpa2hva(vm, paddr), 0xff, PAGES_PER_REGION * vm->page_size); in virt_pgd_alloc()
47 memset(addr_gpa2hva(vm, taddr), 0xff, PAGES_PER_REGION * vm->page_size); in virt_alloc_region()
76 TEST_ASSERT((gva % vm->page_size) == 0, in virt_pg_map()
79 gva, vm->page_size); in virt_pg_map()
84 TEST_ASSERT((gpa % vm->page_size) == 0, in virt_pg_map()
87 gva, vm->page_size); in virt_pg_map()
91 gva, vm->max_gfn, vm->page_size); in virt_pg_map()
135 TEST_ASSERT(vm->page_size == 4096, "Unsupported page size: 0x%x", in addr_gva2gpa()
[all …]
/external/arm-trusted-firmware/drivers/mtd/nand/
Dcore.c30 (offset % nand_dev.block_size) / nand_dev.page_size; in nand_read()
31 unsigned int nb_pages = nand_dev.block_size / nand_dev.page_size; in nand_read()
32 unsigned int start_offset = offset % nand_dev.page_size; in nand_read()
43 if (((start_offset != 0U) || (length % nand_dev.page_size) != 0U) && in nand_read()
44 (sizeof(scratch_buff) < nand_dev.page_size)) { in nand_read()
70 (length < nand_dev.page_size)) { in nand_read()
79 bytes_read = MIN((size_t)(nand_dev.page_size - in nand_read()
96 bytes_read = nand_dev.page_size; in nand_read()
/external/ltp/testcases/kernel/syscalls/userfaultfd/
Duserfaultfd01.c23 static int page_size; variable
35 page_size = sysconf(_SC_PAGE_SIZE); in set_pages()
36 page = SAFE_MMAP(NULL, page_size, PROT_READ | PROT_WRITE, in set_pages()
38 copy_page = SAFE_MMAP(NULL, page_size, PROT_READ | PROT_WRITE, in set_pages()
63 memset(copy_page, 'X', page_size); in handle_thread()
68 & ~(page_size - 1); in handle_thread()
69 uffdio_copy.len = page_size; in handle_thread()
103 uffdio_register.range.len = page_size; in run()
/external/compiler-rt/test/sanitizer_common/TestCases/Linux/
Dsignal_segv_handler.cc23 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/u-boot/drivers/mtd/spi/
Dsf_dataflash.c131 blocksize = spi_flash->page_size << 3; in spi_dataflash_erase()
138 div_u64_rem(len, spi_flash->page_size, &rem); in spi_dataflash_erase()
141 dev->name, len, spi_flash->page_size); in spi_dataflash_erase()
144 div_u64_rem(offset, spi_flash->page_size, &rem); in spi_dataflash_erase()
147 dev->name, offset, spi_flash->page_size); in spi_dataflash_erase()
164 pageaddr = div_u64(offset, spi_flash->page_size); in spi_dataflash_erase()
194 offset += spi_flash->page_size; in spi_dataflash_erase()
195 len -= spi_flash->page_size; in spi_dataflash_erase()
232 addr = (((unsigned)offset / spi_flash->page_size) in spi_dataflash_read()
234 + ((unsigned)offset % spi_flash->page_size); in spi_dataflash_read()
[all …]
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/
D24-2.c44 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()

1234567891011