[PATCH] generate COFF zImage in arch/powerpc/boot

Paul Mackerras paulus at samba.org
Thu Nov 24 10:06:30 EST 2005


Olaf Hering writes:

> Maybe I miss the point, but if the src is unaligned, and we align it,
> dest will change as well and may be unaligned?

Yes, but in aligning the dest you will unalign the source.  So with
your patch we will do something like copy 3 bytes, test, copy 1 byte,
test, go back, copy 3 bytes, test, copy 1 byte, etc., on and on until
the whole buffer is copied.  With my patch we get into one loop
copying the whole buffer byte-by-byte.

The other alternative is to work out the appropriate rotate amounts
and masks so that the main loop does load word, rotate, AND, AND, OR,
store word (a bit like the 64-bit kernel memcpy does, except it works
on doublewords not words).  That seems like a lot of trouble to go to
for the bootwrapper though.

Paul.



More information about the Linuxppc-dev mailing list