Lines Matching refs:map
20 char *map; in test_simple() local
22 map = aligned_alloc(pagesize, pagesize); in test_simple()
23 if (!map) in test_simple()
29 if (pagemap_is_softdirty(pagemap_fd, map) == 1) { in test_simple()
36 map[0]++; in test_simple()
38 if (pagemap_is_softdirty(pagemap_fd, map) == 0) { in test_simple()
45 free(map); in test_simple()
52 char *map, *map2; in test_vma_reuse() local
54 map = mmap(NULL, pagesize, (PROT_READ | PROT_WRITE), (MAP_PRIVATE | MAP_ANON), -1, 0); in test_vma_reuse()
55 if (map == MAP_FAILED) in test_vma_reuse()
59 ksft_test_result(pagemap_is_softdirty(pagemap_fd, map) == 1, in test_vma_reuse()
63 munmap(map, pagesize); in test_vma_reuse()
70 if (map == map2) in test_vma_reuse()
81 char *map; in test_hugepage() local
93 map = memalign(hpage_len, hpage_len); in test_hugepage()
94 if (!map) in test_hugepage()
97 ret = madvise(map, hpage_len, MADV_HUGEPAGE); in test_hugepage()
102 map[i] = (char)i; in test_hugepage()
104 if (check_huge_anon(map, 1, hpage_len)) { in test_hugepage()
109 if (pagemap_is_softdirty(pagemap_fd, map) == 1) { in test_hugepage()
116 map[0]++; in test_hugepage()
118 if (pagemap_is_softdirty(pagemap_fd, map) == 0) { in test_hugepage()
131 free(map); in test_hugepage()
139 char *map; in test_mprotect() local
142 map = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, in test_mprotect()
144 if (!map) in test_mprotect()
154 map = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, in test_mprotect()
156 if (!map) in test_mprotect()
160 *map = 1; in test_mprotect()
161 ksft_test_result(pagemap_is_softdirty(pagemap_fd, map) == 1, in test_mprotect()
165 ksft_test_result(pagemap_is_softdirty(pagemap_fd, map) == 0, in test_mprotect()
168 mprotect(map, pagesize, PROT_READ); in test_mprotect()
169 ksft_test_result(pagemap_is_softdirty(pagemap_fd, map) == 0, in test_mprotect()
172 mprotect(map, pagesize, PROT_READ|PROT_WRITE); in test_mprotect()
173 ksft_test_result(pagemap_is_softdirty(pagemap_fd, map) == 0, in test_mprotect()
176 *map = 2; in test_mprotect()
177 ksft_test_result(pagemap_is_softdirty(pagemap_fd, map) == 1, in test_mprotect()
181 munmap(map, pagesize); in test_mprotect()