rem: dbg_add_command(&dbg_dump_cbuf_freelists, "cbuf_freelist", "Dumps the cbuf free lists");
add: add_debugger_command("cbuf_freelist", &dbg_dump_cbuf_freelists, "Dumps the cbuf free lists");
context: int cbuf_init(){	cbuf *buf;	int i;	cbuf_free_list = NULL;	cbuf_free_noblock_list = NULL;	noblock_spin = 0;	cbuf_lowlevel_spinlock = 0;	// add the debug command	dbg_add_command(&dbg_dump_cbuf_freelists, "cbuf_freelist", "Dumps the cbuf free lists");	free_list_sem = create_sem(1, "cbuf_free_list_sem");	if(free_list_sem < 0) {		panic("cbuf_init: error creating cbuf_free_list_sem\n");		return ENOMEM;	}	cbuf_region_id = vm_create_anonymous_region(vm_get_kernel_aspace_id(), "cbuf region",		(void **)&cbuf_region, REGION_ADDR_ANY_ADDRESS, CBUF_REGION_SIZE, REGION_WIRING_LAZY, LOCK_RW|LOCK_KERNEL);	if(cbuf_region_id < 0) {		panic("cbuf_init: error creating cbuf region\n");		return ENOMEM;	}	cbuf_bitmap_region_id = vm_create_anonymous_region(vm_get_kernel_aspace_id(), "cbuf bitmap region",		(void **)&cbuf_bitmap, REGION_ADDR_ANY_ADDRESS,		CBUF_BITMAP_SIZE / 8, REGION_WIRING_WIRED, LOCK_RW|LOCK_KERNEL);	if(cbuf_region_id < 0) {		panic("cbuf_init: error creating cbuf bitmap region\n");		return ENOMEM;	}	// initialize the bitmap	for(i=0; i<CBUF_BITMAP_SIZE/8; i++)		cbuf_bitmap[i] = 0;	buf = allocate_cbuf_mem(ALLOCATE_CHUNK);	if(buf == NULL)		return ENOMEM;	cbuf_free_chain_noblock(buf);	buf = allocate_cbuf_mem(ALLOCATE_CHUNK);	if(buf == NULL)		return ENOMEM;	cbuf_free_chain(buf);	return B_NO_ERROR;}