Lines Matching defs:page
44 * Each call to mmap() creates a page. The pages are linked in a list.
45 * Each page is divided in blocks. There is at least one block in a page.
64 struct page *page; /* Backwards reference to page */
70 struct page {
71 size_t size; /* Total page size (incl. header) */
72 struct page *next;
80 #define HDR_PAGE (sizeof (struct page) - sizeof (void *))
88 struct page *memstart;
90 static void defrag(struct page *);
110 struct page *page;
120 for (page = memstart; page; page = page->next) {
121 for (block = page->block; block; block = block->next) {
129 * Need to allocate a new page
131 if (!page) {
135 if ((page = (struct page *)mmap(0, totpage,
140 page->next = memstart;
141 memstart = page;
142 page->size = totpage;
143 block = page->block;
147 block->page = page;
190 defrag(block->page);
208 defrag(block->page);
233 newblock->page = block->page;
243 defrag(struct page *page)
247 for (block = page->block; block; block = block->next) {
260 * Free page
262 if (page->block->size == page->size - HDR_PAGE) {
263 if (page == memstart)
264 memstart = page->next;
266 struct page *page2;
269 if (page2->next == page) {
270 page2->next = page->next;
275 (void) munmap((caddr_t)page, page->size);