j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
As pointed out by Segher, the length parameter is specified in bytes rather than cells.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk --- openbios-devel/arch/ppc/qemu/init.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/openbios-devel/arch/ppc/qemu/init.c b/openbios-devel/arch/ppc/qemu/init.c index 61374c3..3107708 100644 --- a/openbios-devel/arch/ppc/qemu/init.c +++ b/openbios-devel/arch/ppc/qemu/init.c @@ -614,18 +614,25 @@ static void kvm_of_init(void) }
/* - * 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()); + char *baddr; + u32 len; + + for (len = 0; len < bytes / 4; len++) { + *laddr++ = longval; } + + baddr = (char *)laddr; + for (len = 0; len < bytes % 4; len++) { + *baddr++ = ((char *)&longval)[len]; + } }
void