xref: /openbmc/linux/arch/arm/lib/csumpartialcopy.S (revision 93dc544c)
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
21		mov	ip, sp
22		stmfd	sp!, {r1, r4 - r8, fp, ip, lr, pc}
23		sub	fp, ip, #4
24		.endm
25
26		.macro	load_regs
27		ldmfd	sp, {r1, r4 - r8, fp, sp, pc}
28		.endm
29
30		.macro	load1b, reg1
31		ldrb	\reg1, [r0], #1
32		.endm
33
34		.macro	load2b, reg1, reg2
35		ldrb	\reg1, [r0], #1
36		ldrb	\reg2, [r0], #1
37		.endm
38
39		.macro	load1l, reg1
40		ldr	\reg1, [r0], #4
41		.endm
42
43		.macro	load2l, reg1, reg2
44		ldr	\reg1, [r0], #4
45		ldr	\reg2, [r0], #4
46		.endm
47
48		.macro	load4l, reg1, reg2, reg3, reg4
49		ldmia	r0!, {\reg1, \reg2, \reg3, \reg4}
50		.endm
51
52#define FN_ENTRY	ENTRY(csum_partial_copy_nocheck)
53
54#include "csumpartialcopygeneric.S"
55