aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/um
diff options
context:
space:
mode:
authorHonggang Li <enjoymindful@gmail.com>2014-06-05 00:15:24 -0400
committerRichard Weinberger <richard@nod.at>2014-10-13 11:15:02 -0400
commit671312304ec73059a0128ff3ac7a5ced459098ae (patch)
tree8ecfc2bc434edd845a89bf10e4cc74c3129fcfa0 /arch/x86/um
parentc798360cd1438090d51eeaa8e67985da11362eba (diff)
um: remove csum_partial_copy_generic_i386 to clean up exception table
arch/x86/um/checksum_32.S had been copy & paste from x86. When build x86 uml, csum_partial_copy_generic_i386 mess up the exception table. In fact, exception table dose not work in uml kernel. And csum_partial_copy_generic_i386 never been called. So, delete it. Signed-off-by: Honggang Li <enjoymindful@gmail.com> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/x86/um')
-rw-r--r--arch/x86/um/checksum_32.S239
1 files changed, 0 insertions, 239 deletions
diff --git a/arch/x86/um/checksum_32.S b/arch/x86/um/checksum_32.S
index 8d0c420465cc..fa4b8b9841ff 100644
--- a/arch/x86/um/checksum_32.S
+++ b/arch/x86/um/checksum_32.S
@@ -214,242 +214,3 @@ csum_partial:
214 ret 214 ret
215 215
216#endif 216#endif
217
218/*
219unsigned int csum_partial_copy_generic (const char *src, char *dst,
220 int len, int sum, int *src_err_ptr, int *dst_err_ptr)
221 */
222
223/*
224 * Copy from ds while checksumming, otherwise like csum_partial
225 *
226 * The macros SRC and DST specify the type of access for the instruction.
227 * thus we can call a custom exception handler for all access types.
228 *
229 * FIXME: could someone double-check whether I haven't mixed up some SRC and
230 * DST definitions? It's damn hard to trigger all cases. I hope I got
231 * them all but there's no guarantee.
232 */
233
234#define SRC(y...) \
235 9999: y; \
236 _ASM_EXTABLE(9999b, 6001f)
237
238#define DST(y...) \
239 9999: y; \
240 _ASM_EXTABLE(9999b, 6002f)
241
242.align 4
243
244#ifndef CONFIG_X86_USE_PPRO_CHECKSUM
245
246#define ARGBASE 16
247#define FP 12
248
249csum_partial_copy_generic_i386:
250 subl $4,%esp
251 pushl %edi
252 pushl %esi
253 pushl %ebx
254 movl ARGBASE+16(%esp),%eax # sum
255 movl ARGBASE+12(%esp),%ecx # len
256 movl ARGBASE+4(%esp),%esi # src
257 movl ARGBASE+8(%esp),%edi # dst
258
259 testl $2, %edi # Check alignment.
260 jz 2f # Jump if alignment is ok.
261 subl $2, %ecx # Alignment uses up two bytes.
262 jae 1f # Jump if we had at least two bytes.
263 addl $2, %ecx # ecx was < 2. Deal with it.
264 jmp 4f
265SRC(1: movw (%esi), %bx )
266 addl $2, %esi
267DST( movw %bx, (%edi) )
268 addl $2, %edi
269 addw %bx, %ax
270 adcl $0, %eax
2712:
272 movl %ecx, FP(%esp)
273 shrl $5, %ecx
274 jz 2f
275 testl %esi, %esi
276SRC(1: movl (%esi), %ebx )
277SRC( movl 4(%esi), %edx )
278 adcl %ebx, %eax
279DST( movl %ebx, (%edi) )
280 adcl %edx, %eax
281DST( movl %edx, 4(%edi) )
282
283SRC( movl 8(%esi), %ebx )
284SRC( movl 12(%esi), %edx )
285 adcl %ebx, %eax
286DST( movl %ebx, 8(%edi) )
287 adcl %edx, %eax
288DST( movl %edx, 12(%edi) )
289
290SRC( movl 16(%esi), %ebx )
291SRC( movl 20(%esi), %edx )
292 adcl %ebx, %eax
293DST( movl %ebx, 16(%edi) )
294 adcl %edx, %eax
295DST( movl %edx, 20(%edi) )
296
297SRC( movl 24(%esi), %ebx )
298SRC( movl 28(%esi), %edx )
299 adcl %ebx, %eax
300DST( movl %ebx, 24(%edi) )
301 adcl %edx, %eax
302DST( movl %edx, 28(%edi) )
303
304 lea 32(%esi), %esi
305 lea 32(%edi), %edi
306 dec %ecx
307 jne 1b
308 adcl $0, %eax
3092: movl FP(%esp), %edx
310 movl %edx, %ecx
311 andl $0x1c, %edx
312 je 4f
313 shrl $2, %edx # This clears CF
314SRC(3: movl (%esi), %ebx )
315 adcl %ebx, %eax
316DST( movl %ebx, (%edi) )
317 lea 4(%esi), %esi
318 lea 4(%edi), %edi
319 dec %edx
320 jne 3b
321 adcl $0, %eax
3224: andl $3, %ecx
323 jz 7f
324 cmpl $2, %ecx
325 jb 5f
326SRC( movw (%esi), %cx )
327 leal 2(%esi), %esi
328DST( movw %cx, (%edi) )
329 leal 2(%edi), %edi
330 je 6f
331 shll $16,%ecx
332SRC(5: movb (%esi), %cl )
333DST( movb %cl, (%edi) )
3346: addl %ecx, %eax
335 adcl $0, %eax
3367:
3375000:
338
339# Exception handler:
340.section .fixup, "ax"
341
3426001:
343 movl ARGBASE+20(%esp), %ebx # src_err_ptr
344 movl $-EFAULT, (%ebx)
345
346 # zero the complete destination - computing the rest
347 # is too much work
348 movl ARGBASE+8(%esp), %edi # dst
349 movl ARGBASE+12(%esp), %ecx # len
350 xorl %eax,%eax
351 rep ; stosb
352
353 jmp 5000b
354
3556002:
356 movl ARGBASE+24(%esp), %ebx # dst_err_ptr
357 movl $-EFAULT,(%ebx)
358 jmp 5000b
359
360.previous
361
362 popl %ebx
363 popl %esi
364 popl %edi
365 popl %ecx # equivalent to addl $4,%esp
366 ret
367
368#else
369
370/* Version for PentiumII/PPro */
371
372#define ROUND1(x) \
373 SRC(movl x(%esi), %ebx ) ; \
374 addl %ebx, %eax ; \
375 DST(movl %ebx, x(%edi) ) ;
376
377#define ROUND(x) \
378 SRC(movl x(%esi), %ebx ) ; \
379 adcl %ebx, %eax ; \
380 DST(movl %ebx, x(%edi) ) ;
381
382#define ARGBASE 12
383
384csum_partial_copy_generic_i386:
385 pushl %ebx
386 pushl %edi
387 pushl %esi
388 movl ARGBASE+4(%esp),%esi #src
389 movl ARGBASE+8(%esp),%edi #dst
390 movl ARGBASE+12(%esp),%ecx #len
391 movl ARGBASE+16(%esp),%eax #sum
392# movl %ecx, %edx
393 movl %ecx, %ebx
394 movl %esi, %edx
395 shrl $6, %ecx
396 andl $0x3c, %ebx
397 negl %ebx
398 subl %ebx, %esi
399 subl %ebx, %edi
400 lea -1(%esi),%edx
401 andl $-32,%edx
402 lea 3f(%ebx,%ebx), %ebx
403 testl %esi, %esi
404 jmp *%ebx
4051: addl $64,%esi
406 addl $64,%edi
407 SRC(movb -32(%edx),%bl) ; SRC(movb (%edx),%bl)
408 ROUND1(-64) ROUND(-60) ROUND(-56) ROUND(-52)
409 ROUND (-48) ROUND(-44) ROUND(-40) ROUND(-36)
410 ROUND (-32) ROUND(-28) ROUND(-24) ROUND(-20)
411 ROUND (-16) ROUND(-12) ROUND(-8) ROUND(-4)
4123: adcl $0,%eax
413 addl $64, %edx
414 dec %ecx
415 jge 1b
4164: movl ARGBASE+12(%esp),%edx #len
417 andl $3, %edx
418 jz 7f
419 cmpl $2, %edx
420 jb 5f
421SRC( movw (%esi), %dx )
422 leal 2(%esi), %esi
423DST( movw %dx, (%edi) )
424 leal 2(%edi), %edi
425 je 6f
426 shll $16,%edx
4275:
428SRC( movb (%esi), %dl )
429DST( movb %dl, (%edi) )
4306: addl %edx, %eax
431 adcl $0, %eax
4327:
433.section .fixup, "ax"
4346001: movl ARGBASE+20(%esp), %ebx # src_err_ptr
435 movl $-EFAULT, (%ebx)
436 # zero the complete destination (computing the rest is too much work)
437 movl ARGBASE+8(%esp),%edi # dst
438 movl ARGBASE+12(%esp),%ecx # len
439 xorl %eax,%eax
440 rep; stosb
441 jmp 7b
4426002: movl ARGBASE+24(%esp), %ebx # dst_err_ptr
443 movl $-EFAULT, (%ebx)
444 jmp 7b
445.previous
446
447 popl %esi
448 popl %edi
449 popl %ebx
450 ret
451
452#undef ROUND
453#undef ROUND1
454
455#endif