[POWERPC] cell: add spu_64k_pages_available() check
authorJeremy Kerr <jk@ozlabs.org>
Wed, 5 Dec 2007 02:49:31 +0000 (13:49 +1100)
committerArnd Bergmann <arnd@arndb.de>
Wed, 19 Dec 2007 00:00:05 +0000 (01:00 +0100)
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>
arch/powerpc/platforms/cell/spu_base.c
arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
include/asm-powerpc/spu.h

index 8398af6b5c0b851ee1572dc18353d974ad415e59..95001cdfaa260dfa48377aa9ec3062811834b8fe 100644 (file)
@@ -126,6 +126,12 @@ void spu_associate_mm(struct spu *spu, struct mm_struct *mm)
 }
 EXPORT_SYMBOL_GPL(spu_associate_mm);
 
+int spu_64k_pages_available(void)
+{
+       return mmu_psize_defs[MMU_PAGE_64K].shift != 0;
+}
+EXPORT_SYMBOL_GPL(spu_64k_pages_available);
+
 static int __spu_trap_invalid_dma(struct spu *spu)
 {
        pr_debug("%s\n", __FUNCTION__);
index f4b3c052dabf599888fcb5661198f4139245f15f..d606e575a204ca998e192583fb48e735447f6aeb 100644 (file)
@@ -73,7 +73,7 @@ int spu_alloc_lscsa(struct spu_state *csa)
        int             i, j, n_4k;
 
        /* Check availability of 64K pages */
-       if (mmu_psize_defs[MMU_PAGE_64K].shift == 0)
+       if (!spu_64k_pages_available())
                goto fail;
 
        csa->use_big_pages = 1;
index 844c7cdd6b849ddaa28df4b1ff92c569c78923a8..3308ed4933e0f1be34a28aaed88df2cd6daccd89 100644 (file)
@@ -214,6 +214,7 @@ static inline void crash_register_spus(struct list_head *list)
 
 extern void spu_invalidate_slbs(struct spu *spu);
 extern void spu_associate_mm(struct spu *spu, struct mm_struct *mm);
+int spu_64k_pages_available(void);
 
 /* Calls from the memory management to the SPU */
 struct mm_struct;