Lines Matching defs:block

39  * not reentrant, and only block out software interrupts.  They take
40 * too long to block any real devices. There is a routine
57 * list insertion time) and block sizes decrease with depth in the
58 * tree (thus minimizing search time for a block of a given size).
76 * To reduce storage consumption, a header block is associated with
78 * When a free block is allocated, its header block is put on
79 * a free header block list.
81 * This creates a header space and a free block space.
91 * Description of a header for a free block
97 Dblk block; /* Ptr to the data block */
98 size_t size; /* Size of the data block */
103 #define SMALLEST_BLK 1 /* Size of smallest block */
106 * Description of a data block.
113 * weight(x) is the size of a block, in bytes; or 0 if and only if x
210 insert(Dblk p, /* Ptr to the block to insert */
227 if (p < x->block)
249 newhdr->block = p;
263 if (x->block < p) {
403 * Allocate a block of storage
413 * kmem_alloc returns a pointer to the allocated block; a null
435 ((((uintptr_t)(x)->block) & ALIGNMASK) == 0 ? (x)->size : \
436 (((x)->size <= ALIGNMORE((x)->block)) ? 0 : \
437 (x)->size - ALIGNMORE((x)->block))))
467 * ensure that at least one block is big enough to satisfy
473 * the largest block is not enough.
482 * search down through the tree until a suitable block is
527 retblock = a->block->data;
538 if ((uintptr_t)a->block->data & ALIGNMASK) {
540 if (a->size <= ALIGNMORE(a->block->data))
541 prom_panic("kmem_alloc: short block allocated");
542 size = nbytes + ALIGNMORE(a->block->data);
543 x->block = a->block;
544 x->size = ALIGNMORE(a->block->data);
554 retblock = a->block->data + ALIGNMORE(a->block->data);
556 kmem_free((caddr_t)nextblk(a->block, size),
561 x->block = nextblk(a->block, nbytes);
572 retblock = a->block->data;
590 * Return a block to the free space tree.
595 * tree is found, insert the given block.
598 * If the block has already been freed, prom_panic.
635 neigh_block = (char *)neighbor->block;
646 * The block being freed overlaps
647 * another block in the tree. This
650 printf("kmem_free: free block overlap %p+%lx"
653 prom_panic("kmem_free: free block overlap");
670 * This block has already been freed
672 prom_panic("kmem_free block already free");
681 * This block has already been freed
684 prom_panic("kmem_free: block already free as neighbor");
763 * Add a block of at least nbytes to the free space tree.
803 * Get a free block header
804 * There is a list of available free block headers.
836 * Free a free block header
848 p->block = NULL;
874 "(%p): (left = %p, right = %p, block = %p, size = %lx)\n",
875 p, p->left, p->right, p->block, p->size);