Re: incompatible unaligned.h between x86 and ppc - kernel-hackers verify please
On Wed, 2004-11-03 at 04:23, Vincent Hanquez wrote:
> On Wed, Nov 03, 2004 at 09:56:18AM +0100, Christoph Ewering wrote:
> > 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 126.96.36.199 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.
Please point to the equally-optimized alternative
that works on all platforms.
> 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).
ARM should be using constants set by the compiler.
If __ARMEB__ is not compiler-defined, something is
> I'ld rather protect asm-i386/unaligned.h (as well as others archs) with
> __KERNEL__ than make asm-ppc/unaligned.h not protected..
Next time, start with i386. If Linus won't go for it,
then don't screw around adding __KERNEL__ to other places.
Stuff breaks, needlessly. I'd go so far as to say that
the Linux API has been broken on ppc.