Re: PPC le_to_cpu?? and vice versa...

Michael Lausch (mla@gams.co.at)
Mon, 06 Apr 1998 16:47:55 +0200


>>>>> "cp" == Carsten Pluntke <su0289@sx2.hrz.uni-dortmund.de>
>>>>> wrote the following on Mon, 6 Apr 1998 08:44:27 +0200 (MET DST)

cp> Recompiling my kernel 2.1.90 using GCC 2.8.0 on a PPC machine I
cp> discovered Ext2 fs trashes (group summary numbers were messed up)
cp> and tracked down the problem to the PPC native __swab?? routines
cp> which were used by le_to_cpu16, le_to_cpu32 and friends. (Found in
cp> linux/include/arch-ppc, sorry, don't have things at hand.)

cp> Commenting them out to let things fall back to architecture
cp> independent routines fixed things, still don't know wether that
cp> was a problem of an over-optimizing GCC or something else.

We found the same behaviour with an egcs snapshot (we didn't have time
to upgrade to a real egcs release). We found out that the optimizers
just deletes asm statements and looses control where the variables
actually are. As a fix we changed the __fswab16(__u16 x) function to
__fswab16( unsigned int x). The typecast necessary is enough for the
compiler to keep the necessary asm statements.

cp> Carsten

cp> - To unsubscribe from this list: send the line "unsubscribe
cp> linux-kernel" in the body of a message to
cp> majordomo@vger.rutgers.edu

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu