diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2015-03-26 05:03:16 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2015-03-26 05:04:28 -0400 |
commit | df60f57684529a1dde4461cf84354453b440806a (patch) | |
tree | 618f030f673980a4c9d6bf27c1db50459a3b99d1 /arch/powerpc/lib | |
parent | 605f30205348f1d808d98d77505149da8b047b9f (diff) | |
parent | b921e90260cec1e04988bb3763491de885b67b51 (diff) |
Merge branch 'next-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc into test
Merge miscellaneous bits from benh. Fix a minor conflict with
OpalMessageType changing names to opal_msg_type.
Diffstat (limited to 'arch/powerpc/lib')
-rw-r--r-- | arch/powerpc/lib/copy_32.S | 127 | ||||
-rw-r--r-- | arch/powerpc/lib/locks.c | 1 | ||||
-rw-r--r-- | arch/powerpc/lib/ppc_ksyms.c | 4 |
3 files changed, 1 insertions, 131 deletions
diff --git a/arch/powerpc/lib/copy_32.S b/arch/powerpc/lib/copy_32.S index 55f19f9fd708..6813f80d1eec 100644 --- a/arch/powerpc/lib/copy_32.S +++ b/arch/powerpc/lib/copy_32.S | |||
@@ -69,54 +69,6 @@ CACHELINE_BYTES = L1_CACHE_BYTES | |||
69 | LG_CACHELINE_BYTES = L1_CACHE_SHIFT | 69 | LG_CACHELINE_BYTES = L1_CACHE_SHIFT |
70 | CACHELINE_MASK = (L1_CACHE_BYTES-1) | 70 | CACHELINE_MASK = (L1_CACHE_BYTES-1) |
71 | 71 | ||
72 | /* | ||
73 | * Use dcbz on the complete cache lines in the destination | ||
74 | * to set them to zero. This requires that the destination | ||
75 | * area is cacheable. -- paulus | ||
76 | */ | ||
77 | _GLOBAL(cacheable_memzero) | ||
78 | mr r5,r4 | ||
79 | li r4,0 | ||
80 | addi r6,r3,-4 | ||
81 | cmplwi 0,r5,4 | ||
82 | blt 7f | ||
83 | stwu r4,4(r6) | ||
84 | beqlr | ||
85 | andi. r0,r6,3 | ||
86 | add r5,r0,r5 | ||
87 | subf r6,r0,r6 | ||
88 | clrlwi r7,r6,32-LG_CACHELINE_BYTES | ||
89 | add r8,r7,r5 | ||
90 | srwi r9,r8,LG_CACHELINE_BYTES | ||
91 | addic. r9,r9,-1 /* total number of complete cachelines */ | ||
92 | ble 2f | ||
93 | xori r0,r7,CACHELINE_MASK & ~3 | ||
94 | srwi. r0,r0,2 | ||
95 | beq 3f | ||
96 | mtctr r0 | ||
97 | 4: stwu r4,4(r6) | ||
98 | bdnz 4b | ||
99 | 3: mtctr r9 | ||
100 | li r7,4 | ||
101 | 10: dcbz r7,r6 | ||
102 | addi r6,r6,CACHELINE_BYTES | ||
103 | bdnz 10b | ||
104 | clrlwi r5,r8,32-LG_CACHELINE_BYTES | ||
105 | addi r5,r5,4 | ||
106 | 2: srwi r0,r5,2 | ||
107 | mtctr r0 | ||
108 | bdz 6f | ||
109 | 1: stwu r4,4(r6) | ||
110 | bdnz 1b | ||
111 | 6: andi. r5,r5,3 | ||
112 | 7: cmpwi 0,r5,0 | ||
113 | beqlr | ||
114 | mtctr r5 | ||
115 | addi r6,r6,3 | ||
116 | 8: stbu r4,1(r6) | ||
117 | bdnz 8b | ||
118 | blr | ||
119 | |||
120 | _GLOBAL(memset) | 72 | _GLOBAL(memset) |
121 | rlwimi r4,r4,8,16,23 | 73 | rlwimi r4,r4,8,16,23 |
122 | rlwimi r4,r4,16,0,15 | 74 | rlwimi r4,r4,16,0,15 |
@@ -142,85 +94,6 @@ _GLOBAL(memset) | |||
142 | bdnz 8b | 94 | bdnz 8b |
143 | blr | 95 | blr |
144 | 96 | ||
145 | /* | ||
146 | * This version uses dcbz on the complete cache lines in the | ||
147 | * destination area to reduce memory traffic. This requires that | ||
148 | * the destination area is cacheable. | ||
149 | * We only use this version if the source and dest don't overlap. | ||
150 | * -- paulus. | ||
151 | */ | ||
152 | _GLOBAL(cacheable_memcpy) | ||
153 | add r7,r3,r5 /* test if the src & dst overlap */ | ||
154 | add r8,r4,r5 | ||
155 | cmplw 0,r4,r7 | ||
156 | cmplw 1,r3,r8 | ||
157 | crand 0,0,4 /* cr0.lt &= cr1.lt */ | ||
158 | blt memcpy /* if regions overlap */ | ||
159 | |||
160 | addi r4,r4,-4 | ||
161 | addi r6,r3,-4 | ||
162 | neg r0,r3 | ||
163 | andi. r0,r0,CACHELINE_MASK /* # bytes to start of cache line */ | ||
164 | beq 58f | ||
165 | |||
166 | cmplw 0,r5,r0 /* is this more than total to do? */ | ||
167 | blt 63f /* if not much to do */ | ||
168 | andi. r8,r0,3 /* get it word-aligned first */ | ||
169 | subf r5,r0,r5 | ||
170 | mtctr r8 | ||
171 | beq+ 61f | ||
172 | 70: lbz r9,4(r4) /* do some bytes */ | ||
173 | stb r9,4(r6) | ||
174 | addi r4,r4,1 | ||
175 | addi r6,r6,1 | ||
176 | bdnz 70b | ||
177 | 61: srwi. r0,r0,2 | ||
178 | mtctr r0 | ||
179 | beq 58f | ||
180 | 72: lwzu r9,4(r4) /* do some words */ | ||
181 | stwu r9,4(r6) | ||
182 | bdnz 72b | ||
183 | |||
184 | 58: srwi. r0,r5,LG_CACHELINE_BYTES /* # complete cachelines */ | ||
185 | clrlwi r5,r5,32-LG_CACHELINE_BYTES | ||
186 | li r11,4 | ||
187 | mtctr r0 | ||
188 | beq 63f | ||
189 | 53: | ||
190 | dcbz r11,r6 | ||
191 | COPY_16_BYTES | ||
192 | #if L1_CACHE_BYTES >= 32 | ||
193 | COPY_16_BYTES | ||
194 | #if L1_CACHE_BYTES >= 64 | ||
195 | COPY_16_BYTES | ||
196 | COPY_16_BYTES | ||
197 | #if L1_CACHE_BYTES >= 128 | ||
198 | COPY_16_BYTES | ||
199 | COPY_16_BYTES | ||
200 | COPY_16_BYTES | ||
201 | COPY_16_BYTES | ||
202 | #endif | ||
203 | #endif | ||
204 | #endif | ||
205 | bdnz 53b | ||
206 | |||
207 | 63: srwi. r0,r5,2 | ||
208 | mtctr r0 | ||
209 | beq 64f | ||
210 | 30: lwzu r0,4(r4) | ||
211 | stwu r0,4(r6) | ||
212 | bdnz 30b | ||
213 | |||
214 | 64: andi. r0,r5,3 | ||
215 | mtctr r0 | ||
216 | beq+ 65f | ||
217 | 40: lbz r0,4(r4) | ||
218 | stb r0,4(r6) | ||
219 | addi r4,r4,1 | ||
220 | addi r6,r6,1 | ||
221 | bdnz 40b | ||
222 | 65: blr | ||
223 | |||
224 | _GLOBAL(memmove) | 97 | _GLOBAL(memmove) |
225 | cmplw 0,r3,r4 | 98 | cmplw 0,r3,r4 |
226 | bgt backwards_memcpy | 99 | bgt backwards_memcpy |
diff --git a/arch/powerpc/lib/locks.c b/arch/powerpc/lib/locks.c index 170a0346f756..f7deebdf3365 100644 --- a/arch/powerpc/lib/locks.c +++ b/arch/powerpc/lib/locks.c | |||
@@ -41,6 +41,7 @@ void __spin_yield(arch_spinlock_t *lock) | |||
41 | plpar_hcall_norets(H_CONFER, | 41 | plpar_hcall_norets(H_CONFER, |
42 | get_hard_smp_processor_id(holder_cpu), yield_count); | 42 | get_hard_smp_processor_id(holder_cpu), yield_count); |
43 | } | 43 | } |
44 | EXPORT_SYMBOL_GPL(__spin_yield); | ||
44 | 45 | ||
45 | /* | 46 | /* |
46 | * Waiting for a read lock or a write lock on a rwlock... | 47 | * Waiting for a read lock or a write lock on a rwlock... |
diff --git a/arch/powerpc/lib/ppc_ksyms.c b/arch/powerpc/lib/ppc_ksyms.c index f993959647b5..c7f8e9586316 100644 --- a/arch/powerpc/lib/ppc_ksyms.c +++ b/arch/powerpc/lib/ppc_ksyms.c | |||
@@ -8,10 +8,6 @@ EXPORT_SYMBOL(memset); | |||
8 | EXPORT_SYMBOL(memmove); | 8 | EXPORT_SYMBOL(memmove); |
9 | EXPORT_SYMBOL(memcmp); | 9 | EXPORT_SYMBOL(memcmp); |
10 | EXPORT_SYMBOL(memchr); | 10 | EXPORT_SYMBOL(memchr); |
11 | #ifdef CONFIG_PPC32 | ||
12 | EXPORT_SYMBOL(cacheable_memcpy); | ||
13 | EXPORT_SYMBOL(cacheable_memzero); | ||
14 | #endif | ||
15 | 11 | ||
16 | EXPORT_SYMBOL(strcpy); | 12 | EXPORT_SYMBOL(strcpy); |
17 | EXPORT_SYMBOL(strncpy); | 13 | EXPORT_SYMBOL(strncpy); |