]> err.no Git - linux-2.6/blobdiff - arch/powerpc/mm/slice.c
[POWERPC] spufs: fix incorrect file descriptors in SPU coredump note names
[linux-2.6] / arch / powerpc / mm / slice.c
index f833dba2a0287ea06218f180620b8634300a58e7..ad928edafb0aae614f1f7f121c5a2fb18fba7941 100644 (file)
@@ -34,7 +34,7 @@
 #include <asm/mmu.h>
 #include <asm/spu.h>
 
-static spinlock_t slice_convert_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(slice_convert_lock);
 
 
 #ifdef DEBUG
@@ -405,6 +405,8 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len,
 
        if (len > mm->task_size)
                return -ENOMEM;
+       if (len & ((1ul << pshift) - 1))
+               return -EINVAL;
        if (fixed && (addr & ((1ul << pshift) - 1)))
                return -EINVAL;
        if (fixed && addr > (mm->task_size - len))
@@ -549,6 +551,7 @@ EXPORT_SYMBOL_GPL(get_slice_psize);
  *
  * This is also called in init_new_context() to change back the user
  * psize from whatever the parent context had it set to
+ * N.B. This may be called before mm->context.id has been set.
  *
  * This function will only change the content of the {low,high)_slice_psize
  * masks, it will not flush SLBs as this shall be handled lazily by the