]> git.pld-linux.org Git - packages/reiserfsprogs.git/commitdiff
- mmazur stole <asm/unaligned.h>, here is minimal replacement
authorJakub Bogusz <qboosh@pld-linux.org>
Sat, 7 Aug 2004 21:20:05 +0000 (21:20 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    reiserfsprogs-unaligned.patch -> 1.1

reiserfsprogs-unaligned.patch [new file with mode: 0644]

diff --git a/reiserfsprogs-unaligned.patch b/reiserfsprogs-unaligned.patch
new file mode 100644 (file)
index 0000000..a6b4806
--- /dev/null
@@ -0,0 +1,34 @@
+--- reiserfsprogs-3.6.18/include/reiserfs_fs.h.orig    2004-05-28 13:41:48.000000000 +0200
++++ reiserfsprogs-3.6.18/include/reiserfs_fs.h 2004-08-07 23:14:31.157866088 +0200
+@@ -38,8 +38,6 @@
+ # define extern_inline
+ #endif
+-#include <asm/unaligned.h>
+-
+ #define get_leXX(xx,p,field)  (le##xx##_to_cpu ((p)->field))
+ #define set_leXX(xx,p,field,val) do { (p)->field = cpu_to_le##xx(val); } while (0)
+@@ -53,6 +51,22 @@
+ #define set_le64(p,field,val) set_leXX (64, p, field, val)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__)
++/* unaligned accesses are allowed - taken from asm-i386/unaligned.h */
++#define get_unaligned(ptr) (*(ptr))
++#define put_unaligned(val, ptr) ((void)( *(ptr) = (val) ))
++#else
++/* avoid unaligned accesses - taken from asm-generic/unaligned.h;
++ * optimizations left to gcc */
++#include <string.h>
++#define get_unaligned(ptr) \
++  ({ __typeof__(*(ptr)) __tmp; memcpy(&__tmp, (ptr), sizeof(*(ptr))); __tmp; })
++
++#define put_unaligned(val, ptr)                         \
++  ({ __typeof__(*(ptr)) __tmp = (val);                  \
++     memcpy((ptr), &__tmp, sizeof(*(ptr)));             \
++     (void)0; })
++#endif
+ /***************************************************************************/
+ /*                             SUPER BLOCK                                 */
This page took 0.174996 seconds and 4 git commands to generate.