Lines Matching refs:mmap_ptr

93 	size_t *mmap_ptr;
108 mmap_ptr = mmap(NULL, page_size, PROT_READ | PROT_WRITE, MAP_SHARED, rb_fd, 0);
109 if (!ASSERT_OK_PTR(mmap_ptr, "rw_cons_pos"))
111 *mmap_ptr = 0x3000;
112 ASSERT_OK(munmap(mmap_ptr, page_size), "unmap_rw");
148 void *mmap_ptr, *tmp_ptr;
165 mmap_ptr = mmap(NULL, page_size, PROT_READ | PROT_WRITE, MAP_SHARED, rb_fd, 0);
166 ASSERT_OK_PTR(mmap_ptr, "rw_cons_pos");
167 tmp_ptr = mremap(mmap_ptr, page_size, 2 * page_size, MREMAP_MAYMOVE);
170 ASSERT_ERR(mprotect(mmap_ptr, page_size, PROT_EXEC), "exec_cons_pos_protect");
171 ASSERT_OK(munmap(mmap_ptr, page_size), "unmap_rw");
174 mmap_ptr = mmap(NULL, page_size, PROT_WRITE, MAP_SHARED, rb_fd, page_size);
176 ASSERT_ERR_PTR(mmap_ptr, "wr_prod_pos");
180 mmap_ptr = mmap(NULL, page_size, PROT_WRITE, MAP_SHARED, rb_fd, 2 * page_size);
182 ASSERT_ERR_PTR(mmap_ptr, "wr_data_page_one");
184 mmap_ptr = mmap(NULL, page_size, PROT_WRITE, MAP_SHARED, rb_fd, 3 * page_size);
185 ASSERT_ERR_PTR(mmap_ptr, "wr_data_page_two");
186 mmap_ptr = mmap(NULL, 2 * page_size, PROT_WRITE, MAP_SHARED, rb_fd, 2 * page_size);
187 ASSERT_ERR_PTR(mmap_ptr, "wr_data_page_all");
190 mmap_ptr = mmap(NULL, 4 * page_size, PROT_READ, MAP_SHARED, rb_fd, 0);
191 if (!ASSERT_OK_PTR(mmap_ptr, "ro_prod_pos"))
194 ASSERT_ERR(mprotect(mmap_ptr, 4 * page_size, PROT_WRITE), "write_protect");
195 ASSERT_ERR(mprotect(mmap_ptr, 4 * page_size, PROT_EXEC), "exec_protect");
196 ASSERT_ERR_PTR(mremap(mmap_ptr, 0, 4 * page_size, MREMAP_MAYMOVE), "ro_remap");
197 ASSERT_OK(munmap(mmap_ptr, 4 * page_size), "unmap_ro");
200 mmap_ptr = mmap(NULL, page_size, PROT_READ, MAP_SHARED, rb_fd, page_size);
201 if (!ASSERT_OK_PTR(mmap_ptr, "ro_prod_pos"))
204 ASSERT_ERR(mprotect(mmap_ptr, page_size, PROT_WRITE), "write_protect");
205 ASSERT_ERR(mprotect(mmap_ptr, page_size, PROT_EXEC), "exec_protect");
206 ASSERT_ERR_PTR(mremap(mmap_ptr, 0, 3 * page_size, MREMAP_MAYMOVE), "ro_remap");
207 ASSERT_OK(munmap(mmap_ptr, page_size), "unmap_ro");