diff options
author | Anton Blanchard <anton@samba.org> | 2006-06-10 06:58:08 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-06-15 05:31:26 -0400 |
commit | ca1588e71b70534e18368a46a3aad9b25dff941d (patch) | |
tree | 5bee264d69ba4cbd8b5f5ffaf7f981cab161a52b /arch/powerpc/kernel/iommu.c | |
parent | 357518fa34d9dceda42bfc09642356a58370050d (diff) |
[POWERPC] node local IOMMU tables
Allocate IOMMU tables local to the relevant node.
Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/iommu.c')
-rw-r--r-- | arch/powerpc/kernel/iommu.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c index cef8cba8329b..7cb77c20fc5d 100644 --- a/arch/powerpc/kernel/iommu.c +++ b/arch/powerpc/kernel/iommu.c | |||
@@ -418,10 +418,11 @@ void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist, | |||
418 | * Build a iommu_table structure. This contains a bit map which | 418 | * Build a iommu_table structure. This contains a bit map which |
419 | * is used to manage allocation of the tce space. | 419 | * is used to manage allocation of the tce space. |
420 | */ | 420 | */ |
421 | struct iommu_table *iommu_init_table(struct iommu_table *tbl) | 421 | struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid) |
422 | { | 422 | { |
423 | unsigned long sz; | 423 | unsigned long sz; |
424 | static int welcomed = 0; | 424 | static int welcomed = 0; |
425 | struct page *page; | ||
425 | 426 | ||
426 | /* Set aside 1/4 of the table for large allocations. */ | 427 | /* Set aside 1/4 of the table for large allocations. */ |
427 | tbl->it_halfpoint = tbl->it_size * 3 / 4; | 428 | tbl->it_halfpoint = tbl->it_size * 3 / 4; |
@@ -429,10 +430,10 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl) | |||
429 | /* number of bytes needed for the bitmap */ | 430 | /* number of bytes needed for the bitmap */ |
430 | sz = (tbl->it_size + 7) >> 3; | 431 | sz = (tbl->it_size + 7) >> 3; |
431 | 432 | ||
432 | tbl->it_map = (unsigned long *)__get_free_pages(GFP_ATOMIC, get_order(sz)); | 433 | page = alloc_pages_node(nid, GFP_ATOMIC, get_order(sz)); |
433 | if (!tbl->it_map) | 434 | if (!page) |
434 | panic("iommu_init_table: Can't allocate %ld bytes\n", sz); | 435 | panic("iommu_init_table: Can't allocate %ld bytes\n", sz); |
435 | 436 | tbl->it_map = page_address(page); | |
436 | memset(tbl->it_map, 0, sz); | 437 | memset(tbl->it_map, 0, sz); |
437 | 438 | ||
438 | tbl->it_hint = 0; | 439 | tbl->it_hint = 0; |