> Please point to the equally-optimized alternative > that works on all platforms.
If there is none, then rip off the kernel implementation or lobby glibc to provide one, or make a "libunaligned.so" and distribute it etc... but to NOT rely on the kernel header, that is bogus. > > 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 > broken. Rubbish ! Kernel headers are totally free to use whatever macros they want in their implementation, none of that has to be available to userland. Also, there is no guarantee that get_unaligned() is inlined at all > 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. Stop this crap please ! Ben.