]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Since r219452 the alignment of __dmadat has changed, revealing that fsread()
authorMarius Strobl <marius@FreeBSD.org>
Mon, 11 Jul 2011 20:43:59 +0000 (20:43 +0000)
committerMarius Strobl <marius@FreeBSD.org>
Mon, 11 Jul 2011 20:43:59 +0000 (20:43 +0000)
commitfd70297a1daf4fd6d28c7bf394a551eadb2c484a
treecae25c4a5921aad9438703f1d608bccfc3878112
parent4702b8d2c066038a2dfc46d9334034223a90da3d
Since r219452 the alignment of __dmadat has changed, revealing that fsread()
bogusly casts its contents around causing alignment faults on sparc64 and
most likely also on at least powerpc. Fix this by copying the contents
bytewise instead as partly already done here. Solving this the right way
costs some space, i.e. 148 bytes with GCC and 16 bytes with clang on x86
there are still some bytes left there though, and an acceptable hack which
tricks the compiler into only using a 2-byte alignment instead of the native
one when accessing the contents turned out to even take up more space that.
sys/boot/common/ufsread.c