rem: vm_put_physical_page((addr)pt);
add: put_physical_page_tmap((addr_t)pt);
context: map_tmap(vm_translation_map *map, addr va, addr pa, unsigned int 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 pgtable;		vm_page *page;		// we need to allocate a pgtable		page = vm_page_allocate_page(PAGE_STATE_CLEAR);		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 | LOCK_RW);		// 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 = vm_get_physical_page(ADDR_REVERSE_SHIFT(pd[index].addr), (addr *)&pt, PHYSICAL_PAGE_NO_WAIT);	} while (err < 0);	index = VADDR_TO_PTENT(va);	init_ptentry(&pt[index]);	pt[index].addr = ADDR_SHIFT(pa);	pt[index].user = !(attributes & LOCK_KERNEL);	pt[index].rw = attributes & LOCK_RW;	pt[index].present = 1;	vm_put_physical_page((addr)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;}