Lines Matching defs:page
41 * Each call to mmap() creates a page. The pages are linked in a list.
42 * Each page is divided in blocks. There is at least one block in a page.
61 struct page *page; /* Backwards reference to page */
67 struct page {
68 size_t size; /* Total page size (incl. header) */
69 struct page *next;
77 #define HDR_PAGE (sizeof (struct page) - sizeof (void *))
85 struct page *memstart;
87 static void defrag(struct page *);
107 struct page *page;
117 for (page = memstart; page; page = page->next) {
118 for (block = page->block; block; block = block->next) {
126 * Need to allocate a new page
128 if (!page) {
132 if ((page = (struct page *)mmap(0, totpage,
137 page->next = memstart;
138 memstart = page;
139 page->size = totpage;
140 block = page->block;
144 block->page = page;
191 defrag(block->page);
209 defrag(block->page);
234 newblock->page = block->page;
244 defrag(struct page *page)
248 for (block = page->block; block; block = block->next) {
261 * Free page
263 if (page->block->size == page->size - HDR_PAGE) {
264 if (page == memstart)
265 memstart = page->next;
267 struct page *page2;
270 if (page2->next == page) {
271 page2->next = page->next;
276 (void) munmap((caddr_t)page, page->size);