diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2007-12-04 21:49:31 -0500 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2007-12-18 19:00:05 -0500 |
commit | f6eb7d7ffef3e2fa40b0161c30486cb87203758d (patch) | |
tree | 580d7335ff14c9dd1934fd64f4a803116731abf0 | |
parent | 4d43466d567a6620f4f6d8576e1bed5d7cf4c28d (diff) |
[POWERPC] cell: add spu_64k_pages_available() check
Add a function spu_64k_pages_available(), so that we can abstract the
explicity use of mmu_psize_defs() in lssca_alloc.c
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r-- | arch/powerpc/platforms/cell/spu_base.c | 6 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/lscsa_alloc.c | 2 | ||||
-rw-r--r-- | include/asm-powerpc/spu.h | 1 |
3 files changed, 8 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index 8398af6b5c0b..95001cdfaa26 100644 --- a/arch/powerpc/platforms/cell/spu_base.c +++ b/arch/powerpc/platforms/cell/spu_base.c | |||
@@ -126,6 +126,12 @@ void spu_associate_mm(struct spu *spu, struct mm_struct *mm) | |||
126 | } | 126 | } |
127 | EXPORT_SYMBOL_GPL(spu_associate_mm); | 127 | EXPORT_SYMBOL_GPL(spu_associate_mm); |
128 | 128 | ||
129 | int spu_64k_pages_available(void) | ||
130 | { | ||
131 | return mmu_psize_defs[MMU_PAGE_64K].shift != 0; | ||
132 | } | ||
133 | EXPORT_SYMBOL_GPL(spu_64k_pages_available); | ||
134 | |||
129 | static int __spu_trap_invalid_dma(struct spu *spu) | 135 | static int __spu_trap_invalid_dma(struct spu *spu) |
130 | { | 136 | { |
131 | pr_debug("%s\n", __FUNCTION__); | 137 | pr_debug("%s\n", __FUNCTION__); |
diff --git a/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c b/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c index f4b3c052dabf..d606e575a204 100644 --- a/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c +++ b/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c | |||
@@ -73,7 +73,7 @@ int spu_alloc_lscsa(struct spu_state *csa) | |||
73 | int i, j, n_4k; | 73 | int i, j, n_4k; |
74 | 74 | ||
75 | /* Check availability of 64K pages */ | 75 | /* Check availability of 64K pages */ |
76 | if (mmu_psize_defs[MMU_PAGE_64K].shift == 0) | 76 | if (!spu_64k_pages_available()) |
77 | goto fail; | 77 | goto fail; |
78 | 78 | ||
79 | csa->use_big_pages = 1; | 79 | csa->use_big_pages = 1; |
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h index 844c7cdd6b84..3308ed4933e0 100644 --- a/include/asm-powerpc/spu.h +++ b/include/asm-powerpc/spu.h | |||
@@ -214,6 +214,7 @@ static inline void crash_register_spus(struct list_head *list) | |||
214 | 214 | ||
215 | extern void spu_invalidate_slbs(struct spu *spu); | 215 | extern void spu_invalidate_slbs(struct spu *spu); |
216 | extern void spu_associate_mm(struct spu *spu, struct mm_struct *mm); | 216 | extern void spu_associate_mm(struct spu *spu, struct mm_struct *mm); |
217 | int spu_64k_pages_available(void); | ||
217 | 218 | ||
218 | /* Calls from the memory management to the SPU */ | 219 | /* Calls from the memory management to the SPU */ |
219 | struct mm_struct; | 220 | struct mm_struct; |