summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch')
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch44
1 files changed, 44 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..44b25d164a
--- /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 /**