diff options
Diffstat (limited to 'include/asm-sh64')
-rw-r--r-- | include/asm-sh64/auxvec.h | 4 | ||||
-rw-r--r-- | include/asm-sh64/fcntl.h | 6 | ||||
-rw-r--r-- | include/asm-sh64/futex.h | 53 | ||||
-rw-r--r-- | include/asm-sh64/hdreg.h | 6 | ||||
-rw-r--r-- | include/asm-sh64/uaccess.h | 6 |
5 files changed, 57 insertions, 18 deletions
diff --git a/include/asm-sh64/auxvec.h b/include/asm-sh64/auxvec.h new file mode 100644 index 00000000000..1ad5a44bdc7 --- /dev/null +++ b/include/asm-sh64/auxvec.h @@ -0,0 +1,4 @@ +#ifndef __ASM_SH64_AUXVEC_H +#define __ASM_SH64_AUXVEC_H + +#endif /* __ASM_SH64_AUXVEC_H */ diff --git a/include/asm-sh64/fcntl.h b/include/asm-sh64/fcntl.h index ffcc36c64fa..744dd79b9d5 100644 --- a/include/asm-sh64/fcntl.h +++ b/include/asm-sh64/fcntl.h @@ -1,7 +1 @@ -#ifndef __ASM_SH64_FCNTL_H -#define __ASM_SH64_FCNTL_H - #include <asm-sh/fcntl.h> - -#endif /* __ASM_SH64_FCNTL_H */ - diff --git a/include/asm-sh64/futex.h b/include/asm-sh64/futex.h new file mode 100644 index 00000000000..2cac5ecd9d0 --- /dev/null +++ b/include/asm-sh64/futex.h @@ -0,0 +1,53 @@ +#ifndef _ASM_FUTEX_H +#define _ASM_FUTEX_H + +#ifdef __KERNEL__ + +#include <linux/futex.h> +#include <asm/errno.h> +#include <asm/uaccess.h> + +static inline int +futex_atomic_op_inuser (int encoded_op, int __user *uaddr) +{ + int op = (encoded_op >> 28) & 7; + int cmp = (encoded_op >> 24) & 15; + int oparg = (encoded_op << 8) >> 20; + int cmparg = (encoded_op << 20) >> 20; + int oldval = 0, ret, tem; + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) + oparg = 1 << oparg; + + if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) + return -EFAULT; + + inc_preempt_count(); + + switch (op) { + case FUTEX_OP_SET: + case FUTEX_OP_ADD: + case FUTEX_OP_OR: + case FUTEX_OP_ANDN: + case FUTEX_OP_XOR: + default: + ret = -ENOSYS; + } + + dec_preempt_count(); + + if (!ret) { + switch (cmp) { + case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; + case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; + case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; + case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; + case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; + case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; + default: ret = -ENOSYS; + } + } + return ret; +} + +#endif +#endif diff --git a/include/asm-sh64/hdreg.h b/include/asm-sh64/hdreg.h deleted file mode 100644 index 52d983635a2..00000000000 --- a/include/asm-sh64/hdreg.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __ASM_SH64_HDREG_H -#define __ASM_SH64_HDREG_H - -#include <asm-generic/hdreg.h> - -#endif /* __ASM_SH64_HDREG_H */ diff --git a/include/asm-sh64/uaccess.h b/include/asm-sh64/uaccess.h index a33654d576a..56aa3cf0f27 100644 --- a/include/asm-sh64/uaccess.h +++ b/include/asm-sh64/uaccess.h @@ -60,12 +60,6 @@ #define access_ok(type,addr,size) (__range_ok(addr,size) == 0) #define __access_ok(addr,size) (__range_ok(addr,size) == 0) -/* this function will go away soon - use access_ok() instead */ -extern inline int __deprecated 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 |