Lines Matching defs:mtbl

350 	ldc_mtbl_t	*mtbl;
397 if ((mtbl = ldcp->mtbl) == NULL) {
400 mtbl = kmem_zalloc(sizeof (ldc_mtbl_t), KM_SLEEP);
401 mtbl->num_entries = mtbl->num_avail = ldc_maptable_entries;
402 mtbl->size = ldc_maptable_entries * sizeof (ldc_mte_slot_t);
403 mtbl->next_entry = NULL;
404 mtbl->contigmem = B_TRUE;
407 mtbl->table = (ldc_mte_slot_t *)
408 contig_mem_alloc_align(mtbl->size, MMU_PAGESIZE);
409 if (mtbl->table == NULL) {
412 mtbl->table = kmem_alloc(MMU_PAGESIZE, KM_SLEEP);
413 mtbl->size = MMU_PAGESIZE;
414 mtbl->contigmem = B_FALSE;
415 mtbl->num_entries = mtbl->num_avail =
416 mtbl->size / sizeof (ldc_mte_slot_t);
419 "to %lx entries\n", ldcp->id, mtbl->num_entries);
423 bzero(mtbl->table, mtbl->size);
426 mutex_init(&mtbl->lock, NULL, MUTEX_DRIVER, NULL);
430 va_to_pa(mtbl->table), mtbl->num_entries);
435 if (mtbl->contigmem)
436 contig_mem_free(mtbl->table, mtbl->size);
438 kmem_free(mtbl->table, mtbl->size);
439 mutex_destroy(&mtbl->lock);
440 kmem_free(mtbl, sizeof (ldc_mtbl_t));
446 ldcp->mtbl = mtbl;
450 ldcp->id, ldcp->mtbl->table);
477 mutex_enter(&mtbl->lock);
479 if (npages > mtbl->num_avail) {
482 mutex_exit(&mtbl->lock);
518 index = mtbl->next_entry;
547 while (mtbl->table[index].entry.ll != 0) {
549 index = (index + 1) % mtbl->num_entries;
551 if (index == mtbl->next_entry) {
561 mutex_exit(&mtbl->lock);
577 mtbl->table[index].entry = tmp_mte;
605 memseg->pages[i].mte = &(mtbl->table[index]);
625 mtbl->num_avail--;
632 index = (index + 1) % mtbl->num_entries;
635 mtbl->next_entry = index;
638 mutex_exit(&mtbl->lock);
731 ldc_mtbl_t *mtbl;
755 mtbl = ldcp->mtbl;
760 mutex_enter(&mtbl->lock);
800 mtbl->num_avail++;
802 mutex_exit(&mtbl->lock);
2052 ldc_mtbl_t *mtbl;
2059 if ((mtbl = ldcp->mtbl) == NULL)
2063 mutex_enter(&mtbl->lock);
2108 mtbl->num_avail++;
2113 mutex_exit(&mtbl->lock);