FreeBSD/sys/arm/arm/pmap-v4.c
/*
 * Allocate an L1 translation table for the specified pmap.
 * This is called at pmap creation time.
 */
Allocate an L1 translation table for the specified pmap.
This is called at pmap creation time.
Allocate an L1 translation table for the specified pmap . This is called at pmap creation time .
static void
pmap_alloc_l1(pmap_t pm)
{
	struct l1_ttable *l1;
	u_int8_t domain;
	mtx_lock(&l1_lru_lock);
	l1 = TAILQ_FIRST(&l1_lru_list);
	TAILQ_REMOVE(&l1_lru_list, l1, l1_lru);
	domain = l1->l1_domain_first;
	l1->l1_domain_first = l1->l1_domain_free[domain];
	if (++l1->l1_domain_use_count < PMAP_DOMAINS)
		TAILQ_INSERT_TAIL(&l1_lru_list, l1, l1_lru);
	mtx_unlock(&l1_lru_lock);
	pm->pm_l1 = l1;
	pm->pm_domain = domain + 1;
}
static void pmap_alloc_l1 ( pmap_t pm ) { struct l1_ttable * l1 ; u_int8_t domain ; mtx_lock ( & l1_lru_lock ) ; l1 = TAILQ_FIRST ( & l1_lru_list ) ; TAILQ_REMOVE ( & l1_lru_list , l1 , l1_lru ) ; domain = l1 -> l1_domain_first ; l1 -> l1_domain_first = l1 -> l1_domain_free [ domain ] ; if ( ++ l1 -> l1_domain_use_count < PMAP_DOMAINS ) TAILQ_INSERT_TAIL ( & l1_lru_list , l1 , l1_lru ) ; mtx_unlock ( & l1_lru_lock ) ; pm -> pm_l1 = l1 ; pm -> pm_domain = domain + 1 ; }
Allocate an L1 translation table for the specified pmap.
Allocate an L1 translation table for the specified pmap .
/*
	 * Remove the L1 at the head of the LRU list
	 */ /*
	 * Pick the first available domain number, and update
	 * the link to the next number.
	 */ /*
	 * If there are still free domain numbers in this L1,
	 * put it back on the TAIL of the LRU list.
	 */ /*
	 * Fix up the relevant bits in the pmap structure
	 */