mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 16:41:25 +00:00
microblaze: remove the dead !NOT_COHERENT_CACHE dma code
Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
a5feb607a0
commit
b0615c3baa
1 changed files with 0 additions and 28 deletions
|
@ -15,42 +15,18 @@
|
||||||
#include <linux/bug.h>
|
#include <linux/bug.h>
|
||||||
#include <asm/cacheflush.h>
|
#include <asm/cacheflush.h>
|
||||||
|
|
||||||
#define NOT_COHERENT_CACHE
|
|
||||||
|
|
||||||
static void *dma_nommu_alloc_coherent(struct device *dev, size_t size,
|
static void *dma_nommu_alloc_coherent(struct device *dev, size_t size,
|
||||||
dma_addr_t *dma_handle, gfp_t flag,
|
dma_addr_t *dma_handle, gfp_t flag,
|
||||||
unsigned long attrs)
|
unsigned long attrs)
|
||||||
{
|
{
|
||||||
#ifdef NOT_COHERENT_CACHE
|
|
||||||
return consistent_alloc(flag, size, dma_handle);
|
return consistent_alloc(flag, size, dma_handle);
|
||||||
#else
|
|
||||||
void *ret;
|
|
||||||
struct page *page;
|
|
||||||
int node = dev_to_node(dev);
|
|
||||||
|
|
||||||
/* ignore region specifiers */
|
|
||||||
flag &= ~(__GFP_HIGHMEM);
|
|
||||||
|
|
||||||
page = alloc_pages_node(node, flag, get_order(size));
|
|
||||||
if (page == NULL)
|
|
||||||
return NULL;
|
|
||||||
ret = page_address(page);
|
|
||||||
memset(ret, 0, size);
|
|
||||||
*dma_handle = virt_to_phys(ret);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dma_nommu_free_coherent(struct device *dev, size_t size,
|
static void dma_nommu_free_coherent(struct device *dev, size_t size,
|
||||||
void *vaddr, dma_addr_t dma_handle,
|
void *vaddr, dma_addr_t dma_handle,
|
||||||
unsigned long attrs)
|
unsigned long attrs)
|
||||||
{
|
{
|
||||||
#ifdef NOT_COHERENT_CACHE
|
|
||||||
consistent_free(size, vaddr);
|
consistent_free(size, vaddr);
|
||||||
#else
|
|
||||||
free_pages((unsigned long)vaddr, get_order(size));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void __dma_sync(unsigned long paddr,
|
static inline void __dma_sync(unsigned long paddr,
|
||||||
|
@ -186,12 +162,8 @@ int dma_nommu_mmap_coherent(struct device *dev, struct vm_area_struct *vma,
|
||||||
if (off >= count || user_count > (count - off))
|
if (off >= count || user_count > (count - off))
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
|
|
||||||
#ifdef NOT_COHERENT_CACHE
|
|
||||||
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
|
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
|
||||||
pfn = consistent_virt_to_pfn(cpu_addr);
|
pfn = consistent_virt_to_pfn(cpu_addr);
|
||||||
#else
|
|
||||||
pfn = virt_to_pfn(cpu_addr);
|
|
||||||
#endif
|
|
||||||
return remap_pfn_range(vma, vma->vm_start, pfn + off,
|
return remap_pfn_range(vma, vma->vm_start, pfn + off,
|
||||||
vma->vm_end - vma->vm_start, vma->vm_page_prot);
|
vma->vm_end - vma->vm_start, vma->vm_page_prot);
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue