[Cbe-oss-dev] spufs: make isolated loader properly aligned (take 2)
Sebastian Siewior
cbe-oss-dev at ml.breakpoint.cc
Sat Aug 11 07:27:55 EST 2007
According to the comment in spufs_init_isolated_loader(), the isolated loader
should be aligned on a 16 byte boundary. ARCH_{KMALLOC|SLAB}_MINALIGN is not
defined so 8 byte alignment is guaranteed.
This patch enforces page based alignment via vmalloc (compile time tested).
Signed-off-by: Sebastian Siewior <sebastian at breakpoint.cc>
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -32,6 +32,7 @@
#include <linux/poll.h>
#include <linux/slab.h>
#include <linux/parser.h>
+#include <linux/vmalloc.h>
#include <asm/prom.h>
#include <asm/semaphore.h>
@@ -667,7 +668,7 @@ spufs_parse_options(char *options, struc
static void spufs_exit_isolated_loader(void)
{
- kfree(isolated_loader);
+ vfree(isolated_loader);
}
static void
@@ -685,8 +686,8 @@ spufs_init_isolated_loader(void)
if (!loader)
return;
- /* kmalloc should align on a 16 byte boundary..* */
- isolated_loader = kmalloc(size, GFP_KERNEL);
+ /* vmalloc should align on a 16 byte boundary..* */
+ isolated_loader = vmalloc(size);
if (!isolated_loader)
return;
More information about the cbe-oss-dev
mailing list