summaryrefslogtreecommitdiff
blob: 318e683d43f33d8000a9eafb6f4b670a47252b99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
===================================================================
RCS file: /home/cvs/linux/include/asm-mips/compat.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- linux/include/asm-mips/compat.h	2003/07/29 03:21:47	1.1
+++ linux/include/asm-mips/compat.h	2004/08/12 17:37:53	1.2
@@ -132,10 +132,10 @@ static inline void *compat_ptr(compat_up
 
 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);
 }
 
 #endif /* _ASM_COMPAT_H */