diff options
Diffstat (limited to 'meta-architech-extras/recipes/linux/linux-imx-3.0.35/0003-ARM-7670-1-fix-the-memset-fix.patch')
-rw-r--r-- | meta-architech-extras/recipes/linux/linux-imx-3.0.35/0003-ARM-7670-1-fix-the-memset-fix.patch | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/meta-architech-extras/recipes/linux/linux-imx-3.0.35/0003-ARM-7670-1-fix-the-memset-fix.patch b/meta-architech-extras/recipes/linux/linux-imx-3.0.35/0003-ARM-7670-1-fix-the-memset-fix.patch deleted file mode 100644 index b8d6f53..0000000 --- a/meta-architech-extras/recipes/linux/linux-imx-3.0.35/0003-ARM-7670-1-fix-the-memset-fix.patch +++ /dev/null | |||
@@ -1,87 +0,0 @@ | |||
1 | From 2ba23fa6c4128febaaf57fe184420a7111caa237 Mon Sep 17 00:00:00 2001 | ||
2 | From: Nicolas Pitre <nicolas.pitre@linaro.org> | ||
3 | Date: Tue, 12 Mar 2013 13:00:42 +0100 | ||
4 | Subject: [PATCH] ARM: 7670/1: fix the memset fix | ||
5 | Organization: O.S. Systems Software LTDA. | ||
6 | |||
7 | Commit 455bd4c430b0 ("ARM: 7668/1: fix memset-related crashes caused by | ||
8 | recent GCC (4.7.2) optimizations") attempted to fix a compliance issue | ||
9 | with the memset return value. However the memset itself became broken | ||
10 | by that patch for misaligned pointers. | ||
11 | |||
12 | This fixes the above by branching over the entry code from the | ||
13 | misaligned fixup code to avoid reloading the original pointer. | ||
14 | |||
15 | Also, because the function entry alignment is wrong in the Thumb mode | ||
16 | compilation, that fixup code is moved to the end. | ||
17 | |||
18 | While at it, the entry instructions are slightly reworked to help dual | ||
19 | issue pipelines. | ||
20 | |||
21 | Upstream-Status: Pending | ||
22 | |||
23 | Signed-off-by: Nicolas Pitre <nico@linaro.org> | ||
24 | Tested-by: Alexander Holler <holler@ahsoftware.de> | ||
25 | Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> | ||
26 | (cherry picked from commit 418df63adac56841ef6b0f1fcf435bc64d4ed177) | ||
27 | --- | ||
28 | arch/arm/lib/memset.S | 33 +++++++++++++-------------------- | ||
29 | 1 file changed, 13 insertions(+), 20 deletions(-) | ||
30 | |||
31 | diff --git a/arch/arm/lib/memset.S b/arch/arm/lib/memset.S | ||
32 | index d912e73..94b0650 100644 | ||
33 | --- a/arch/arm/lib/memset.S | ||
34 | +++ b/arch/arm/lib/memset.S | ||
35 | @@ -14,31 +14,15 @@ | ||
36 | |||
37 | .text | ||
38 | .align 5 | ||
39 | - .word 0 | ||
40 | - | ||
41 | -1: subs r2, r2, #4 @ 1 do we have enough | ||
42 | - blt 5f @ 1 bytes to align with? | ||
43 | - cmp r3, #2 @ 1 | ||
44 | - strltb r1, [ip], #1 @ 1 | ||
45 | - strleb r1, [ip], #1 @ 1 | ||
46 | - strb r1, [ip], #1 @ 1 | ||
47 | - add r2, r2, r3 @ 1 (r2 = r2 - (4 - r3)) | ||
48 | -/* | ||
49 | - * The pointer is now aligned and the length is adjusted. Try doing the | ||
50 | - * memset again. | ||
51 | - */ | ||
52 | |||
53 | ENTRY(memset) | ||
54 | -/* | ||
55 | - * Preserve the contents of r0 for the return value. | ||
56 | - */ | ||
57 | - mov ip, r0 | ||
58 | - ands r3, ip, #3 @ 1 unaligned? | ||
59 | - bne 1b @ 1 | ||
60 | + ands r3, r0, #3 @ 1 unaligned? | ||
61 | + mov ip, r0 @ preserve r0 as return value | ||
62 | + bne 6f @ 1 | ||
63 | /* | ||
64 | * we know that the pointer in ip is aligned to a word boundary. | ||
65 | */ | ||
66 | - orr r1, r1, r1, lsl #8 | ||
67 | +1: orr r1, r1, r1, lsl #8 | ||
68 | orr r1, r1, r1, lsl #16 | ||
69 | mov r3, r1 | ||
70 | cmp r2, #16 | ||
71 | @@ -127,4 +111,13 @@ ENTRY(memset) | ||
72 | tst r2, #1 | ||
73 | strneb r1, [ip], #1 | ||
74 | mov pc, lr | ||
75 | + | ||
76 | +6: subs r2, r2, #4 @ 1 do we have enough | ||
77 | + blt 5b @ 1 bytes to align with? | ||
78 | + cmp r3, #2 @ 1 | ||
79 | + strltb r1, [ip], #1 @ 1 | ||
80 | + strleb r1, [ip], #1 @ 1 | ||
81 | + strb r1, [ip], #1 @ 1 | ||
82 | + add r2, r2, r3 @ 1 (r2 = r2 - (4 - r3)) | ||
83 | + b 1b | ||
84 | ENDPROC(memset) | ||
85 | -- | ||
86 | 1.8.4.rc3 | ||
87 | |||