diff options
author | Anton Altaparmakov <aia21@cantab.net> | 2006-01-19 11:39:33 -0500 |
---|---|---|
committer | Anton Altaparmakov <aia21@cantab.net> | 2006-01-19 11:39:33 -0500 |
commit | 944d79559d154c12becde0dab327016cf438f46c (patch) | |
tree | 50c101806f4d3b6585222dda060559eb4f3e005a /include/asm-sparc | |
parent | d087e4bdd24ebe3ae3d0b265b6573ec901af4b4b (diff) | |
parent | 0f36b018b2e314d45af86449f1a97facb1fbe300 (diff) |
Merge branch 'master' of /usr/src/ntfs-2.6/
Diffstat (limited to 'include/asm-sparc')
-rw-r--r-- | include/asm-sparc/atomic.h | 2 | ||||
-rw-r--r-- | include/asm-sparc/bitops.h | 1 | ||||
-rw-r--r-- | include/asm-sparc/cache.h | 1 | ||||
-rw-r--r-- | include/asm-sparc/futex.h | 49 | ||||
-rw-r--r-- | include/asm-sparc/mman.h | 1 | ||||
-rw-r--r-- | include/asm-sparc/mutex.h | 9 | ||||
-rw-r--r-- | include/asm-sparc/system.h | 12 | ||||
-rw-r--r-- | include/asm-sparc/thread_info.h | 3 |
8 files changed, 25 insertions, 53 deletions
diff --git a/include/asm-sparc/atomic.h b/include/asm-sparc/atomic.h index 62bec7ad271c..e1033170bd3a 100644 --- a/include/asm-sparc/atomic.h +++ b/include/asm-sparc/atomic.h | |||
@@ -20,6 +20,7 @@ typedef struct { volatile int counter; } atomic_t; | |||
20 | 20 | ||
21 | extern int __atomic_add_return(int, atomic_t *); | 21 | extern int __atomic_add_return(int, atomic_t *); |
22 | extern int atomic_cmpxchg(atomic_t *, int, int); | 22 | extern int atomic_cmpxchg(atomic_t *, int, int); |
23 | #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) | ||
23 | extern int atomic_add_unless(atomic_t *, int, int); | 24 | extern int atomic_add_unless(atomic_t *, int, int); |
24 | extern void atomic_set(atomic_t *, int); | 25 | extern void atomic_set(atomic_t *, int); |
25 | 26 | ||
@@ -159,4 +160,5 @@ static inline int __atomic24_sub(int i, atomic24_t *v) | |||
159 | 160 | ||
160 | #endif /* !(__KERNEL__) */ | 161 | #endif /* !(__KERNEL__) */ |
161 | 162 | ||
163 | #include <asm-generic/atomic.h> | ||
162 | #endif /* !(__ARCH_SPARC_ATOMIC__) */ | 164 | #endif /* !(__ARCH_SPARC_ATOMIC__) */ |
diff --git a/include/asm-sparc/bitops.h b/include/asm-sparc/bitops.h index bfbd795a0a80..41722b5e45ef 100644 --- a/include/asm-sparc/bitops.h +++ b/include/asm-sparc/bitops.h | |||
@@ -298,6 +298,7 @@ static inline int ffs(int x) | |||
298 | * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32. | 298 | * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32. |
299 | */ | 299 | */ |
300 | #define fls(x) generic_fls(x) | 300 | #define fls(x) generic_fls(x) |
301 | #define fls64(x) generic_fls64(x) | ||
301 | 302 | ||
302 | /* | 303 | /* |
303 | * hweightN: returns the hamming weight (i.e. the number | 304 | * hweightN: returns the hamming weight (i.e. the number |
diff --git a/include/asm-sparc/cache.h b/include/asm-sparc/cache.h index a10522cb21b7..cb971e88aea4 100644 --- a/include/asm-sparc/cache.h +++ b/include/asm-sparc/cache.h | |||
@@ -13,7 +13,6 @@ | |||
13 | #define L1_CACHE_SHIFT 5 | 13 | #define L1_CACHE_SHIFT 5 |
14 | #define L1_CACHE_BYTES 32 | 14 | #define L1_CACHE_BYTES 32 |
15 | #define L1_CACHE_ALIGN(x) ((((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))) | 15 | #define L1_CACHE_ALIGN(x) ((((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))) |
16 | #define L1_CACHE_SHIFT_MAX 5 /* largest L1 which this arch supports */ | ||
17 | 16 | ||
18 | #define SMP_CACHE_BYTES 32 | 17 | #define SMP_CACHE_BYTES 32 |
19 | 18 | ||
diff --git a/include/asm-sparc/futex.h b/include/asm-sparc/futex.h index 9feff4ce1424..6a332a9f099c 100644 --- a/include/asm-sparc/futex.h +++ b/include/asm-sparc/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-sparc/mman.h b/include/asm-sparc/mman.h index 138eb81dd70d..98435ad8619e 100644 --- a/include/asm-sparc/mman.h +++ b/include/asm-sparc/mman.h | |||
@@ -54,6 +54,7 @@ | |||
54 | #define MADV_WILLNEED 0x3 /* pre-fault pages */ | 54 | #define MADV_WILLNEED 0x3 /* pre-fault pages */ |
55 | #define MADV_DONTNEED 0x4 /* discard these pages */ | 55 | #define MADV_DONTNEED 0x4 /* discard these pages */ |
56 | #define MADV_FREE 0x5 /* (Solaris) contents can be freed */ | 56 | #define MADV_FREE 0x5 /* (Solaris) contents can be freed */ |
57 | #define MADV_REMOVE 0x6 /* remove these pages & resources */ | ||
57 | 58 | ||
58 | /* compatibility flags */ | 59 | /* compatibility flags */ |
59 | #define MAP_ANON MAP_ANONYMOUS | 60 | #define MAP_ANON MAP_ANONYMOUS |
diff --git a/include/asm-sparc/mutex.h b/include/asm-sparc/mutex.h new file mode 100644 index 000000000000..458c1f7fbc18 --- /dev/null +++ b/include/asm-sparc/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-sparc/system.h b/include/asm-sparc/system.h index 1f6b71f9e1b6..58dd162927bb 100644 --- a/include/asm-sparc/system.h +++ b/include/asm-sparc/system.h | |||
@@ -155,7 +155,7 @@ extern void fpsave(unsigned long *fpregs, unsigned long *fsr, | |||
155 | "here:\n" \ | 155 | "here:\n" \ |
156 | : "=&r" (last) \ | 156 | : "=&r" (last) \ |
157 | : "r" (&(current_set[hard_smp_processor_id()])), \ | 157 | : "r" (&(current_set[hard_smp_processor_id()])), \ |
158 | "r" ((next)->thread_info), \ | 158 | "r" (task_thread_info(next)), \ |
159 | "i" (TI_KPSR), \ | 159 | "i" (TI_KPSR), \ |
160 | "i" (TI_KSP), \ | 160 | "i" (TI_KSP), \ |
161 | "i" (TI_TASK) \ | 161 | "i" (TI_TASK) \ |
@@ -166,6 +166,16 @@ extern void fpsave(unsigned long *fpregs, unsigned long *fsr, | |||
166 | } while(0) | 166 | } while(0) |
167 | 167 | ||
168 | /* | 168 | /* |
169 | * On SMP systems, when the scheduler does migration-cost autodetection, | ||
170 | * it needs a way to flush as much of the CPU's caches as possible. | ||
171 | * | ||
172 | * TODO: fill this in! | ||
173 | */ | ||
174 | static inline void sched_cacheflush(void) | ||
175 | { | ||
176 | } | ||
177 | |||
178 | /* | ||
169 | * Changing the IRQ level on the Sparc. | 179 | * Changing the IRQ level on the Sparc. |
170 | */ | 180 | */ |
171 | extern void local_irq_restore(unsigned long); | 181 | extern void local_irq_restore(unsigned long); |
diff --git a/include/asm-sparc/thread_info.h b/include/asm-sparc/thread_info.h index ff6ccb3d24c6..65f060b040ab 100644 --- a/include/asm-sparc/thread_info.h +++ b/include/asm-sparc/thread_info.h | |||
@@ -92,9 +92,6 @@ BTFIXUPDEF_CALL(struct thread_info *, alloc_thread_info, void) | |||
92 | BTFIXUPDEF_CALL(void, free_thread_info, struct thread_info *) | 92 | BTFIXUPDEF_CALL(void, free_thread_info, struct thread_info *) |
93 | #define free_thread_info(ti) BTFIXUP_CALL(free_thread_info)(ti) | 93 | #define free_thread_info(ti) BTFIXUP_CALL(free_thread_info)(ti) |
94 | 94 | ||
95 | #define get_thread_info(ti) get_task_struct((ti)->task) | ||
96 | #define put_thread_info(ti) put_task_struct((ti)->task) | ||
97 | |||
98 | #endif /* __ASSEMBLY__ */ | 95 | #endif /* __ASSEMBLY__ */ |
99 | 96 | ||
100 | /* | 97 | /* |