diff options
Diffstat (limited to 'include/asm-m32r')
-rw-r--r-- | include/asm-m32r/atomic.h | 1 | ||||
-rw-r--r-- | include/asm-m32r/cache.h | 2 | ||||
-rw-r--r-- | include/asm-m32r/futex.h | 49 | ||||
-rw-r--r-- | include/asm-m32r/ioctl.h | 79 | ||||
-rw-r--r-- | include/asm-m32r/mutex.h | 9 | ||||
-rw-r--r-- | include/asm-m32r/ptrace.h | 3 | ||||
-rw-r--r-- | include/asm-m32r/system.h | 10 | ||||
-rw-r--r-- | include/asm-m32r/thread_info.h | 2 |
8 files changed, 25 insertions, 130 deletions
diff --git a/include/asm-m32r/atomic.h b/include/asm-m32r/atomic.h index 70761278b6cb..3122fe106f05 100644 --- a/include/asm-m32r/atomic.h +++ b/include/asm-m32r/atomic.h | |||
@@ -243,6 +243,7 @@ static __inline__ int atomic_dec_return(atomic_t *v) | |||
243 | #define atomic_add_negative(i,v) (atomic_add_return((i), (v)) < 0) | 243 | #define atomic_add_negative(i,v) (atomic_add_return((i), (v)) < 0) |
244 | 244 | ||
245 | #define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) | 245 | #define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) |
246 | #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) | ||
246 | 247 | ||
247 | /** | 248 | /** |
248 | * atomic_add_unless - add unless the number is a given value | 249 | * atomic_add_unless - add unless the number is a given value |
diff --git a/include/asm-m32r/cache.h b/include/asm-m32r/cache.h index 724820596980..9c2b2d9998bc 100644 --- a/include/asm-m32r/cache.h +++ b/include/asm-m32r/cache.h | |||
@@ -7,6 +7,4 @@ | |||
7 | #define L1_CACHE_SHIFT 4 | 7 | #define L1_CACHE_SHIFT 4 |
8 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) | 8 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) |
9 | 9 | ||
10 | #define L1_CACHE_SHIFT_MAX 4 | ||
11 | |||
12 | #endif /* _ASM_M32R_CACHE_H */ | 10 | #endif /* _ASM_M32R_CACHE_H */ |
diff --git a/include/asm-m32r/futex.h b/include/asm-m32r/futex.h index 9feff4ce1424..6a332a9f099c 100644 --- a/include/asm-m32r/futex.h +++ b/include/asm-m32r/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-m32r/ioctl.h b/include/asm-m32r/ioctl.h index 87d8f7db6af1..b279fe06dfe5 100644 --- a/include/asm-m32r/ioctl.h +++ b/include/asm-m32r/ioctl.h | |||
@@ -1,78 +1 @@ | |||
1 | #ifndef _ASM_M32R_IOCTL_H | #include <asm-generic/ioctl.h> | |
2 | #define _ASM_M32R_IOCTL_H | ||
3 | |||
4 | /* $Id$ */ | ||
5 | |||
6 | /* orig : i386 2.4.18 */ | ||
7 | |||
8 | /* | ||
9 | * linux/ioctl.h for Linux by H.H. Bergman. | ||
10 | */ | ||
11 | |||
12 | /* ioctl command encoding: 32 bits total, command in lower 16 bits, | ||
13 | * size of the parameter structure in the lower 14 bits of the | ||
14 | * upper 16 bits. | ||
15 | * Encoding the size of the parameter structure in the ioctl request | ||
16 | * is useful for catching programs compiled with old versions | ||
17 | * and to avoid overwriting user space outside the user buffer area. | ||
18 | * The highest 2 bits are reserved for indicating the ``access mode''. | ||
19 | * NOTE: This limits the max parameter size to 16kB -1 ! | ||
20 | */ | ||
21 | |||
22 | /* | ||
23 | * The following is for compatibility across the various Linux | ||
24 | * platforms. The i386 ioctl numbering scheme doesn't really enforce | ||
25 | * a type field. De facto, however, the top 8 bits of the lower 16 | ||
26 | * bits are indeed used as a type field, so we might just as well make | ||
27 | * this explicit here. Please be sure to use the decoding macros | ||
28 | * below from now on. | ||
29 | */ | ||
30 | #define _IOC_NRBITS 8 | ||
31 | #define _IOC_TYPEBITS 8 | ||
32 | #define _IOC_SIZEBITS 14 | ||
33 | #define _IOC_DIRBITS 2 | ||
34 | |||
35 | #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) | ||
36 | #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) | ||
37 | #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) | ||
38 | #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) | ||
39 | |||
40 | #define _IOC_NRSHIFT 0 | ||
41 | #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) | ||
42 | #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) | ||
43 | #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) | ||
44 | |||
45 | /* | ||
46 | * Direction bits. | ||
47 | */ | ||
48 | #define _IOC_NONE 0U | ||
49 | #define _IOC_WRITE 1U | ||
50 | #define _IOC_READ 2U | ||
51 | |||
52 | #define _IOC(dir,type,nr,size) \ | ||
53 | (((dir) << _IOC_DIRSHIFT) | \ | ||
54 | ((type) << _IOC_TYPESHIFT) | \ | ||
55 | ((nr) << _IOC_NRSHIFT) | \ | ||
56 | ((size) << _IOC_SIZESHIFT)) | ||
57 | |||
58 | /* used to create numbers */ | ||
59 | #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) | ||
60 | #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) | ||
61 | #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) | ||
62 | #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) | ||
63 | |||
64 | /* used to decode ioctl numbers.. */ | ||
65 | #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) | ||
66 | #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) | ||
67 | #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) | ||
68 | #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) | ||
69 | |||
70 | /* ...and for the drivers/sound files... */ | ||
71 | |||
72 | #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) | ||
73 | #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) | ||
74 | #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) | ||
75 | #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) | ||
76 | #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) | ||
77 | |||
78 | #endif /* _ASM_M32R_IOCTL_H */ | ||
diff --git a/include/asm-m32r/mutex.h b/include/asm-m32r/mutex.h new file mode 100644 index 000000000000..458c1f7fbc18 --- /dev/null +++ b/include/asm-m32r/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-m32r/ptrace.h b/include/asm-m32r/ptrace.h index 55cd7ecfde43..0d058b2d844e 100644 --- a/include/asm-m32r/ptrace.h +++ b/include/asm-m32r/ptrace.h | |||
@@ -163,6 +163,9 @@ extern void show_regs(struct pt_regs *); | |||
163 | 163 | ||
164 | extern void withdraw_debug_trap(struct pt_regs *regs); | 164 | extern void withdraw_debug_trap(struct pt_regs *regs); |
165 | 165 | ||
166 | #define task_pt_regs(task) \ | ||
167 | ((struct pt_regs *)(task_stack_page(task) + THREAD_SIZE) - 1) | ||
168 | |||
166 | #endif /* __KERNEL */ | 169 | #endif /* __KERNEL */ |
167 | 170 | ||
168 | #endif /* _ASM_M32R_PTRACE_H */ | 171 | #endif /* _ASM_M32R_PTRACE_H */ |
diff --git a/include/asm-m32r/system.h b/include/asm-m32r/system.h index dcf619a0a0b0..06c12a037cba 100644 --- a/include/asm-m32r/system.h +++ b/include/asm-m32r/system.h | |||
@@ -68,6 +68,16 @@ | |||
68 | last = __last; \ | 68 | last = __last; \ |
69 | } while(0) | 69 | } while(0) |
70 | 70 | ||
71 | /* | ||
72 | * On SMP systems, when the scheduler does migration-cost autodetection, | ||
73 | * it needs a way to flush as much of the CPU's caches as possible. | ||
74 | * | ||
75 | * TODO: fill this in! | ||
76 | */ | ||
77 | static inline void sched_cacheflush(void) | ||
78 | { | ||
79 | } | ||
80 | |||
71 | /* Interrupt Control */ | 81 | /* Interrupt Control */ |
72 | #if !defined(CONFIG_CHIP_M32102) && !defined(CONFIG_CHIP_M32104) | 82 | #if !defined(CONFIG_CHIP_M32102) && !defined(CONFIG_CHIP_M32104) |
73 | #define local_irq_enable() \ | 83 | #define local_irq_enable() \ |
diff --git a/include/asm-m32r/thread_info.h b/include/asm-m32r/thread_info.h index 0f589363f619..22aff3222d22 100644 --- a/include/asm-m32r/thread_info.h +++ b/include/asm-m32r/thread_info.h | |||
@@ -110,8 +110,6 @@ static inline struct thread_info *current_thread_info(void) | |||
110 | #endif | 110 | #endif |
111 | 111 | ||
112 | #define free_thread_info(info) kfree(info) | 112 | #define free_thread_info(info) kfree(info) |
113 | #define get_thread_info(ti) get_task_struct((ti)->task) | ||
114 | #define put_thread_info(ti) put_task_struct((ti)->task) | ||
115 | 113 | ||
116 | #define TI_FLAG_FAULT_CODE_SHIFT 28 | 114 | #define TI_FLAG_FAULT_CODE_SHIFT 28 |
117 | 115 | ||