[OpenBIOS] [PATCH] PPC: Fix filll word used by BootX

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Thu Jan 10 01:19:53 CET 2013


As pointed out by Segher, the length parameter is specified in bytes rather
than cells.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at 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
-- 
1.7.10.4




More information about the OpenBIOS mailing list