vserver 1.9.5.x5
[linux-2.6.git] / include / asm-mips / compat.h
index 88ca4d5..dce9207 100644 (file)
@@ -132,10 +132,13 @@ static inline void *compat_ptr(compat_uptr_t uptr)
 
 static inline void *compat_alloc_user_space(long len)
 {
-       unsigned long sp = (unsigned long) current_thread_info() +
-                           THREAD_SIZE - 32;
+       struct pt_regs *regs = (struct pt_regs *)
+               ((unsigned long) current_thread_info() + THREAD_SIZE - 32) - 1;
 
-       return (void *) (sp - len);
+       return (void *) (regs->regs[29] - len);
 }
+#if defined (__MIPSEL__)
+#define __COMPAT_ENDIAN_SWAP__         1
+#endif
 
 #endif /* _ASM_COMPAT_H */