Update of /cvsroot/ssic-linux/openssi/kernel/include/asm-i386
In directory
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1091/kernel/include/asm-i386
Modified Files:
uaccess.h
Log Message:
Merge different version of rcopy hooks.
Index: uaccess.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/include/asm-i386/uaccess.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- uaccess.h 21 Oct 2004 08:48:18 -0000 1.5
+++ uaccess.h 28 Oct 2004 02:25:42 -0000 1.6
@@ -10,9 +10,6 @@
#include <linux/prefetch.h>
#include <linux/string.h>
#include <asm/page.h>
-#ifdef CONFIG_SSI
-#include <cluster/ssi/rcopy.h>
-#endif
#define VERIFY_READ 0
#define VERIFY_WRITE 1
@@ -172,36 +169,7 @@
* Returns zero on success, or -EFAULT on error.
* On error, the variable @x is set to zero.
*/
-#ifdef CONFIG_SSI
-
-#define get_user(x,ptr)
\
-({ int __ret_gu,__val_gu; \
- const __typeof__(*(ptr)) *__addr_gu = (ptr); \
- if (ssi_rcopy_is_remote(__addr_gu)) { \
- if (!ssi_rcopy_from_user(&__val_gu, __addr_gu, \
- sizeof(*(ptr)))) \
- __ret_gu = 0; \
- else \
- __ret_gu = -EFAULT; \
- } else { \
- switch(sizeof (*(ptr))) { \
- case 1: __get_user_x(1,__ret_gu,__val_gu,__addr_gu); \
- break; \
- case 2: __get_user_x(2,__ret_gu,__val_gu,__addr_gu); \
- break; \
- case 4: __get_user_x(4,__ret_gu,__val_gu,__addr_gu); \
- break; \
- default: __get_user_x(X,__ret_gu,__val_gu,__addr_gu); \
- break; \
- } \
- } \
- (x) = (__typeof__(*(ptr)))__val_gu; \
- __ret_gu; \
-})
-
-#else /* !CONFIG_SSI */
-
-#define get_user(x,ptr)
\
+#define get_user_lcl(x,ptr) \
({ int __ret_gu,__val_gu; \
__chk_user_ptr(ptr); \
switch(sizeof (*(ptr))) { \
@@ -213,7 +181,6 @@
(x) = (__typeof__(*(ptr)))__val_gu; \
__ret_gu; \
})
-#endif /* CONFIG_SSI */
extern void __put_user_bad(void);
@@ -233,7 +200,7 @@
*
* Returns zero on success, or -EFAULT on error.
*/
-#define put_user(x,ptr)
\
+#define put_user_lcl(x,ptr)
\
__put_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
@@ -257,7 +224,7 @@
* Returns zero on success, or -EFAULT on error.
* On error, the variable @x is set to zero.
*/
-#define __get_user(x,ptr) \
+#define __get_user_lcl(x,ptr) \
__get_user_nocheck((x),(ptr),sizeof(*(ptr)))
@@ -280,43 +247,9 @@
*
* Returns zero on success, or -EFAULT on error.
*/
-#define __put_user(x,ptr) \
+#define __put_user_lcl(x,ptr) \
__put_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
-#ifdef CONFIG_SSI
-
-#define __put_user_nocheck(x,ptr,size) \
-({ \
- long __pu_err = -EFAULT; \
- __typeof__(*(ptr)) *__pu_addr = (ptr); \
- if (ssi_rcopy_is_remote(__pu_addr)) { \
- __typeof__(*(ptr)) __pu_val = (__typeof__(*(ptr)))(x); \
- if (!ssi_rcopy_to_user(__pu_addr, &__pu_val, \
- (u_long)size)) \
- __pu_err = 0; \
- } else \
- __put_user_size((__typeof__(*(ptr)))(x),__pu_addr, \
- (size),__pu_err, -EFAULT); \
- __pu_err; \
-})
-
-#define __put_user_check(x,ptr,size) \
-({ \
- long __pu_err = -EFAULT ; \
- __typeof__(*(ptr)) *__pu_addr = (ptr); \
- if (ssi_rcopy_is_remote(__pu_addr)) { \
- __typeof__(*(ptr)) __pu_val = (__typeof__(*(ptr)))(x); \
- if (!ssi_rcopy_to_user(__pu_addr, &__pu_val, \
- (u_long)size)) \
- __pu_err = 0; \
- } else if (access_ok(VERIFY_WRITE,__pu_addr,size)) \
- __put_user_size((__typeof__(*(ptr)))(x),__pu_addr, \
- (size),__pu_err, -EFAULT); \
- __pu_err; \
-})
-
-#else /* !CONFIG_SSI */
-
#define __put_user_nocheck(x,ptr,size) \
({ \
long __pu_err; \
@@ -334,7 +267,6 @@
__put_user_size((x),__pu_addr,(size),__pu_err,-EFAULT); \
__pu_err; \
})
-#endif /* CONFIG_SSI */
#define __put_user_u64(x, addr, err) \
__asm__ __volatile__( \
@@ -404,25 +336,6 @@
: ltype (x), "m"(__m(addr)), "i"(errret), "0"(err))
-#ifdef CONFIG_SSI
-
-#define __get_user_nocheck(x,ptr,size) \
-({ \
- long __gu_err, __gu_val; \
- const __typeof__(*(ptr)) *__gu_addr = (ptr); \
- if (ssi_rcopy_is_remote(__gu_addr)) { \
- if (!ssi_rcopy_from_user(&__gu_val, __gu_addr, (size))) \
- __gu_err = 0; \
- else \
- __gu_err = -EFAULT; \
- } else \
- __get_user_size(__gu_val,__gu_addr,(size),__gu_err, -EFAULT);
\
- (x) = (__typeof__(*(ptr)))__gu_val; \
- __gu_err; \
-})
-
-#else /* !CONFIG_SSI */
-
#define __get_user_nocheck(x,ptr,size) \
({ \
long __gu_err, __gu_val; \
@@ -431,8 +344,6 @@
__gu_err; \
})
-#endif /* CONFIG_SSI */
-
extern long __get_user_bad(void);
#define __get_user_size(x,ptr,size,retval,errret) \
@@ -489,13 +400,8 @@
* On success, this will be zero.
*/
static inline unsigned long
-__copy_to_user(void __user *to, const void *from, unsigned long n)
+__copy_to_user_lcl(void __user *to, const void *from, unsigned long n)
{
-#ifdef CONFIG_SSI
- if (ssi_rcopy_is_remote(to))
- return ssi_rcopy_to_user(to, from, n);
-#endif /* CONFIG_SSI */
-
if (__builtin_constant_p(n)) {
unsigned long ret;
@@ -511,7 +417,6 @@
return ret;
}
}
-
return __copy_to_user_ll(to, from, n);
}
@@ -533,13 +438,8 @@
* data to the requested size using zero bytes.
*/
static inline unsigned long
-__copy_from_user(void *to, const void __user *from, unsigned long n)
+__copy_from_user_lcl(void *to, const void __user *from, unsigned long n)
{
-#ifdef CONFIG_SSI
- if (ssi_rcopy_is_remote(from))
- return ssi_rcopy_from_user(to, from, n);
-#endif /* CONFIG_SSI */
-
if (__builtin_constant_p(n)) {
unsigned long ret;
@@ -555,15 +455,15 @@
return ret;
}
}
-
return __copy_from_user_ll(to, from, n);
}
-unsigned long copy_to_user(void __user *to, const void *from, unsigned long n);
-unsigned long copy_from_user(void *to,
+unsigned long copy_to_user_lcl(void __user *to, const void *from,
+ unsigned long n);
+unsigned long copy_from_user_lcl(void *to,
const void __user *from, unsigned long n);
-long strncpy_from_user(char *dst, const char __user *src, long count);
-long __strncpy_from_user(char *dst, const char __user *src, long count);
+long strncpy_from_user_lcl(char *dst, const char __user *src, long count);
+long __strncpy_from_user_lcl(char *dst, const char __user *src, long count);
/**
* strlen_user: - Get the size of a string in user space.
@@ -579,10 +479,12 @@
* If there is a limit on the length of a valid string, you may wish to
* consider using strnlen_user() instead.
*/
-#define strlen_user(str) strnlen_user(str, ~0UL >> 1)
+#define strlen_user_lcl(str) strnlen_user_lcl(str, ~0UL >> 1)
-long strnlen_user(const char __user *str, long n);
-unsigned long clear_user(void __user *mem, unsigned long len);
-unsigned long __clear_user(void __user *mem, unsigned long len);
+long strnlen_user_lcl(const char __user *str, long n);
+unsigned long clear_user_lcl(void __user *mem, unsigned long len);
+unsigned long __clear_user_lcl(void __user *mem, unsigned long len);
+
+#include <cluster/ssi/rcopy_uaccess.h>
#endif /* __i386_UACCESS_H */
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
|