Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42232
b: refs/heads/master
c: c80d913
h: refs/heads/master
v: v3
  • Loading branch information
Benjamin Herrenschmidt authored and Paul Mackerras committed Dec 4, 2006
1 parent 8b4a73d commit b0e545b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 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: 92b20c40dcca2d441f367da57e7665cce15c492a
refs/heads/master: c80d9133e99de1af607314107910a2a1645efb17
14 changes: 9 additions & 5 deletions trunk/arch/powerpc/kernel/dma_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,18 @@ unsigned long dma_direct_offset;
static void *dma_direct_alloc_coherent(struct device *dev, size_t size,
dma_addr_t *dma_handle, gfp_t flag)
{
struct page *page;
void *ret;
int node = dev->archdata.numa_node;

/* TODO: Maybe use the numa node here too ? */
ret = (void *)__get_free_pages(flag, get_order(size));
if (ret != NULL) {
memset(ret, 0, size);
*dma_handle = virt_to_abs(ret) | dma_direct_offset;
}
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_abs(ret) | dma_direct_offset;

return ret;
}

Expand Down

0 comments on commit b0e545b

Please sign in to comment.