blk 177 sys/mem/kmem.c struct block_hdr *blk, *newblk; blk 195 sys/mem/kmem.c blk = block_find(size); blk 196 sys/mem/kmem.c if (blk) { blk 200 sys/mem/kmem.c list_remove(&blk->link); /* Remove from free list */ blk 201 sys/mem/kmem.c pg = PAGETOP(blk); /* Get the page address */ blk 217 sys/mem/kmem.c blk = &pg->first_blk; blk 218 sys/mem/kmem.c blk->magic = BLOCK_MAGIC; blk 219 sys/mem/kmem.c blk->size = MAX_BLOCK_SIZE; blk 220 sys/mem/kmem.c blk->pg_next = NULL; blk 226 sys/mem/kmem.c if (pg->magic != PAGE_MAGIC || blk->magic != BLOCK_MAGIC) blk 232 sys/mem/kmem.c if (blk->size - size >= MIN_BLOCK_SIZE) { blk 236 sys/mem/kmem.c newblk = (struct block_hdr *)((vaddr_t)blk + size); blk 238 sys/mem/kmem.c newblk->size = (u_short)(blk->size - size); blk 244 sys/mem/kmem.c newblk->pg_next = blk->pg_next; blk 245 sys/mem/kmem.c blk->pg_next = newblk; blk 246 sys/mem/kmem.c blk->size = (u_short)size; blk 252 sys/mem/kmem.c p = (void *)((vaddr_t)blk + BLKHDR_SIZE); blk 271 sys/mem/kmem.c struct block_hdr *blk; blk 280 sys/mem/kmem.c blk = (struct block_hdr *)((vaddr_t)ptr - BLKHDR_SIZE); blk 281 sys/mem/kmem.c if (blk->magic != BLOCK_MAGIC) blk 289 sys/mem/kmem.c list_insert(&free_blocks[BLKNDX(blk)], &blk->link); blk 294 sys/mem/kmem.c pg = PAGETOP(blk); blk 300 sys/mem/kmem.c for (blk = &pg->first_blk; blk != NULL; blk = blk->pg_next) { blk 301 sys/mem/kmem.c list_remove(&blk->link); /* Remove from free list */ blk 78 sys/mem/page.c struct page *blk, *tmp; blk 89 sys/mem/page.c blk = &page_head; blk 91 sys/mem/page.c blk = blk->next; blk 92 sys/mem/page.c if (blk == &page_head) { blk 97 sys/mem/page.c } while (blk->size < size); blk 105 sys/mem/page.c if (blk->size == size) { blk 106 sys/mem/page.c blk->prev->next = blk->next; blk 107 sys/mem/page.c blk->next->prev = blk->prev; blk 109 sys/mem/page.c tmp = (struct page *)((vaddr_t)blk + size); blk 110 sys/mem/page.c tmp->size = blk->size - size; blk 111 sys/mem/page.c tmp->prev = blk->prev; blk 112 sys/mem/page.c tmp->next = blk->next; blk 113 sys/mem/page.c blk->prev->next = tmp; blk 114 sys/mem/page.c blk->next->prev = tmp; blk 118 sys/mem/page.c return kvtop(blk); blk 131 sys/mem/page.c struct page *blk, *prev; blk 139 sys/mem/page.c blk = ptokv(paddr); blk 144 sys/mem/page.c for (prev = &page_head; prev->next < blk; prev = prev->next) { blk 152 sys/mem/page.c blk->size = size; blk 153 sys/mem/page.c blk->prev = prev; blk 154 sys/mem/page.c blk->next = prev->next; blk 155 sys/mem/page.c prev->next->prev = blk; blk 156 sys/mem/page.c prev->next = blk; blk 162 sys/mem/page.c if (blk->next != &page_head && blk 163 sys/mem/page.c ((vaddr_t)blk + blk->size) == (vaddr_t)blk->next) { blk 164 sys/mem/page.c blk->size += blk->next->size; blk 165 sys/mem/page.c blk->next = blk->next->next; blk 166 sys/mem/page.c blk->next->prev = blk; blk 168 sys/mem/page.c if (blk->prev != &page_head && blk 169 sys/mem/page.c (vaddr_t)blk->prev + blk->prev->size == (vaddr_t)blk) { blk 170 sys/mem/page.c blk->prev->size += blk->size; blk 171 sys/mem/page.c blk->prev->next = blk->next; blk 172 sys/mem/page.c blk->next->prev = blk->prev; blk 184 sys/mem/page.c struct page *blk, *tmp; blk 198 sys/mem/page.c blk = page_head.next; blk 200 sys/mem/page.c if (blk == &page_head) blk 203 sys/mem/page.c if ((vaddr_t)blk <= start blk 204 sys/mem/page.c && end <= (vaddr_t)blk + blk->size) blk 206 sys/mem/page.c blk = blk->next; blk 208 sys/mem/page.c if ((vaddr_t)blk == start && blk->size == size) { blk 212 sys/mem/page.c blk->prev->next = blk->next; blk 213 sys/mem/page.c blk->next->prev = blk->prev; blk 218 sys/mem/page.c if ((vaddr_t)blk + blk->size != end) { blk 220 sys/mem/page.c tmp->size = (vaddr_t)blk + blk->size - end; blk 221 sys/mem/page.c tmp->next = blk->next; blk 222 sys/mem/page.c tmp->prev = blk; blk 224 sys/mem/page.c blk->size -= tmp->size; blk 225 sys/mem/page.c blk->next->prev = tmp; blk 226 sys/mem/page.c blk->next = tmp; blk 228 sys/mem/page.c if ((vaddr_t)blk == start) { blk 229 sys/mem/page.c blk->prev->next = blk->next; blk 230 sys/mem/page.c blk->next->prev = blk->prev; blk 232 sys/mem/page.c blk->size = start - (vaddr_t)blk;