for (p = vmlist, pprev = &vmlist; p != NULL; pprev = &p->next, p = *pprev) if (p->addr == (void *)(PAGE_MASK & (unsigned long)addr)) break; if (!p) { printk("__iounmap: bad address %p\n", addr); goto out_unlock; } *pprev = p->next; unmap_vm_area(p); if ((p->flags >> 20) && p->phys_addr + p->size - 1 < virt_to_phys(high_memory)) { /* p->size includes the guard page, but cpa doesn't like that */ change_page_attr_addr((unsigned long)__va(p->phys_addr), p->size >> PAGE_SHIFT, PAGE_KERNEL); global_flush_tlb(); } out_unlock: 
p = __remove_vm_area((void *)((unsigned long)addr & PAGE_MASK)); if (!p) printk("iounmap: bad address %p\n", addr); else if (p->flags >> 20) ioremap_change_attr(p->phys_addr, p->size, 0); 
void iounmap(volatile void __iomem *addr){	struct vm_struct *p, **pprev;	if (addr <= high_memory) 		return; 	if (addr >= phys_to_virt(ISA_START_ADDRESS) &&		addr < phys_to_virt(ISA_END_ADDRESS))		return;	write_lock(&vmlist_lock);	for (p = vmlist, pprev = &vmlist; p != NULL; pprev = &p->next, p = *pprev)		if (p->addr == (void *)(PAGE_MASK & (unsigned long)addr))			break;	if (!p) { 		printk("__iounmap: bad address %p\n", addr);		goto out_unlock;	}	*pprev = p->next;	unmap_vm_area(p);	if ((p->flags >> 20) &&		p->phys_addr + p->size - 1 < virt_to_phys(high_memory)) {		/* p->size includes the guard page, but cpa doesn't like that */		change_page_attr_addr((unsigned long)__va(p->phys_addr),				 p->size >> PAGE_SHIFT,				 PAGE_KERNEL);		global_flush_tlb();	} out_unlock:	write_unlock(&vmlist_lock);	kfree(p); }
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/7856dfeb23c16ef3d8dac8871b4d5b93c70b59b9/ioremap.c/clean/arch/x86_64/mm/ioremap.c