Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | |
| 13 | .text |
| 14 | |
| 15 | /* Function: __u32 csum_partial_copy_nocheck(const char *src, char *dst, int len, __u32 sum) |
| 16 | * Params : r0 = src, r1 = dst, r2 = len, r3 = checksum |
| 17 | * Returns : r0 = new checksum |
| 18 | */ |
| 19 | |
| 20 | .macro save_regs |
Catalin Marinas | 22acc4e | 2008-08-29 18:31:27 +0100 | [diff] [blame^] | 21 | stmfd sp!, {r1, r4 - r8, lr} |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | .endm |
| 23 | |
Catalin Marinas | 90303b1 | 2006-01-12 16:53:51 +0000 | [diff] [blame] | 24 | .macro load_regs |
Catalin Marinas | 22acc4e | 2008-08-29 18:31:27 +0100 | [diff] [blame^] | 25 | ldmfd sp!, {r1, r4 - r8, pc} |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | .endm |
| 27 | |
| 28 | .macro load1b, reg1 |
| 29 | ldrb \reg1, [r0], #1 |
| 30 | .endm |
| 31 | |
| 32 | .macro load2b, reg1, reg2 |
| 33 | ldrb \reg1, [r0], #1 |
| 34 | ldrb \reg2, [r0], #1 |
| 35 | .endm |
| 36 | |
| 37 | .macro load1l, reg1 |
| 38 | ldr \reg1, [r0], #4 |
| 39 | .endm |
| 40 | |
| 41 | .macro load2l, reg1, reg2 |
| 42 | ldr \reg1, [r0], #4 |
| 43 | ldr \reg2, [r0], #4 |
| 44 | .endm |
| 45 | |
| 46 | .macro load4l, reg1, reg2, reg3, reg4 |
| 47 | ldmia r0!, {\reg1, \reg2, \reg3, \reg4} |
| 48 | .endm |
| 49 | |
| 50 | #define FN_ENTRY ENTRY(csum_partial_copy_nocheck) |
Catalin Marinas | 93ed397 | 2008-08-28 11:22:32 +0100 | [diff] [blame] | 51 | #define FN_EXIT ENDPROC(csum_partial_copy_nocheck) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | |
| 53 | #include "csumpartialcopygeneric.S" |