Home
last modified time | relevance | path

Searched refs:page_sz (Results 1 – 23 of 23) sorted by relevance

/external/ltp/testcases/kernel/syscalls/mprotect/
Dmprotect04.c58 static unsigned int page_sz; variable
91 page_sz = getpagesize(); in setup()
102 addr = SAFE_MMAP(cleanup, 0, page_sz, PROT_READ | PROT_WRITE, in testfunc_protnone()
106 TEST(mprotect(addr, page_sz, PROT_NONE)); in testfunc_protnone()
128 SAFE_MUNMAP(cleanup, addr, page_sz); in testfunc_protnone()
212 uintptr_t page_sz = getpagesize(); in get_func() local
213 uintptr_t page_mask = ~(page_sz - 1); in get_func()
219 *func_page_offset = (uintptr_t)opd->entry & (page_sz - 1); in get_func()
223 *func_page_offset = (uintptr_t)&exec_func & (page_sz - 1); in get_func()
235 TEST(mprotect(page_to_copy, page_sz, PROT_READ | PROT_EXEC)); in get_func()
[all …]
/external/ltp/testcases/kernel/syscalls/remap_file_pages/
Dremap_file_pages01.c94 static int page_sz; variable
153 char *page = cache_contents + i * page_sz; in test_nonlinear()
177 char *page = data + i * page_sz; in test_nonlinear()
179 if (remap_file_pages(page, page_sz * 2, 0, in test_nonlinear()
184 page, (page_sz * 2), (window_pages - i - 2)); in test_nonlinear()
194 if (data[i * page_sz] != window_pages - i) { in test_nonlinear()
198 (i * page_sz), data[i * page_sz], i, in test_nonlinear()
203 if (data[i * page_sz] != window_pages - i - 2) { in test_nonlinear()
207 (i * page_sz), data[i * page_sz], i, in test_nonlinear()
231 page_sz = getpagesize(); in setup()
[all …]
Dremap_file_pages02.c48 static unsigned int page_sz; variable
98 tcases[test].size = page_sz; in setup01()
103 tcases[test].start = data + page_sz; in setup02()
104 tcases[test].size = page_sz; in setup02()
110 tcases[test].size = 2 * page_sz; in setup03()
116 tcases[test].size = page_sz; in setup04()
130 page_sz = getpagesize(); in setup()
133 SAFE_FTRUNCATE(fd, page_sz); in setup()
135 data = SAFE_MMAP((void *)WINDOW_START, page_sz, PROT_READ | PROT_WRITE, in setup()
138 data01 = SAFE_MMAP(NULL, page_sz, PROT_READ | PROT_WRITE, MAP_PRIVATE, in setup()
[all …]
/external/ltp/testcases/kernel/syscalls/mmap/
Dmmap04.c57 static size_t page_sz; variable
82 addr = mmap(0, page_sz, PROT_READ | PROT_EXEC, in main()
95 if (read(fildes, dummy, page_sz) < 0) { in main()
104 if (memcmp(dummy, addr, page_sz)) { in main()
115 if (munmap(addr, page_sz) != 0) { in main()
132 page_sz = getpagesize(); in setup()
134 if ((tst_buff = calloc(page_sz, sizeof(char))) == NULL) { in setup()
139 memset(tst_buff, 'A', page_sz); in setup()
150 if (write(fildes, tst_buff, page_sz) < page_sz) { in setup()
169 if ((dummy = calloc(page_sz, sizeof(char))) == NULL) { in setup()
Dmmap02.c55 static size_t page_sz; variable
78 addr = mmap(0, page_sz, PROT_READ, in main()
91 if (read(fildes, dummy, page_sz) < 0) { in main()
100 if (memcmp(dummy, addr, page_sz)) { in main()
110 if (munmap(addr, page_sz) != 0) { in main()
127 page_sz = getpagesize(); in setup()
130 if ((tst_buff = calloc(page_sz, sizeof(char))) == NULL) { in setup()
135 memset(tst_buff, 'A', page_sz); in setup()
147 if (write(fildes, tst_buff, page_sz) < page_sz) { in setup()
175 if ((dummy = calloc(page_sz, sizeof(char))) == NULL) { in setup()
Dmmap03.c60 static size_t page_sz; variable
88 addr = mmap(0, page_sz, PROT_EXEC, in main()
102 if (read(fildes, dummy, page_sz) < 0) { in main()
117 if (memcmp(dummy, addr, page_sz)) { in main()
138 if (munmap(addr, page_sz) != 0) { in main()
158 page_sz = getpagesize(); in setup()
161 if ((tst_buff = calloc(page_sz, sizeof(char))) == NULL) { in setup()
166 memset(tst_buff, 'A', page_sz); in setup()
178 if (write(fildes, tst_buff, page_sz) < page_sz) { in setup()
199 if ((dummy = calloc(page_sz, sizeof(char))) == NULL) { in setup()
Dmmap06.c52 static size_t page_sz; variable
76 addr = mmap(0, page_sz, PROT_READ, in main()
86 if (munmap(addr, page_sz) != 0) { in main()
112 page_sz = getpagesize(); in setup()
115 if ((tst_buff = calloc(page_sz, sizeof(char))) == NULL) { in setup()
120 memset(tst_buff, 'A', page_sz); in setup()
131 if (write(fildes, tst_buff, page_sz) < page_sz) { in setup()
Dmmap07.c53 static size_t page_sz; variable
77 addr = mmap(0, page_sz, PROT_WRITE, in main()
87 if (munmap(addr, page_sz) != 0) { in main()
114 page_sz = getpagesize(); in setup()
117 if ((tst_buff = calloc(page_sz, sizeof(char))) == NULL) { in setup()
123 memset(tst_buff, 'A', page_sz); in setup()
134 if (write(fildes, tst_buff, page_sz) < page_sz) { in setup()
Dmmap08.c48 static size_t page_sz; variable
72 addr = mmap(0, page_sz, PROT_WRITE, in main()
81 if (munmap(addr, page_sz) != 0) { in main()
106 page_sz = getpagesize(); in setup()
108 if ((tst_buff = calloc(page_sz, sizeof(char))) == NULL) { in setup()
114 memset(tst_buff, 'A', page_sz); in setup()
125 if (write(fildes, tst_buff, page_sz) != page_sz) { in setup()
Dmmap05.c57 static size_t page_sz; variable
85 addr = mmap(0, page_sz, PROT_NONE, in main()
117 if (munmap((void *)addr, page_sz) != 0) { in main()
136 page_sz = getpagesize(); in setup()
139 if ((tst_buff = calloc(page_sz, sizeof(char))) == NULL) { in setup()
144 memset(tst_buff, 'A', page_sz); in setup()
156 if (write(fildes, tst_buff, page_sz) != page_sz) { in setup()
Dmmap01.c58 static size_t page_sz; variable
83 addr = mmap(NULL, page_sz, PROT_READ | PROT_WRITE, in main()
97 if (memcmp(&addr[file_sz], dummy, page_sz - file_sz)) { in main()
114 if (msync(addr, page_sz, MS_SYNC) != 0) { in main()
134 if (munmap(addr, page_sz) != 0) { in main()
178 page_sz = getpagesize(); in setup()
181 if ((dummy = calloc(page_sz, sizeof(char))) == NULL) { in setup()
Dmmap13.c49 static size_t page_sz; variable
71 addr = mmap(NULL, page_sz * 2, PROT_READ | PROT_WRITE, in main()
81 ch = addr + page_sz + 1; in main()
92 if (munmap(addr, page_sz * 2) != 0) in main()
109 page_sz = getpagesize(); in setup()
118 if (ftruncate(fildes, page_sz / 2) == -1) in setup()
Dmmap12.c60 size_t page_sz; in page_check() local
65 page_sz = getpagesize(); in page_check()
67 num_pages = MMAPSIZE / page_sz; in page_check()
68 index = (vmstart / page_sz) * sizeof(uint64_t); in page_check()
93 "present", i, vmstart + i * page_sz); in page_check()
/external/ltp/testcases/kernel/syscalls/munmap/
Dmunmap02.c86 static size_t page_sz; variable
169 page_sz = getpagesize(); in setup()
175 map_len = 3 * page_sz; in setup()
223 addr = (char *)((long)addr + page_sz); in setup()
224 map_len = map_len - page_sz; in setup()
260 addr = (char *)((long)addr - page_sz); in cleanup()
261 map_len = map_len - page_sz; in cleanup()
Dmunmap03.c48 static size_t page_sz; variable
86 page_sz = (size_t)sysconf(_SC_PAGESIZE); in setup()
88 global_maplen = page_sz * 2; in setup()
118 map_len = page_sz * 2; in test_einval1()
145 size_t map_len = page_sz; in test_einval3()
Dmunmap01.c153 size_t page_sz; in setup() local
165 page_sz = getpagesize(); in setup()
171 map_len = 3 * page_sz; in setup()
/external/ltp/testcases/kernel/syscalls/msync/
Dmsync03.c62 static size_t page_sz; variable
113 page_sz = (size_t)sysconf(_SC_PAGESIZE); in setup()
118 while (nwrite < page_sz) { in setup()
123 addr1 = SAFE_MMAP(cleanup, 0, page_sz, PROT_READ | PROT_WRITE, in setup()
134 addr4 = sbrk(0) + (4 * page_sz); in setup()
139 TEST(msync(*(tc->addr), page_sz, tc->flags)); in msync_verify()
157 if (addr1 && munmap(addr1, page_sz) < 0) in cleanup()
Dmsync02.c81 size_t page_sz; /* system page size */ variable
94 TEST(msync(addr, page_sz, MS_INVALIDATE)); in main()
116 if ((page_sz = getpagesize()) == -1) in setup()
125 while (c_total < page_sz) { in setup()
132 addr = mmap(0, page_sz, PROT_READ | PROT_WRITE, MAP_FILE | MAP_SHARED, in setup()
149 if (munmap(addr, page_sz) == -1) in cleanup()
Dmsync01.c82 size_t page_sz; /* system page size */ variable
103 TEST(msync(addr, page_sz, MS_ASYNC)); in main()
162 if ((page_sz = getpagesize()) == -1) in setup()
170 while (c_total < page_sz) { in setup()
182 addr = mmap(0, page_sz, PROT_READ | PROT_WRITE, MAP_FILE | MAP_SHARED, in setup()
195 if (munmap(addr, page_sz) == -1) in cleanup()
/external/ltp/testcases/kernel/mem/hugetlb/hugemmap/
Dhugemmap01.c58 long page_sz = 0; in test_hugemmap() local
64 page_sz = SAFE_READ_MEMINFO("Hugepagesize:") * 1024; in test_hugemmap()
66 addr = mmap(NULL, page_sz, PROT_READ | PROT_WRITE, in test_hugemmap()
84 munmap(addr, page_sz); in test_hugemmap()
Dhugemmap02.c67 long page_sz, map_sz; in test_hugemmap() local
69 page_sz = getpagesize(); in test_hugemmap()
89 addr = mmap((void *)low_addr, page_sz, PROT_READ, in test_hugemmap()
129 if (munmap(addr, page_sz) == -1) in test_hugemmap()
/external/ltp/testcases/kernel/syscalls/mremap/
Dmremap03.c154 int page_sz; /* system page size */ in setup() local
161 if ((page_sz = getpagesize()) < 0) { in setup()
167 memsize = (1000 * page_sz); in setup()
/external/ltp/testcases/kernel/mem/mtest06/
Dmmap1.c41 static unsigned long page_sz; variable
184 page_sz = getpagesize(); in setup()