linux/arch/microblaze/mm/consistent.c
/*
 * free page(s) as defined by the above mapping.
 */
free page(s) as defined by the above mapping.
free page ( s ) as defined by the above mapping .
void arch_dma_free(struct device *dev, size_t size, void *vaddr,
		dma_addr_t dma_addr, unsigned long attrs)
{
	struct page *page;
	if (in_interrupt())
		BUG();
	size = PAGE_ALIGN(size);
#ifndef CONFIG_MMU
# ifdef CONFIG_XILINX_UNCACHED_SHADOW
	vaddr = (void *)((unsigned)vaddr & ~UNCACHED_SHADOW_MASK);
# endif
	page = virt_to_page(vaddr);
	do {
		__free_reserved_page(page);
		page++;
	} while (size -= PAGE_SIZE);
#else
	do {
		pte_t *ptep = consistent_virt_to_pte(vaddr);
		unsigned long pfn;
		if (!pte_none(*ptep) && pte_present(*ptep)) {
			pfn = pte_pfn(*ptep);
			pte_clear(&init_mm, (unsigned int)vaddr, ptep);
			if (pfn_valid(pfn)) {
				page = pfn_to_page(pfn);
				__free_reserved_page(page);
			}
		}
		vaddr += PAGE_SIZE;
	} while (size -= PAGE_SIZE);
	flush_tlb_all();
#endif
}
void arch_dma_free ( struct device * dev , size_t size , void * vaddr , dma_addr_t dma_addr , unsigned long attrs ) { struct page * page ; if ( in_interrupt ( ) ) BUG ( ) ; size = PAGE_ALIGN ( size ) ; #ifndef CONFIG_MMU # ifdef CONFIG_XILINX_UNCACHED_SHADOW vaddr = ( void * ) ( ( unsigned ) vaddr & ~ UNCACHED_SHADOW_MASK ) ; # endif page = virt_to_page ( vaddr ) ; do { __free_reserved_page ( page ) ; page ++ ; } while ( size -= PAGE_SIZE ) ; #else do { pte_t * ptep = consistent_virt_to_pte ( vaddr ) ; unsigned long pfn ; if ( ! pte_none ( * ptep ) && pte_present ( * ptep ) ) { pfn = pte_pfn ( * ptep ) ; pte_clear ( & init_mm , ( unsigned int ) vaddr , ptep ) ; if ( pfn_valid ( pfn ) ) { page = pfn_to_page ( pfn ) ; __free_reserved_page ( page ) ; } } vaddr += PAGE_SIZE ; } while ( size -= PAGE_SIZE ) ; flush_tlb_all ( ) ; #endif }
free page(s) as defined by the above mapping.
free page ( s ) as defined by the above mapping .
/* Clear SHADOW_MASK bit in address, and free as per usual */ /* flush tlb */