X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-sh64%2Fuaccess.h;h=644c67b65f94596a208a3015f86ba6b37fc695ed;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=588065c6399f896b7688ef104104dba9971e48a5;hpb=5fc42a6ed0ec81088c37caadb45898ae6cd0ad2c;p=linux-2.6.git diff --git a/include/asm-sh64/uaccess.h b/include/asm-sh64/uaccess.h index 588065c63..644c67b65 100644 --- a/include/asm-sh64/uaccess.h +++ b/include/asm-sh64/uaccess.h @@ -60,11 +60,6 @@ #define access_ok(type,addr,size) (__range_ok(addr,size) == 0) #define __access_ok(addr,size) (__range_ok(addr,size) == 0) -extern inline int verify_area(int type, const void __user * addr, unsigned long size) -{ - return access_ok(type,addr,size) ? 0 : -EFAULT; -} - /* * Uh, these should become the main single-value transfer routines ... * They automatically use the right size if we just have the right @@ -133,25 +128,20 @@ do { \ #define __get_user_nocheck(x,ptr,size) \ ({ \ - long __gu_addr = (long)(ptr); \ - long __gu_err; \ - __typeof(*(ptr)) __gu_val; \ - __asm__ ("":"=r" (__gu_val)); \ - __asm__ ("":"=r" (__gu_err)); \ - __get_user_size((void *)&__gu_val, __gu_addr, (size), __gu_err); \ - (x) = (__typeof__(*(ptr))) __gu_val; \ + long __gu_err, __gu_val; \ + __get_user_size((void *)&__gu_val, (long)(ptr), \ + (size), __gu_err); \ + (x) = (__typeof__(*(ptr)))__gu_val; \ __gu_err; \ }) #define __get_user_check(x,ptr,size) \ ({ \ long __gu_addr = (long)(ptr); \ - long __gu_err = -EFAULT; \ - __typeof(*(ptr)) __gu_val; \ - __asm__ ("":"=r" (__gu_val)); \ - __asm__ ("":"=r" (__gu_err)); \ + long __gu_err = -EFAULT, __gu_val; \ if (__access_ok(__gu_addr, (size))) \ - __get_user_size((void *)&__gu_val, __gu_addr, (size), __gu_err); \ + __get_user_size((void *)&__gu_val, __gu_addr, \ + (size), __gu_err); \ (x) = (__typeof__(*(ptr))) __gu_val; \ __gu_err; \ }) @@ -292,7 +282,7 @@ __sfu_res = __strncpy_from_user((unsigned long) (dest), __sfu_src, __sfu_count); */ extern long __strnlen_user(const char *__s, long __n); -extern __inline__ long strnlen_user(const char *s, long n) +static inline long strnlen_user(const char *s, long n) { if (!__addr_ok(s)) return 0; @@ -313,6 +303,12 @@ struct exception_table_entry sh64 at the moment). */ #define ARCH_KMALLOC_MINALIGN 8 +/* + * We want 8-byte alignment for the slab caches as well, otherwise we have + * the same BYTES_PER_WORD (sizeof(void *)) min align in kmem_cache_create(). + */ +#define ARCH_SLAB_MINALIGN 8 + /* Returns 0 if exception not found and fixup.unit otherwise. */ extern unsigned long search_exception_table(unsigned long addr); extern const struct exception_table_entry *search_exception_tables (unsigned long addr);