]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/platforms/cell/spufs/inode.c
[POWERPC] spufs: Make isolated loader properly aligned
[linux-2.6-omap-h63xx.git] / arch / powerpc / platforms / cell / spufs / inode.c
index b3d0dd118dd0ededd97d842e7ab9db1408bda23e..e210a4b259fbe4a19c39a548585e53b19fc06d3a 100644 (file)
@@ -43,6 +43,7 @@
 
 static struct kmem_cache *spufs_inode_cache;
 char *isolated_loader;
+static int isolated_loader_size;
 
 static struct inode *
 spufs_alloc_inode(struct super_block *sb)
@@ -667,7 +668,8 @@ spufs_parse_options(char *options, struct inode *root)
 
 static void spufs_exit_isolated_loader(void)
 {
-       kfree(isolated_loader);
+       free_pages((unsigned long) isolated_loader,
+                       get_order(isolated_loader_size));
 }
 
 static void
@@ -685,11 +687,12 @@ spufs_init_isolated_loader(void)
        if (!loader)
                return;
 
-       /* kmalloc should align on a 16 byte boundary..* */
-       isolated_loader = kmalloc(size, GFP_KERNEL);
+       /* the loader must be align on a 16 byte boundary */
+       isolated_loader = (char *)__get_free_pages(GFP_KERNEL, get_order(size));
        if (!isolated_loader)
                return;
 
+       isolated_loader_size = size;
        memcpy(isolated_loader, loader, size);
        printk(KERN_INFO "spufs: SPU isolation mode enabled\n");
 }