[OpenBIOS] [PATCH 10/10] Adding filll Forth primitive

William Hahne will07c5 at gmail.com
Tue Aug 9 23:55:12 CEST 2011


This is a forth primitive that is required by BootX. It just fills some
specified memory address and length with longs.


Index: kernel/forth.c
===================================================================
--- kernel/forth.c (revision 1041)
+++ kernel/forth.c (working copy)
@@ -1610,6 +1616,20 @@
  memset(src, value, count);
 }

+/*
+ *  filll       ( addr len byte -- )
+ */
+static void filll(void)
+{
+    ucell value = POP();
+ ucell count = POP();
+ ucell *dest = (ucell *)cell2pointer(POP());
+
+ int i;
+ for (i = 0; i <= count / 4; i++) {
+    dest[i] = value;
+ }
+}

 /*
  *  unaligned-w@  ( addr -- w )
@@ -1963,4 +1983,5 @@
     do_encode_file,         /* $encode-file */
     do_debug_xt,            /* (debug  */
     do_debug_off,           /* (debug-off) */
+    filll                   /* filll */
 };
Index: kernel/bootstrap.c
===================================================================
--- kernel/bootstrap.c (revision 1041)
+++ kernel/bootstrap.c (working copy)
@@ -89,7 +89,7 @@
  "here", "here!", "dobranch", "do?branch", "unaligned-w@",
  "unaligned-w!", "unaligned-l@", "unaligned-l!", "ioc@", "iow@",
  "iol@", "ioc!", "iow!", "iol!", "i", "j", "call", "sys-debug",
- "$include", "$encode-file", "(debug", "(debug-off)"
+ "$include", "$encode-file", "(debug", "(debug-off)", "filll"
 };

 /*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openbios.org/pipermail/openbios/attachments/20110809/5b90f664/attachment.html>


More information about the OpenBIOS mailing list