/external/ltp/testcases/kernel/mem/mmapstress/ |
D | mmapstress03.c | 67 static void do_test(void* brk_max, long pagesize); 72 size_t pagesize = (size_t) sysconf(_SC_PAGE_SIZE); in main() local 79 if ((u_long) brk_start % (u_long) pagesize) { in main() 80 if (sbrk(pagesize - ((u_long) brk_start % (u_long) pagesize)) in main() 88 if ((hole_addr = hole_start = sbrk(NUM_SEGS * 2 * pagesize)) == NEG1) { in main() 96 do_test((void*) brk_max_addr, pagesize); in main() 99 while (hole_addr + pagesize < brk_max_addr) { in main() 100 if (munmap(hole_addr, pagesize) == -1) { in main() 104 hole_addr += 2 * pagesize; in main() 111 do_test((void*) brk_max_addr, pagesize); in main() [all …]
|
D | mmapstress05.c | 62 if (munmap(mmapaddr+pagesize, pagesize) == -1) { \ 65 if (munmap(mmapaddr, pagesize) == -1) { \ 68 if (munmap(mmapaddr+2*pagesize, pagesize) == -1) { \ 106 size_t pagesize = (size_t) sysconf(_SC_PAGE_SIZE); in main() local 121 if (sbrk(pagesize - ((ulong) sbrk(0) & (pagesize - 1))) == (char *)-1) { in main() 125 if ((buf = sbrk(pagesize)) == (char *)-1) { in main() 153 for (i = 0; i < pagesize; i++) in main() 155 if (write(fd, buf, pagesize) != pagesize) { in main() 159 if (lseek(fd, MMU_NARROWPTEPG * pagesize, SEEK_SET) == -1) { in main() 163 if (write(fd, buf, pagesize) != pagesize) { in main() [all …]
|
D | mmapstress07.c | 87 size_t pagesize = (size_t) sysconf(_SC_PAGE_SIZE); local 127 holesize = pagesize; 141 sparseoff = pagesize * 2; 178 while (i < pagesize && write(rwfd, "a", 1) == 1) 180 if (i != pagesize) { 194 while (i < (pagesize >> 1) && write(rwfd, "b", 1) == 1) 196 if (i != (pagesize >> 1)) { 205 if ((mapaddr = mmap64((caddr_t) 0, pagesize * 2 + holesize, PROT_READ, 209 if ((mapaddr = mmap((caddr_t) 0, pagesize * 2 + holesize, PROT_READ, 217 while (i < 2 * pagesize && write(rwfd, "c", 1) == 1) [all …]
|
D | mmapstress01.c | 147 int pagesize = sysconf(_SC_PAGE_SIZE); local 210 if (sparseoffset % pagesize != 0) { 291 if ((buf = malloc(pagesize)) == NULL 300 for (i = 0, data = 0; i < pagesize; i++) { 314 write_cnt = min(pagesize, bytes_left); 473 size_t pagesize = sysconf(_SC_PAGE_SIZE); local 507 mappages = roundup(mapsize, pagesize) / pagesize; 511 int byteoffset = pageoffset * pagesize; 523 offset / pagesize, nloops); 528 offset / pagesize, nloops); [all …]
|
D | mmapstress02.c | 83 size_t pagesize = sysconf(_SC_PAGE_SIZE); in main() local 111 if (sbrk(2 * pagesize - ((ulong) sbrk(0) & (pagesize - 1))) == in main() 123 for (i = pagesize; i; i--) in main() 125 if (write(fd, (char *)mmapaddr - pagesize, pagesize) != pagesize) { in main() 129 if (mmap(mmapaddr, pagesize, PROT_NONE, in main() 142 if (read(fd, (char *)mmapaddr, pagesize) != -1) { in main() 150 if (write(fd, (char *)mmapaddr, pagesize) != -1) { in main() 162 if (munmap(mmapaddr, pagesize) == -1) { in main()
|
D | mmapstress10.c | 175 int pagesize = sysconf(_SC_PAGE_SIZE); local 254 if (sparseoffset % pagesize != 0) { 334 if ((buf = malloc(pagesize + growsize)) == NULL 343 for (i = 0, data = 0; i < pagesize; i++) { 348 for (data = 0; i < pagesize + growsize; i++) { 364 write_cnt = min(pagesize, bytes_left); 535 int pagesize = sysconf(_SC_PAGE_SIZE); local 583 mappages = roundup(mapsize_mapper, pagesize) / pagesize; 587 int byteoffset = pageoffset * pagesize; 614 offset / pagesize, nloops); [all …]
|
D | mmapstress09.c | 106 int pagesize; variable 132 pagesize = sysconf(_SC_PAGE_SIZE); in main() 200 if ((buf = malloc(pagesize)) == NULL in main() 213 for (i = 0, data = 0; i < pagesize; i++) { in main() 219 mappages = roundup(mapsize, pagesize) / pagesize; in main() 223 for (j = 0; j < pagesize; j++) in main() 398 paddr = (uchar_t *) (mapaddr + (randpage * pagesize)); in child_mapper() 400 for (i = procno; i < pagesize; i += nprocs) { in child_mapper() 423 paddr = (uchar_t *) mapaddr + (randpage * pagesize); in child_mapper() 424 if (msync((caddr_t) paddr, (mappages - randpage) * pagesize, in child_mapper() [all …]
|
D | mmapstress08.c | 65 long pagesize = sysconf(_SC_PAGE_SIZE); in main() local 71 if (sbrk(pagesize - ((u_long) sbrk(0) % (u_long) pagesize)) == in main() 87 if (mmap(mmapaddr, pagesize, PROT_READ | PROT_WRITE, in main() 93 mmapaddr += NPTEPG * pagesize; in main()
|
/external/ltp/testcases/kernel/mem/vma/ |
D | vma04.c | 58 static unsigned long pagesize; variable 128 addr = SAFE_MMAP(cleanup, NULL, pagesize * 8, PROT_NONE, in init() 130 SAFE_MMAP(cleanup, addr + pagesize, pagesize * 6, in init() 134 mmap_addr = addr + pagesize; in init() 135 memset(mmap_addr, 0, pagesize * 6); in init() 142 addr = mmap_addr - pagesize; in fin() 143 SAFE_MUNMAP(cleanup, addr, pagesize * 8); in fin() 150 if (mbind(mmap_addr + pagesize * index, pagesize * len, in mem_bind() 163 if (mbind(mmap_addr + pagesize * index, pagesize * len, in mem_interleave() 176 if (mbind(mmap_addr + pagesize * index, pagesize * len, in mem_unbind() [all …]
|
D | vma02.c | 54 static unsigned long pagesize; variable 72 pagesize = getpagesize(); in main() 88 addr = mmap(NULL, pagesize * 3, PROT_WRITE, in main() 95 memset(addr, 0, pagesize * 3); in main() 98 err = mbind(addr + pagesize, pagesize, MPOL_BIND, nmask->maskp, in main() 109 err = mbind(addr, pagesize * 3, MPOL_DEFAULT, NULL, 0, 0); in main() 126 if (end == addr + pagesize * 3) { in main() 143 if (end == addr + pagesize * 3) { in main() 149 if (end != addr + pagesize * 3) in main() 155 if (munmap(addr, pagesize * 3) == -1) in main()
|
/external/strace/tests-mx32/ |
D | ioctl_uffdio.c | 55 size_t pagesize = getpagesize(); in main() local 92 void *area1 = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, in main() 97 void *area2 = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, in main() 102 madvise(area2, pagesize, MADV_DONTNEED); in main() 119 register_struct->range.len = pagesize; in main() 125 fd, area2, pagesize); in main() 151 copy_struct->len = pagesize; in main() 156 fd, area2, area1, pagesize, pagesize, rc); in main() 160 madvise(area2, pagesize, MADV_DONTNEED); in main() 172 zero_struct->range.len = pagesize; in main() [all …]
|
D | mmap.c | 40 const intmax_t pagesize = get_page_size(); in main() local 41 const unsigned long length1 = pagesize * 6; in main() 42 const unsigned long length2 = pagesize * 3; in main() 43 const unsigned long length3 = pagesize * 2; in main() 49 offset = 0xcafedeadbeef000ULL & -pagesize; in main() 50 addr = (void *) (uintmax_t) (0xfacefeed000 & -pagesize); in main() 52 offset = 0xdeadbeef000ULL & -pagesize; in main() 53 addr = (void *) (unsigned int) (0xfaced000 & -pagesize); in main()
|
/external/strace/tests-m32/ |
D | ioctl_uffdio.c | 55 size_t pagesize = getpagesize(); in main() local 92 void *area1 = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, in main() 97 void *area2 = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, in main() 102 madvise(area2, pagesize, MADV_DONTNEED); in main() 119 register_struct->range.len = pagesize; in main() 125 fd, area2, pagesize); in main() 151 copy_struct->len = pagesize; in main() 156 fd, area2, area1, pagesize, pagesize, rc); in main() 160 madvise(area2, pagesize, MADV_DONTNEED); in main() 172 zero_struct->range.len = pagesize; in main() [all …]
|
D | mmap.c | 40 const intmax_t pagesize = get_page_size(); in main() local 41 const unsigned long length1 = pagesize * 6; in main() 42 const unsigned long length2 = pagesize * 3; in main() 43 const unsigned long length3 = pagesize * 2; in main() 49 offset = 0xcafedeadbeef000ULL & -pagesize; in main() 50 addr = (void *) (uintmax_t) (0xfacefeed000 & -pagesize); in main() 52 offset = 0xdeadbeef000ULL & -pagesize; in main() 53 addr = (void *) (unsigned int) (0xfaced000 & -pagesize); in main()
|
/external/strace/tests/ |
D | ioctl_uffdio.c | 55 size_t pagesize = getpagesize(); in main() local 92 void *area1 = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, in main() 97 void *area2 = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, in main() 102 madvise(area2, pagesize, MADV_DONTNEED); in main() 119 register_struct->range.len = pagesize; in main() 125 fd, area2, pagesize); in main() 151 copy_struct->len = pagesize; in main() 156 fd, area2, area1, pagesize, pagesize, rc); in main() 160 madvise(area2, pagesize, MADV_DONTNEED); in main() 172 zero_struct->range.len = pagesize; in main() [all …]
|
D | mmap.c | 40 const intmax_t pagesize = get_page_size(); in main() local 41 const unsigned long length1 = pagesize * 6; in main() 42 const unsigned long length2 = pagesize * 3; in main() 43 const unsigned long length3 = pagesize * 2; in main() 49 offset = 0xcafedeadbeef000ULL & -pagesize; in main() 50 addr = (void *) (uintmax_t) (0xfacefeed000 & -pagesize); in main() 52 offset = 0xdeadbeef000ULL & -pagesize; in main() 53 addr = (void *) (unsigned int) (0xfaced000 & -pagesize); in main()
|
/external/ltp/testcases/kernel/syscalls/mremap/ |
D | mremap05.c | 118 static int pagesize; variable 164 t->old_address = get_test_area(t->old_size * pagesize, 0); in setup0() 165 t->new_address = get_test_area(t->new_size * pagesize, 1); in setup0() 170 t->old_address = get_test_area(t->old_size * pagesize, 0); in setup1() 171 t->new_address = get_test_area((t->new_size + 1) * pagesize, 1) + 1; in setup1() 176 t->old_address = get_test_area(t->old_size * pagesize, 0); in setup2() 182 t->old_address = get_test_area(t->old_size * pagesize, 0); in setup3() 183 t->new_address = get_test_area(t->new_size * pagesize, 1); in setup3() 190 t->old_address = get_test_area(t->old_size * pagesize, 0); in setup4() 191 t->new_address = get_test_area(t->new_size * pagesize, 0); in setup4() [all …]
|
/external/ltp/testcases/kernel/controllers/cpuset/cpuset_memory_pressure_test/ |
D | cpuset_memory_pressure.c | 48 long int pagesize = getpagesize(); in main() local 49 long int mmap_block = use * unit / 10 / pagesize; in main() 52 while (pagesize * mmap_block > 2 * unit) { in main() 53 unsigned long *addr = mmap(NULL, pagesize * mmap_block, in main() 60 memset(addr, 0xF7, pagesize * mmap_block); in main() 62 if (total_block * pagesize >= use * unit) in main()
|
/external/autotest/client/tests/rmaptest/src/ |
D | rmap-test.c | 27 int pagesize; variable 74 p[page * pagesize]++; in touch_pages() 85 msync(p, vmasize * pagesize, MS_ASYNC); in msync_file() 104 p = vma_addresses[rand_vma] + rand_page * pagesize; in touch_random_pages() 188 pagesize = getpagesize(); in main() 194 file_size *= pagesize; in main() 198 ((long long)nvmas * vmasize * pagesize) / 1024); in main() 221 p = mmap(0, vmasize * pagesize, PROT_READ|PROT_WRITE, in main() 228 offset += vmasize * pagesize + pagesize; in main()
|
/external/ltp/testcases/kernel/syscalls/msync/ |
D | msync04.c | 31 static long pagesize; variable 42 index = (addr / pagesize) * sizeof(uint64_t); in get_dirty_bit() 64 mmaped_area = SAFE_MMAP(NULL, pagesize, PROT_READ | PROT_WRITE, in test_msync() 74 if (msync(mmaped_area, pagesize, MS_SYNC) < 0) { in test_msync() 86 SAFE_MUNMAP(mmaped_area, pagesize); in test_msync() 92 pagesize = (off_t)SAFE_SYSCONF(_SC_PAGESIZE); in setup() 98 SAFE_MUNMAP(mmaped_area, pagesize); in cleanup()
|
/external/selinux/libselinux/src/ |
D | sestatus.c | 259 long pagesize; in selinux_status_open() local 266 pagesize = sysconf(_SC_PAGESIZE); in selinux_status_open() 267 if (pagesize < 0) in selinux_status_open() 275 selinux_status = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, fd, 0); in selinux_status_open() 325 long pagesize; in selinux_status_close() local 340 pagesize = sysconf(_SC_PAGESIZE); in selinux_status_close() 342 if (pagesize > 0) in selinux_status_close() 343 munmap(selinux_status, pagesize); in selinux_status_close()
|
/external/u-boot/arch/powerpc/cpu/mpc85xx/ |
D | mp.c | 179 u32 determine_mp_bootpg(unsigned int *pagesize) in determine_mp_bootpg() argument 193 if (pagesize) in determine_mp_bootpg() 194 *pagesize = 4096; in determine_mp_bootpg() 216 if (pagesize) in determine_mp_bootpg() 217 *pagesize = 8192; in determine_mp_bootpg() 249 static void plat_mp_up(unsigned long bootpg, unsigned int pagesize) in plat_mp_up() argument 272 if (pagesize == 8192) in plat_mp_up() 328 static void plat_mp_up(unsigned long bootpg, unsigned int pagesize) in plat_mp_up() argument 420 u32 bootpg, bootpg_map, pagesize; in setup_mp() local 422 bootpg = determine_mp_bootpg(&pagesize); in setup_mp() [all …]
|
/external/u-boot/arch/arm/mach-at91/arm926ejs/ |
D | eflash.c | 59 static u32 pagesize; variable 84 pagesize = readl(&eefc->frr); /* word 2 */ in flash_init() 88 id, size, pagesize, nplanes, planesize); in flash_init() 154 u32 pagenum = (info->start[sector]-ATMEL_BASE_FLASH)/pagesize; in flash_real_protect() 228 if (addr % pagesize) { in write_buff() 235 pagenum = (addr-ATMEL_BASE_FLASH)/pagesize; in write_buff() 239 i = pagesize / 4; in write_buff() 247 if (cnt > pagesize) in write_buff() 248 cnt -= pagesize; in write_buff()
|
/external/u-boot/drivers/mtd/onenand/ |
D | onenand_spl.c | 82 enum onenand_spl_pagesize pagesize) in onenand_spl_read_page() argument 110 for (offset = 0; offset < pagesize; offset += 4) in onenand_spl_read_page() 173 enum onenand_spl_pagesize pagesize; in onenand_spl_load_image() local 176 pagesize = onenand_spl_get_geometry(); in onenand_spl_load_image() 182 if (pagesize == 2048) { in onenand_spl_load_image() 193 ret = onenand_spl_read_page(block, rpage, addr, pagesize); in onenand_spl_load_image() 197 addr += pagesize / 4; in onenand_spl_load_image()
|
/external/ltp/testcases/kernel/syscalls/madvise/ |
D | madvise02.c | 62 static long pagesize; variable 150 pagesize = getpagesize(); in setup() 153 for (i = 0; i < (pagesize / 2); i++) in setup() 167 tmp_addr = (void*)LTP_ALIGN((long)ptr_addr, pagesize); in setup() 170 SAFE_MUNMAP(file2 + st.st_size - pagesize, pagesize); in setup() 205 SAFE_MUNMAP(file2, st.st_size - pagesize); in cleanup()
|