[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: incompatible unaligned.h between x86 and ppc - kernel-hackers verify please

On Wed, Nov 03, 2004 at 09:56:18AM +0100, Christoph Ewering wrote:
> Hello List, hello Klaus, hello Benjamin!
> At the moment I am fighting with an error on ppc when I want to compile 
> the new vdr-1.3.14 from Klaus Schmidinger.
> vdr uses unaligned.h  and it stops compiling with an error about 
> "get_unaligned not declared" on ppc. I tracked this down with the help 
> of Klaus to a different header-file asm/unaligned.h between x86 and 
> ppc. The asm-ppc/unaligned.h has two lines more - at the begining of 
> unaligned.h "#ifdef __KERNEL__" and at the end "#endif /* KERNEL */". 
> So I "greped" around in /usr/src/linux/include/asm-* and found that ppc 
> uses this construct, only!
> If I remove the #ifdef-#endif-lines I get no "not declared" error any 
> more.
> I am not a kernel-hacker (I am not a programmer at all) so I can only 
> guess that this is an obsolete declaration that could be removed. I am 
> using the kernel-source from kernel.org.
> So could the kernel-hackers verify this and correct me or 
> asm-ppc/unaligned.h, please. ;-)

I think unaligned.h should not be used by userspace.

At least on arm this header can be wrong if userspace doesn't set
__ARMEB__ (or source the correct kernel config before) with the correct
endianness (arm can be LE or BE).

I'ld rather protect asm-i386/unaligned.h (as well as others archs) with
__KERNEL__ than make asm-ppc/unaligned.h not protected..

my 2c

Reply to: