csumpartialcopy.S 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * linux/arch/arm/lib/csumpartialcopy.S
  3. *
  4. * Copyright (C) 1995-1998 Russell King
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/linkage.h>
  11. #include <asm/assembler.h>
  12. .text
  13. /* Function: __u32 csum_partial_copy_nocheck(const char *src, char *dst, int len, __u32 sum)
  14. * Params : r0 = src, r1 = dst, r2 = len, r3 = checksum
  15. * Returns : r0 = new checksum
  16. */
  17. .macro save_regs
  18. stmfd sp!, {r1, r4 - r8, lr}
  19. .endm
  20. .macro load_regs
  21. ldmfd sp!, {r1, r4 - r8, pc}
  22. .endm
  23. .macro load1b, reg1
  24. ldrb \reg1, [r0], #1
  25. .endm
  26. .macro load2b, reg1, reg2
  27. ldrb \reg1, [r0], #1
  28. ldrb \reg2, [r0], #1
  29. .endm
  30. .macro load1l, reg1
  31. ldr \reg1, [r0], #4
  32. .endm
  33. .macro load2l, reg1, reg2
  34. ldr \reg1, [r0], #4
  35. ldr \reg2, [r0], #4
  36. .endm
  37. .macro load4l, reg1, reg2, reg3, reg4
  38. ldmia r0!, {\reg1, \reg2, \reg3, \reg4}
  39. .endm
  40. #define FN_ENTRY ENTRY(csum_partial_copy_nocheck)
  41. #define FN_EXIT ENDPROC(csum_partial_copy_nocheck)
  42. #include "csumpartialcopygeneric.S"