[OpenBIOS] [PATCH] Adds filll (3 l's) to dictionary

Programmingkid programmingkidx at gmail.com
Mon Dec 3 21:24:04 CET 2012


The filll word fills memory addresses with a value. It's different from fill (2 l's) because filll fills the specified memory addresses with 32-bit values. 

Index: trunk/openbios-devel/arch/ppc/qemu/init.c
===================================================================
--- trunk/openbios-devel/arch/ppc/qemu/init.c	(revision 1075)
+++ trunk/openbios-devel/arch/ppc/qemu/init.c	(working copy)
@@ -613,6 +613,25 @@
     fword("finish-device");
 }
 
+
+// filll  ( addr len num -- )
+// Fills an address in memory with 32-bit values
+static void filll(void)
+{
+   u32 * location;
+   u32 length, fillNumber, x;
+   
+   fillNumber = POP();
+   length = POP();
+   location = (u32 *) cell2pointer(POP());
+   
+   for(x = 0; x <= length; x++)
+   {
+      location[x] = fillNumber;
+   }
+}
+
+
 void
 arch_of_init(void)
 {
@@ -879,4 +898,5 @@
 
     bind_func("platform-boot", boot);
     bind_func("(go)", go);
+    bind_func("filll", filll);
 }




More information about the OpenBIOS mailing list