Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 123104
b: refs/heads/master
c: 8168b54
h: refs/heads/master
v: v3
  • Loading branch information
David Howells authored and Paul Mackerras committed Dec 21, 2008
1 parent abf7141 commit c6e92f9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 13ba3c0092b4db272d1f643206c1b55f4fe415a6
refs/heads/master: 8168b5400b06353293f9844976435886eb2a8ff2
24 changes: 12 additions & 12 deletions trunk/arch/powerpc/lib/dma-noncoherent.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,26 +77,26 @@ static DEFINE_SPINLOCK(consistent_lock);
* the amount of RAM found at boot time.) I would imagine that get_vm_area()
* would have to initialise this each time prior to calling vm_region_alloc().
*/
struct vm_region {
struct ppc_vm_region {
struct list_head vm_list;
unsigned long vm_start;
unsigned long vm_end;
};

static struct vm_region consistent_head = {
static struct ppc_vm_region consistent_head = {
.vm_list = LIST_HEAD_INIT(consistent_head.vm_list),
.vm_start = CONSISTENT_BASE,
.vm_end = CONSISTENT_END,
};

static struct vm_region *
vm_region_alloc(struct vm_region *head, size_t size, gfp_t gfp)
static struct ppc_vm_region *
ppc_vm_region_alloc(struct ppc_vm_region *head, size_t size, gfp_t gfp)
{
unsigned long addr = head->vm_start, end = head->vm_end - size;
unsigned long flags;
struct vm_region *c, *new;
struct ppc_vm_region *c, *new;

new = kmalloc(sizeof(struct vm_region), gfp);
new = kmalloc(sizeof(struct ppc_vm_region), gfp);
if (!new)
goto out;

Expand Down Expand Up @@ -130,9 +130,9 @@ vm_region_alloc(struct vm_region *head, size_t size, gfp_t gfp)
return NULL;
}

static struct vm_region *vm_region_find(struct vm_region *head, unsigned long addr)
static struct ppc_vm_region *ppc_vm_region_find(struct ppc_vm_region *head, unsigned long addr)
{
struct vm_region *c;
struct ppc_vm_region *c;

list_for_each_entry(c, &head->vm_list, vm_list) {
if (c->vm_start == addr)
Expand All @@ -151,7 +151,7 @@ void *
__dma_alloc_coherent(size_t size, dma_addr_t *handle, gfp_t gfp)
{
struct page *page;
struct vm_region *c;
struct ppc_vm_region *c;
unsigned long order;
u64 mask = 0x00ffffff, limit; /* ISA default */

Expand Down Expand Up @@ -191,7 +191,7 @@ __dma_alloc_coherent(size_t size, dma_addr_t *handle, gfp_t gfp)
/*
* Allocate a virtual address in the consistent mapping region.
*/
c = vm_region_alloc(&consistent_head, size,
c = ppc_vm_region_alloc(&consistent_head, size,
gfp & ~(__GFP_DMA | __GFP_HIGHMEM));
if (c) {
unsigned long vaddr = c->vm_start;
Expand Down Expand Up @@ -239,15 +239,15 @@ EXPORT_SYMBOL(__dma_alloc_coherent);
*/
void __dma_free_coherent(size_t size, void *vaddr)
{
struct vm_region *c;
struct ppc_vm_region *c;
unsigned long flags, addr;
pte_t *ptep;

size = PAGE_ALIGN(size);

spin_lock_irqsave(&consistent_lock, flags);

c = vm_region_find(&consistent_head, (unsigned long)vaddr);
c = ppc_vm_region_find(&consistent_head, (unsigned long)vaddr);
if (!c)
goto no_area;

Expand Down

0 comments on commit c6e92f9

Please sign in to comment.