summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorYuanjie Huang <Yuanjie.Huang@windriver.com>2014-10-22 04:47:57 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-11-04 10:27:08 +0000
commit2eed76b73dd4f846e88f4d20c73cf198acf18566 (patch)
tree2fb86e72640d5add6f9929fec0a17e8f01ca3fab /meta/recipes-devtools
parentbfd2afab834767e7aa7a0d20deea4b65e0eb3e00 (diff)
downloadpoky-2eed76b73dd4f846e88f4d20c73cf198acf18566.tar.gz
mtd-utils: Fix alignment trap triggered by NEON instructions
NEON instruction VLD1.64 was used to copy 64 bits data after type casting, and they will trigger alignment trap. This patch uses memcpy to avoid alignment problem. (From OE-Core rev: a31080021ad3ecfb92220dcb8c717928db268f1e) Signed-off-by: Yuanjie Huang <Yuanjie.Huang@windriver.com> Signed-off-by: Jackie Huang <jackie.huang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch44
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils_git.bb1
2 files changed, 45 insertions, 0 deletions
diff --git a/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch b/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch
new file mode 100644
index 0000000000..05f1629d58
--- /dev/null
+++ b/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch
@@ -0,0 +1,44 @@
1Upstream-Status: Pending
2
3NEON instruction VLD1.64 was used to copy 64 bits data after type
4casting, and they will trigger alignment trap.
5This patch uses memcpy to avoid alignment problem.
6
7Signed-off-by: Yuanjie Huang <Yuanjie.Huang@windriver.com>
8
9diff --git a/mkfs.ubifs/key.h b/mkfs.ubifs/key.h
10index d3a02d4..e7e9218 100644
11--- a/mkfs.ubifs/key.h
12+++ b/mkfs.ubifs/key.h
13@@ -141,10 +141,12 @@ static inline void data_key_init(union ubifs_key *key, ino_t inum,
14 */
15 static inline void key_write(const union ubifs_key *from, void *to)
16 {
17- union ubifs_key *t = to;
18+ __le32 x[2];
19
20- t->j32[0] = cpu_to_le32(from->u32[0]);
21- t->j32[1] = cpu_to_le32(from->u32[1]);
22+ x[0] = cpu_to_le32(from->u32[0]);
23+ x[1] = cpu_to_le32(from->u32[1]);
24+
25+ memcpy(to, &x, 8);
26 memset(to + 8, 0, UBIFS_MAX_KEY_LEN - 8);
27 }
28
29@@ -156,10 +158,12 @@ static inline void key_write(const union ubifs_key *from, void *to)
30 */
31 static inline void key_write_idx(const union ubifs_key *from, void *to)
32 {
33- union ubifs_key *t = to;
34+ __le32 x[2];
35+
36+ x[0] = cpu_to_le32(from->u32[0]);
37+ x[1] = cpu_to_le32(from->u32[1]);
38
39- t->j32[0] = cpu_to_le32(from->u32[0]);
40- t->j32[1] = cpu_to_le32(from->u32[1]);
41+ memcpy(to, &x, 8);
42 }
43
44 /**
diff --git a/meta/recipes-devtools/mtd/mtd-utils_git.bb b/meta/recipes-devtools/mtd/mtd-utils_git.bb
index f78bc7e7f9..52297c63ba 100644
--- a/meta/recipes-devtools/mtd/mtd-utils_git.bb
+++ b/meta/recipes-devtools/mtd/mtd-utils_git.bb
@@ -10,6 +10,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
10SRCREV = "9f107132a6a073cce37434ca9cda6917dd8d866b" 10SRCREV = "9f107132a6a073cce37434ca9cda6917dd8d866b"
11SRC_URI = "git://git.infradead.org/mtd-utils.git \ 11SRC_URI = "git://git.infradead.org/mtd-utils.git \
12 file://add-exclusion-to-mkfs-jffs2-git-2.patch \ 12 file://add-exclusion-to-mkfs-jffs2-git-2.patch \
13 file://fix-armv7-neon-alignment.patch \
13" 14"
14 15
15PV = "1.5.1+git${SRCPV}" 16PV = "1.5.1+git${SRCPV}"