rem: TRACE(("map_tmap: entry pa 0x%x va 0x%x\n", pa, va));
add: TRACE(("map_tmap: entry pa 0x%lx va 0x%lx\n", pa, va));
context: map_tmap(vm_translation_map *map, addr_t va, addr_t pa, uint32 attributes){	pdentry *pd;	ptentry *pt;	unsigned int index;	int err;	TRACE(("map_tmap: entry pa 0x%x va 0x%x\n", pa, va));/*	dprintf("pgdir at 0x%x\n", pgdir);	dprintf("index is %d\n", va / PAGE_SIZE / 1024);	dprintf("final at 0x%x\n", &pgdir[va / PAGE_SIZE / 1024]);	dprintf("value is 0x%x\n", *(int *)&pgdir[va / PAGE_SIZE / 1024]);	dprintf("present bit is %d\n", pgdir[va / PAGE_SIZE / 1024].present);	dprintf("addr is %d\n", pgdir[va / PAGE_SIZE / 1024].addr);*/	pd = map->arch_data->pgdir_virt;	// check to see if a page table exists for this range	index = VADDR_TO_PDENT(va);	if (pd[index].present == 0) {		addr_t pgtable;		vm_page *page;		// we need to allocate a pgtable		page = vm_page_allocate_page(PAGE_STATE_CLEAR);		// mark the page WIRED 		vm_page_set_state(page, PAGE_STATE_WIRED);		pgtable = page->ppn * PAGE_SIZE;		TRACE(("map_tmap: asked for free page for pgtable. 0x%x\n", pgtable));		// put it in the pgdir		put_pgtable_in_pgdir(&pd[index], pgtable, attributes			| (attributes & B_USER_PROTECTION ? B_WRITE_AREA : B_KERNEL_WRITE_AREA));		// update any other page directories, if it maps kernel space		if (index >= FIRST_KERNEL_PGDIR_ENT && index < (FIRST_KERNEL_PGDIR_ENT + NUM_KERNEL_PGDIR_ENTS))			_update_all_pgdirs(index, pd[index]);		map->map_count++;	}	// now, fill in the pentry	do {		err = get_physical_page_tmap(ADDR_REVERSE_SHIFT(pd[index].addr), (addr_t *)&pt, PHYSICAL_PAGE_NO_WAIT);	} while (err < 0);	index = VADDR_TO_PTENT(va);	put_ptentry_in_pgtable(&pt[index], pa, attributes);	put_physical_page_tmap((addr_t)pt);	if (map->arch_data->num_invalidate_pages < PAGE_INVALIDATE_CACHE_SIZE)		map->arch_data->pages_to_invalidate[map->arch_data->num_invalidate_pages] = va;	map->arch_data->num_invalidate_pages++;	map->map_count++;	return 0;}