diff options
author | Ingo Molnar <mingo@kernel.org> | 2013-04-08 05:43:30 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-04-08 05:43:30 -0400 |
commit | 529801898b24544f93532217ce18a7ebbb2b8c4f (patch) | |
tree | c51c8fd808e6cff15cabb1a9ac29be0661942384 /arch/arm/lib/memset.S | |
parent | b847d0501afec4c7b12eb276aec10a2834f953ea (diff) | |
parent | 23995bbee01d75f09f72b1380bd6045a5b02947b (diff) |
Merge branch 'for-tip' of git://git.kernel.org/pub/scm/linux/kernel/git/rric/oprofile into perf/core
Pull IBM zEnterprise EC12 support patchlet from Robert Richter.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/arm/lib/memset.S')
-rw-r--r-- | arch/arm/lib/memset.S | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/arch/arm/lib/memset.S b/arch/arm/lib/memset.S index d912e7397ecc..94b0650ea98f 100644 --- a/arch/arm/lib/memset.S +++ b/arch/arm/lib/memset.S | |||
@@ -14,31 +14,15 @@ | |||
14 | 14 | ||
15 | .text | 15 | .text |
16 | .align 5 | 16 | .align 5 |
17 | .word 0 | ||
18 | |||
19 | 1: subs r2, r2, #4 @ 1 do we have enough | ||
20 | blt 5f @ 1 bytes to align with? | ||
21 | cmp r3, #2 @ 1 | ||
22 | strltb r1, [ip], #1 @ 1 | ||
23 | strleb r1, [ip], #1 @ 1 | ||
24 | strb r1, [ip], #1 @ 1 | ||
25 | add r2, r2, r3 @ 1 (r2 = r2 - (4 - r3)) | ||
26 | /* | ||
27 | * The pointer is now aligned and the length is adjusted. Try doing the | ||
28 | * memset again. | ||
29 | */ | ||
30 | 17 | ||
31 | ENTRY(memset) | 18 | ENTRY(memset) |
32 | /* | 19 | ands r3, r0, #3 @ 1 unaligned? |
33 | * Preserve the contents of r0 for the return value. | 20 | mov ip, r0 @ preserve r0 as return value |
34 | */ | 21 | bne 6f @ 1 |
35 | mov ip, r0 | ||
36 | ands r3, ip, #3 @ 1 unaligned? | ||
37 | bne 1b @ 1 | ||
38 | /* | 22 | /* |
39 | * we know that the pointer in ip is aligned to a word boundary. | 23 | * we know that the pointer in ip is aligned to a word boundary. |
40 | */ | 24 | */ |
41 | orr r1, r1, r1, lsl #8 | 25 | 1: orr r1, r1, r1, lsl #8 |
42 | orr r1, r1, r1, lsl #16 | 26 | orr r1, r1, r1, lsl #16 |
43 | mov r3, r1 | 27 | mov r3, r1 |
44 | cmp r2, #16 | 28 | cmp r2, #16 |
@@ -127,4 +111,13 @@ ENTRY(memset) | |||
127 | tst r2, #1 | 111 | tst r2, #1 |
128 | strneb r1, [ip], #1 | 112 | strneb r1, [ip], #1 |
129 | mov pc, lr | 113 | mov pc, lr |
114 | |||
115 | 6: subs r2, r2, #4 @ 1 do we have enough | ||
116 | blt 5b @ 1 bytes to align with? | ||
117 | cmp r3, #2 @ 1 | ||
118 | strltb r1, [ip], #1 @ 1 | ||
119 | strleb r1, [ip], #1 @ 1 | ||
120 | strb r1, [ip], #1 @ 1 | ||
121 | add r2, r2, r3 @ 1 (r2 = r2 - (4 - r3)) | ||
122 | b 1b | ||
130 | ENDPROC(memset) | 123 | ENDPROC(memset) |