diff options
author | Yuanjie Huang <Yuanjie.Huang@windriver.com> | 2014-10-22 04:47:57 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-11-04 10:27:08 +0000 |
commit | 2eed76b73dd4f846e88f4d20c73cf198acf18566 (patch) | |
tree | 2fb86e72640d5add6f9929fec0a17e8f01ca3fab /meta/recipes-devtools/mtd/mtd-utils | |
parent | bfd2afab834767e7aa7a0d20deea4b65e0eb3e00 (diff) | |
download | poky-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/mtd/mtd-utils')
-rw-r--r-- | meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch | 44 |
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..05f1629d58 --- /dev/null +++ b/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | NEON instruction VLD1.64 was used to copy 64 bits data after type | ||
4 | casting, and they will trigger alignment trap. | ||
5 | This patch uses memcpy to avoid alignment problem. | ||
6 | |||
7 | Signed-off-by: Yuanjie Huang <Yuanjie.Huang@windriver.com> | ||
8 | |||
9 | diff --git a/mkfs.ubifs/key.h b/mkfs.ubifs/key.h | ||
10 | index 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 | /** | ||