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 */