diff options
Diffstat (limited to 'include/asm-h8300')
| -rw-r--r-- | include/asm-h8300/atomic.h | 3 | ||||
| -rw-r--r-- | include/asm-h8300/bitops.h | 1 | ||||
| -rw-r--r-- | include/asm-h8300/futex.h | 49 | ||||
| -rw-r--r-- | include/asm-h8300/ioctl.h | 81 | ||||
| -rw-r--r-- | include/asm-h8300/irq.h | 5 | ||||
| -rw-r--r-- | include/asm-h8300/mman.h | 1 | ||||
| -rw-r--r-- | include/asm-h8300/mutex.h | 9 | ||||
| -rw-r--r-- | include/asm-h8300/page.h | 6 | ||||
| -rw-r--r-- | include/asm-h8300/thread_info.h | 2 |
9 files changed, 16 insertions, 141 deletions
diff --git a/include/asm-h8300/atomic.h b/include/asm-h8300/atomic.h index f23d86819ea8..21f54428c86b 100644 --- a/include/asm-h8300/atomic.h +++ b/include/asm-h8300/atomic.h | |||
| @@ -95,6 +95,8 @@ static inline int atomic_cmpxchg(atomic_t *v, int old, int new) | |||
| 95 | return ret; | 95 | return ret; |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) | ||
| 99 | |||
| 98 | static inline int atomic_add_unless(atomic_t *v, int a, int u) | 100 | static inline int atomic_add_unless(atomic_t *v, int a, int u) |
| 99 | { | 101 | { |
| 100 | int ret; | 102 | int ret; |
| @@ -137,4 +139,5 @@ static __inline__ void atomic_set_mask(unsigned long mask, unsigned long *v) | |||
| 137 | #define smp_mb__before_atomic_inc() barrier() | 139 | #define smp_mb__before_atomic_inc() barrier() |
| 138 | #define smp_mb__after_atomic_inc() barrier() | 140 | #define smp_mb__after_atomic_inc() barrier() |
| 139 | 141 | ||
| 142 | #include <asm-generic/atomic.h> | ||
| 140 | #endif /* __ARCH_H8300_ATOMIC __ */ | 143 | #endif /* __ARCH_H8300_ATOMIC __ */ |
diff --git a/include/asm-h8300/bitops.h b/include/asm-h8300/bitops.h index 5036f595f8c9..c0411ec9d651 100644 --- a/include/asm-h8300/bitops.h +++ b/include/asm-h8300/bitops.h | |||
| @@ -406,5 +406,6 @@ found_middle: | |||
| 406 | #endif /* __KERNEL__ */ | 406 | #endif /* __KERNEL__ */ |
| 407 | 407 | ||
| 408 | #define fls(x) generic_fls(x) | 408 | #define fls(x) generic_fls(x) |
| 409 | #define fls64(x) generic_fls64(x) | ||
| 409 | 410 | ||
| 410 | #endif /* _H8300_BITOPS_H */ | 411 | #endif /* _H8300_BITOPS_H */ |
diff --git a/include/asm-h8300/futex.h b/include/asm-h8300/futex.h index 9feff4ce1424..6a332a9f099c 100644 --- a/include/asm-h8300/futex.h +++ b/include/asm-h8300/futex.h | |||
| @@ -1,53 +1,6 @@ | |||
| 1 | #ifndef _ASM_FUTEX_H | 1 | #ifndef _ASM_FUTEX_H |
| 2 | #define _ASM_FUTEX_H | 2 | #define _ASM_FUTEX_H |
| 3 | 3 | ||
| 4 | #ifdef __KERNEL__ | 4 | #include <asm-generic/futex.h> |
| 5 | 5 | ||
| 6 | #include <linux/futex.h> | ||
| 7 | #include <asm/errno.h> | ||
| 8 | #include <asm/uaccess.h> | ||
| 9 | |||
| 10 | static inline int | ||
| 11 | futex_atomic_op_inuser (int encoded_op, int __user *uaddr) | ||
| 12 | { | ||
| 13 | int op = (encoded_op >> 28) & 7; | ||
| 14 | int cmp = (encoded_op >> 24) & 15; | ||
| 15 | int oparg = (encoded_op << 8) >> 20; | ||
| 16 | int cmparg = (encoded_op << 20) >> 20; | ||
| 17 | int oldval = 0, ret; | ||
| 18 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) | ||
| 19 | oparg = 1 << oparg; | ||
| 20 | |||
| 21 | if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) | ||
| 22 | return -EFAULT; | ||
| 23 | |||
| 24 | inc_preempt_count(); | ||
| 25 | |||
| 26 | switch (op) { | ||
| 27 | case FUTEX_OP_SET: | ||
| 28 | case FUTEX_OP_ADD: | ||
| 29 | case FUTEX_OP_OR: | ||
| 30 | case FUTEX_OP_ANDN: | ||
| 31 | case FUTEX_OP_XOR: | ||
| 32 | default: | ||
| 33 | ret = -ENOSYS; | ||
| 34 | } | ||
| 35 | |||
| 36 | dec_preempt_count(); | ||
| 37 | |||
| 38 | if (!ret) { | ||
| 39 | switch (cmp) { | ||
| 40 | case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; | ||
| 41 | case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; | ||
| 42 | case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; | ||
| 43 | case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; | ||
| 44 | case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; | ||
| 45 | case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; | ||
| 46 | default: ret = -ENOSYS; | ||
| 47 | } | ||
| 48 | } | ||
| 49 | return ret; | ||
| 50 | } | ||
| 51 | |||
| 52 | #endif | ||
| 53 | #endif | 6 | #endif |
diff --git a/include/asm-h8300/ioctl.h b/include/asm-h8300/ioctl.h index 031c623478b3..b279fe06dfe5 100644 --- a/include/asm-h8300/ioctl.h +++ b/include/asm-h8300/ioctl.h | |||
| @@ -1,80 +1 @@ | |||
| 1 | /* $Id: ioctl.h,v 1.1 2002/11/19 02:09:26 gerg Exp $ | #include <asm-generic/ioctl.h> | |
| 2 | * | ||
| 3 | * linux/ioctl.h for Linux by H.H. Bergman. | ||
| 4 | */ | ||
| 5 | |||
| 6 | #ifndef _H8300_IOCTL_H | ||
| 7 | #define _H8300_IOCTL_H | ||
| 8 | |||
| 9 | /* ioctl command encoding: 32 bits total, command in lower 16 bits, | ||
| 10 | * size of the parameter structure in the lower 14 bits of the | ||
| 11 | * upper 16 bits. | ||
| 12 | * Encoding the size of the parameter structure in the ioctl request | ||
| 13 | * is useful for catching programs compiled with old versions | ||
| 14 | * and to avoid overwriting user space outside the user buffer area. | ||
| 15 | * The highest 2 bits are reserved for indicating the ``access mode''. | ||
| 16 | * NOTE: This limits the max parameter size to 16kB -1 ! | ||
| 17 | */ | ||
| 18 | |||
| 19 | /* | ||
| 20 | * I don't really have any idea about what this should look like, so | ||
| 21 | * for the time being, this is heavily based on the PC definitions. | ||
| 22 | */ | ||
| 23 | |||
| 24 | /* | ||
| 25 | * The following is for compatibility across the various Linux | ||
| 26 | * platforms. The i386 ioctl numbering scheme doesn't really enforce | ||
| 27 | * a type field. De facto, however, the top 8 bits of the lower 16 | ||
| 28 | * bits are indeed used as a type field, so we might just as well make | ||
| 29 | * this explicit here. Please be sure to use the decoding macros | ||
| 30 | * below from now on. | ||
| 31 | */ | ||
| 32 | #define _IOC_NRBITS 8 | ||
| 33 | #define _IOC_TYPEBITS 8 | ||
| 34 | #define _IOC_SIZEBITS 14 | ||
| 35 | #define _IOC_DIRBITS 2 | ||
| 36 | |||
| 37 | #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) | ||
| 38 | #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) | ||
| 39 | #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) | ||
| 40 | #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) | ||
| 41 | |||
| 42 | #define _IOC_NRSHIFT 0 | ||
| 43 | #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) | ||
| 44 | #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) | ||
| 45 | #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) | ||
| 46 | |||
| 47 | /* | ||
| 48 | * Direction bits. | ||
| 49 | */ | ||
| 50 | #define _IOC_NONE 0U | ||
| 51 | #define _IOC_WRITE 1U | ||
| 52 | #define _IOC_READ 2U | ||
| 53 | |||
| 54 | #define _IOC(dir,type,nr,size) \ | ||
| 55 | (((dir) << _IOC_DIRSHIFT) | \ | ||
| 56 | ((type) << _IOC_TYPESHIFT) | \ | ||
| 57 | ((nr) << _IOC_NRSHIFT) | \ | ||
| 58 | ((size) << _IOC_SIZESHIFT)) | ||
| 59 | |||
| 60 | /* used to create numbers */ | ||
| 61 | #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) | ||
| 62 | #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) | ||
| 63 | #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) | ||
| 64 | #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) | ||
| 65 | |||
| 66 | /* used to decode ioctl numbers.. */ | ||
| 67 | #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) | ||
| 68 | #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) | ||
| 69 | #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) | ||
| 70 | #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) | ||
| 71 | |||
| 72 | /* ...and for the drivers/sound files... */ | ||
| 73 | |||
| 74 | #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) | ||
| 75 | #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) | ||
| 76 | #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) | ||
| 77 | #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) | ||
| 78 | #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) | ||
| 79 | |||
| 80 | #endif /* _H8300_IOCTL_H */ | ||
diff --git a/include/asm-h8300/irq.h b/include/asm-h8300/irq.h index 5027181ed067..73065f5bda0e 100644 --- a/include/asm-h8300/irq.h +++ b/include/asm-h8300/irq.h | |||
| @@ -61,11 +61,6 @@ static __inline__ int irq_canonicalize(int irq) | |||
| 61 | 61 | ||
| 62 | extern void enable_irq(unsigned int); | 62 | extern void enable_irq(unsigned int); |
| 63 | extern void disable_irq(unsigned int); | 63 | extern void disable_irq(unsigned int); |
| 64 | |||
| 65 | /* | ||
| 66 | * Some drivers want these entry points | ||
| 67 | */ | ||
| 68 | #define enable_irq_nosync(x) enable_irq(x) | ||
| 69 | #define disable_irq_nosync(x) disable_irq(x) | 64 | #define disable_irq_nosync(x) disable_irq(x) |
| 70 | 65 | ||
| 71 | struct irqaction; | 66 | struct irqaction; |
diff --git a/include/asm-h8300/mman.h b/include/asm-h8300/mman.h index 63f727a59850..744a8fb485c2 100644 --- a/include/asm-h8300/mman.h +++ b/include/asm-h8300/mman.h | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | #define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */ | 35 | #define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */ |
| 36 | #define MADV_WILLNEED 0x3 /* pre-fault pages */ | 36 | #define MADV_WILLNEED 0x3 /* pre-fault pages */ |
| 37 | #define MADV_DONTNEED 0x4 /* discard these pages */ | 37 | #define MADV_DONTNEED 0x4 /* discard these pages */ |
| 38 | #define MADV_REMOVE 0x5 /* remove these pages & resources */ | ||
| 38 | 39 | ||
| 39 | /* compatibility flags */ | 40 | /* compatibility flags */ |
| 40 | #define MAP_ANON MAP_ANONYMOUS | 41 | #define MAP_ANON MAP_ANONYMOUS |
diff --git a/include/asm-h8300/mutex.h b/include/asm-h8300/mutex.h new file mode 100644 index 000000000000..458c1f7fbc18 --- /dev/null +++ b/include/asm-h8300/mutex.h | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | /* | ||
| 2 | * Pull in the generic implementation for the mutex fastpath. | ||
| 3 | * | ||
| 4 | * TODO: implement optimized primitives instead, or leave the generic | ||
| 5 | * implementation in place, or pick the atomic_xchg() based generic | ||
| 6 | * implementation. (see asm-generic/mutex-xchg.h for details) | ||
| 7 | */ | ||
| 8 | |||
| 9 | #include <asm-generic/mutex-dec.h> | ||
diff --git a/include/asm-h8300/page.h b/include/asm-h8300/page.h index e8c02b8c2d99..cd35b1cc6cde 100644 --- a/include/asm-h8300/page.h +++ b/include/asm-h8300/page.h | |||
| @@ -13,12 +13,6 @@ | |||
| 13 | 13 | ||
| 14 | #include <asm/setup.h> | 14 | #include <asm/setup.h> |
| 15 | 15 | ||
| 16 | #if !defined(CONFIG_SMALL_TASKS) && PAGE_SHIFT < 13 | ||
| 17 | #define KTHREAD_SIZE (8192) | ||
| 18 | #else | ||
| 19 | #define KTHREAD_SIZE PAGE_SIZE | ||
| 20 | #endif | ||
| 21 | |||
| 22 | #ifndef __ASSEMBLY__ | 16 | #ifndef __ASSEMBLY__ |
| 23 | 17 | ||
| 24 | #define get_user_page(vaddr) __get_free_page(GFP_KERNEL) | 18 | #define get_user_page(vaddr) __get_free_page(GFP_KERNEL) |
diff --git a/include/asm-h8300/thread_info.h b/include/asm-h8300/thread_info.h index bfcc755c3bb1..45f09dc9caff 100644 --- a/include/asm-h8300/thread_info.h +++ b/include/asm-h8300/thread_info.h | |||
| @@ -69,8 +69,6 @@ static inline struct thread_info *current_thread_info(void) | |||
| 69 | #define alloc_thread_info(tsk) ((struct thread_info *) \ | 69 | #define alloc_thread_info(tsk) ((struct thread_info *) \ |
| 70 | __get_free_pages(GFP_KERNEL, 1)) | 70 | __get_free_pages(GFP_KERNEL, 1)) |
| 71 | #define free_thread_info(ti) free_pages((unsigned long) (ti), 1) | 71 | #define free_thread_info(ti) free_pages((unsigned long) (ti), 1) |
| 72 | #define get_thread_info(ti) get_task_struct((ti)->task) | ||
| 73 | #define put_thread_info(ti) put_task_struct((ti)->task) | ||
| 74 | #endif /* __ASSEMBLY__ */ | 72 | #endif /* __ASSEMBLY__ */ |
| 75 | 73 | ||
| 76 | /* | 74 | /* |
