diff options
author | Richard Purdie <richard@openedhand.com> | 2007-10-11 21:48:55 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2007-10-11 21:48:55 +0000 |
commit | ffb1c7c470fdbcb6939b8b3c099785892dddc3f8 (patch) | |
tree | d128ed6438ea891ac5bad0bd2b756f7c0a7b0b93 /meta/packages/dosfstools/files/alignment_hack.patch | |
parent | 03abf8e9c63de4d0eb25ee6704874910cf30e2a1 (diff) | |
download | poky-ffb1c7c470fdbcb6939b8b3c099785892dddc3f8.tar.gz |
dosfsutils: Move from meta-extras to meta
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2868 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/dosfstools/files/alignment_hack.patch')
-rw-r--r-- | meta/packages/dosfstools/files/alignment_hack.patch | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/meta/packages/dosfstools/files/alignment_hack.patch b/meta/packages/dosfstools/files/alignment_hack.patch new file mode 100644 index 0000000000..e15060a6fe --- /dev/null +++ b/meta/packages/dosfstools/files/alignment_hack.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | The problem is that unsigned char[2] is | ||
2 | guranteed to be 8Bit aligned on arm | ||
3 | but unsigned short is/needs to be 16bit aligned | ||
4 | the union { unsigned short; unsigned char[2] } trick | ||
5 | didn't work so no we use the alpha hack. | ||
6 | |||
7 | memcpy into an 16bit aligned | ||
8 | |||
9 | -zecke | ||
10 | |||
11 | |||
12 | --- dosfstools/dosfsck/boot.c.orig 2003-05-15 19:32:23.000000000 +0200 | ||
13 | +++ dosfstools/dosfsck/boot.c 2003-06-13 17:44:25.000000000 +0200 | ||
14 | @@ -36,17 +36,15 @@ | ||
15 | { 0xff, "5.25\" 320k floppy 2s/40tr/8sec" }, | ||
16 | }; | ||
17 | |||
18 | -#if defined __alpha || defined __ia64__ || defined __s390x__ || defined __x86_64__ || defined __ppc64__ | ||
19 | + | ||
20 | /* Unaligned fields must first be copied byte-wise */ | ||
21 | #define GET_UNALIGNED_W(f) \ | ||
22 | ({ \ | ||
23 | unsigned short __v; \ | ||
24 | memcpy( &__v, &f, sizeof(__v) ); \ | ||
25 | - CF_LE_W( *(unsigned short *)&f ); \ | ||
26 | + CF_LE_W( *(unsigned short *)&__v ); \ | ||
27 | }) | ||
28 | -#else | ||
29 | -#define GET_UNALIGNED_W(f) CF_LE_W( *(unsigned short *)&f ) | ||
30 | -#endif | ||
31 | + | ||
32 | |||
33 | |||
34 | static char *get_media_descr( unsigned char media ) | ||