OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.6 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../reiserfsprogs/no-unaligned-header-2.6.18.patch
  5. # Copyright (C) 2006 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. --- reiserfsprogs-3.6.19/include/reiserfs_fs.h.orig 2006-09-23 17:08:57.000000000 +0200
  17. +++ reiserfsprogs-3.6.19/include/reiserfs_fs.h 2006-09-23 20:52:13.000000000 +0200
  18. @@ -38,14 +38,14 @@
  19. # define extern_inline
  20. #endif
  21. -#include <asm/unaligned.h>
  22. -
  23. #ifndef get_unaligned
  24. -#if defined(__ppc__) || defined(ppc) || defined(__ppc) || \
  25. - defined(__PPC) || defined(powerpc) || defined(__powerpc__)
  26. -# define get_unaligned(ptr) (*(ptr))
  27. -# define put_unaligned(val,ptr) ((void)(*(ptr) = (val)))
  28. -#endif
  29. +#define get_unaligned(ptr) \
  30. + ({ __typeof__(*(ptr)) __tmp; memcpy(&__tmp, (ptr), sizeof(*(ptr))); __tmp; })
  31. +
  32. +#define put_unaligned(val, ptr) \
  33. + ({ __typeof__(*(ptr)) __tmp = (val); \
  34. + memcpy((ptr), &__tmp, sizeof(*(ptr))); \
  35. + (void)0; })
  36. #endif
  37. #define get_leXX(xx,p,field) (le##xx##_to_cpu ((p)->field))