Am Sonntag, 5. November 2006 04:10 schrieb Dan Nicholson:
> On 11/4/06, Rainer Wirtz <[EMAIL PROTECTED]> wrote:
> > Looks like asm/unaligned.h is not installed by the install_headers
> > target of linux.
>
> Yep. Try out this patch from fedora:
>
> http://cvs.fedora.redhat.com/viewcvs/devel/reiserfs-utils/header-fix.
>patch?view=markup

Seems to work. I created attached patch for future use.

> It's always a good idea to check at fedora if you're having trouble
> with headers because they're using the same headers for FC6.

I'll keep it in mind.

Thanks,
Rainer
Submitted by: Rainer Wirtz
Date: 2006-11-02
Initial Package Version: 3.6.19
Upstream Status: Unknown
Origin: http://cvs.fedora.redhat.com/viewcvs/devel/reiserfs-utils/header-fix.patch?view=markup
Description:
Fixes compile error caused by <asm/unaligned.h> not being 
installed by "make headers_install" (linux 2.6.18.1).

--- reiserfsprogs-3.6.19.orig/include/reiserfs_fs.h	2004-09-16 09:49:05.000000000 +0200
+++ reiserfsprogs-3.6.19/include/reiserfs_fs.h	2006-11-05 18:12:00.000000000 +0100
@@ -38,15 +38,21 @@
 # define extern_inline
 #endif
 
-#include <asm/unaligned.h>
+#define get_unaligned(ptr)                  \
+({                                             \
+       struct __attribute__((packed)) {        \
+       typeof(*(ptr)) __v;             \
+       }  *__p = (void *)(ptr);                \
+       __p->__v;                               \
+})
 
-#ifndef get_unaligned
-#if defined(__ppc__) || defined(ppc) || defined(__ppc) || \
-    defined(__PPC) || defined(powerpc) || defined(__powerpc__)
-#	define get_unaligned(ptr)	(*(ptr))
-#	define put_unaligned(val,ptr)	((void)(*(ptr) = (val)))
-#endif
-#endif
+#define put_unaligned(val, ptr)             \
+do {                                           \
+       struct __attribute__((packed)) {        \
+       typeof(*(ptr)) __v;             \
+       }  *__p = (void *)(ptr);                \
+       __p->__v = (val);                       \
+} while(0)
 
 #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)
-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to