Am 09.08.2011 um 23:55 schrieb William Hahne:
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;
- }
+}
This word puzzles me: The extra l in filll seems to be for "long" according to the patch description. But there's a hardcoded arithmetic with 4 and the parameter is documented as byte yet is being written ucell-wide. That strikes me as inconsistent.
Either 4 needs to be replaced with sizeof(ucell) to fit sparc64, or the division by 4 dropped and uint8_t* written len times.
Andreas