Author: mcayland Date: Fri Jan 11 12:10:07 2013 New Revision: 1085 URL: http://tracker.coreboot.org/trac/openbios/changeset/1085
Log: PPC: Fix filll word used by BootX
As pointed out by Segher, the length parameter is specified in bytes rather than cells. The behaviour when the number of bytes is not an exact multiple of a long word is to round up to the next long word, as verified on real Mac hardware.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk Tested-by: Olivier DANET odanet@caramail.com Tested-by: John Arbuckle programmingkidx@gmail.com
Modified: trunk/openbios-devel/arch/ppc/qemu/init.c
Modified: trunk/openbios-devel/arch/ppc/qemu/init.c ============================================================================== --- trunk/openbios-devel/arch/ppc/qemu/init.c Mon Jan 7 13:57:56 2013 (r1084) +++ trunk/openbios-devel/arch/ppc/qemu/init.c Fri Jan 11 12:10:07 2013 (r1085) @@ -614,18 +614,19 @@ }
/* - * filll ( addr len quad -- ) + * filll ( addr bytes quad -- ) */
static void ffilll(void) { const u32 longval = POP(); - u32 len = POP(); - u32 *aaddr = (u32 *)cell2pointer(POP()); - - while (len--) { - *aaddr++ = longval; - } + u32 bytes = POP(); + u32 *laddr = (u32 *)cell2pointer(POP()); + u32 len; + + for (len = 0; len < bytes / sizeof(u32); len++) { + *laddr++ = longval; + } }
void