Lines Matching +full:5 +full:a
40 // Try a simple operation for to "test" for kernel support this prevents
97 unsigned long num_pages = 5; in mremap_dontunmap_simple()
104 memset(source_mapping, 'a', num_pages * page_size); in mremap_dontunmap_simple()
113 // the dest_mapping contains a's. in mremap_dontunmap_simple()
115 (dest_mapping, num_pages * page_size, 'a') != 0, in mremap_dontunmap_simple()
127 // This test validates that MREMAP_DONTUNMAP on a shared mapping works as expected.
130 unsigned long num_pages = 5; in mremap_dontunmap_simple_shmem()
145 memset(source_mapping, 'a', num_pages * page_size); in mremap_dontunmap_simple_shmem()
161 // the dest_mapping contains a's. in mremap_dontunmap_simple_shmem()
163 (dest_mapping, num_pages * page_size, 'a') != 0, in mremap_dontunmap_simple_shmem()
169 (source_mapping, num_pages * page_size, 'a') != 0, in mremap_dontunmap_simple_shmem()
178 // This test validates MREMAP_DONTUNMAP will move page tables to a specific
183 unsigned long num_pages = 5; in mremap_dontunmap_simple_fixed()
185 // Since we want to guarantee that we can remap to a point, we will in mremap_dontunmap_simple_fixed()
186 // create a mapping up front. in mremap_dontunmap_simple_fixed()
197 memset(source_mapping, 'a', num_pages * page_size); in mremap_dontunmap_simple_fixed()
208 // to be gone and replaced with a's. in mremap_dontunmap_simple_fixed()
210 (dest_mapping, num_pages * page_size, 'a') != 0, in mremap_dontunmap_simple_fixed()
224 // This test validates that we can MREMAP_DONTUNMAP for a portion of an
237 * With the destination mapping containing 5 pages of As. in mremap_dontunmap_partial_mapping()
247 memset(source_mapping, 'a', num_pages * page_size); in mremap_dontunmap_partial_mapping()
249 // We will grab the last 5 pages of the source and move them. in mremap_dontunmap_partial_mapping()
251 mremap(source_mapping + (5 * page_size), 5 * page_size, in mremap_dontunmap_partial_mapping()
252 5 * page_size, in mremap_dontunmap_partial_mapping()
256 // We expect the first 5 pages of the source to contain a's and the in mremap_dontunmap_partial_mapping()
257 // final 5 pages to contain zeros. in mremap_dontunmap_partial_mapping()
258 BUG_ON(check_region_contains_byte(source_mapping, 5 * page_size, 'a') != in mremap_dontunmap_partial_mapping()
259 0, "first 5 pages of source should have original pages"); in mremap_dontunmap_partial_mapping()
261 (source_mapping + (5 * page_size), 5 * page_size, 0) != 0, in mremap_dontunmap_partial_mapping()
262 "final 5 pages of source should have no ptes"); in mremap_dontunmap_partial_mapping()
264 // Finally we expect the destination to have 5 pages worth of a's. in mremap_dontunmap_partial_mapping()
265 BUG_ON(check_region_contains_byte(dest_mapping, 5 * page_size, 'a') != in mremap_dontunmap_partial_mapping()
268 BUG_ON(munmap(dest_mapping, 5 * page_size) == -1, in mremap_dontunmap_partial_mapping()
274 // This test validates that we can remap over only a portion of a mapping.
290 * With the destination mapping containing 5 pages of As. in mremap_dontunmap_partial_mapping_overwrite()
296 mmap(NULL, 5 * page_size, PROT_READ | PROT_WRITE, in mremap_dontunmap_partial_mapping_overwrite()
299 memset(source_mapping, 'a', 5 * page_size); in mremap_dontunmap_partial_mapping_overwrite()
307 // We will grab the last 5 pages of the source and move them. in mremap_dontunmap_partial_mapping_overwrite()
309 mremap(source_mapping, 5 * page_size, in mremap_dontunmap_partial_mapping_overwrite()
310 5 * page_size, in mremap_dontunmap_partial_mapping_overwrite()
315 BUG_ON(check_region_contains_byte(source_mapping, 5 * page_size, 0) != in mremap_dontunmap_partial_mapping_overwrite()
316 0, "first 5 pages of source should have no ptes"); in mremap_dontunmap_partial_mapping_overwrite()
318 // Finally we expect the destination to have 5 pages worth of a's. in mremap_dontunmap_partial_mapping_overwrite()
319 BUG_ON(check_region_contains_byte(dest_mapping, 5 * page_size, 'a') != 0, in mremap_dontunmap_partial_mapping_overwrite()
322 // Finally the last 5 pages shouldn't have been touched. in mremap_dontunmap_partial_mapping_overwrite()
323 BUG_ON(check_region_contains_byte(dest_mapping + (5 * page_size), in mremap_dontunmap_partial_mapping_overwrite()
324 5 * page_size, 'X') != 0, in mremap_dontunmap_partial_mapping_overwrite()
325 "dest mapping should have retained the last 5 pages"); in mremap_dontunmap_partial_mapping_overwrite()
329 BUG_ON(munmap(source_mapping, 5 * page_size) == -1, in mremap_dontunmap_partial_mapping_overwrite()
344 // Keep a page sized buffer around for when we need it. in main()
348 BUG_ON(page_buffer == MAP_FAILED, "unable to mmap a page."); in main()