[Midnightbsd-cvs] src [10203] trunk/sys/boot/ficl: sync
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Fri Jun 1 20:05:49 EDT 2018
Revision: 10203
http://svnweb.midnightbsd.org/src/?rev=10203
Author: laffer1
Date: 2018-06-01 20:05:49 -0400 (Fri, 01 Jun 2018)
Log Message:
-----------
sync
Modified Paths:
--------------
trunk/sys/boot/ficl/Makefile
trunk/sys/boot/ficl/amd64/sysdep.c
trunk/sys/boot/ficl/amd64/sysdep.h
trunk/sys/boot/ficl/arm/sysdep.c
trunk/sys/boot/ficl/arm/sysdep.h
trunk/sys/boot/ficl/dict.c
trunk/sys/boot/ficl/ficl.c
trunk/sys/boot/ficl/ficl.h
trunk/sys/boot/ficl/fileaccess.c
trunk/sys/boot/ficl/float.c
trunk/sys/boot/ficl/i386/sysdep.c
trunk/sys/boot/ficl/i386/sysdep.h
trunk/sys/boot/ficl/loader.c
trunk/sys/boot/ficl/math64.c
trunk/sys/boot/ficl/math64.h
trunk/sys/boot/ficl/prefix.c
trunk/sys/boot/ficl/search.c
trunk/sys/boot/ficl/softwords/classes.fr
trunk/sys/boot/ficl/softwords/ficlclass.fr
trunk/sys/boot/ficl/softwords/ficllocal.fr
trunk/sys/boot/ficl/softwords/fileaccess.fr
trunk/sys/boot/ficl/softwords/forml.fr
trunk/sys/boot/ficl/softwords/freebsd.fr
trunk/sys/boot/ficl/softwords/ifbrack.fr
trunk/sys/boot/ficl/softwords/jhlocal.fr
trunk/sys/boot/ficl/softwords/marker.fr
trunk/sys/boot/ficl/softwords/oo.fr
trunk/sys/boot/ficl/softwords/prefix.fr
trunk/sys/boot/ficl/softwords/softcore.awk
trunk/sys/boot/ficl/softwords/softcore.fr
trunk/sys/boot/ficl/softwords/string.fr
trunk/sys/boot/ficl/stack.c
trunk/sys/boot/ficl/testmain.c
trunk/sys/boot/ficl/tools.c
trunk/sys/boot/ficl/unix.c
trunk/sys/boot/ficl/vm.c
trunk/sys/boot/ficl/words.c
Added Paths:
-----------
trunk/sys/boot/ficl/ia64/
trunk/sys/boot/ficl/ia64/sysdep.c
trunk/sys/boot/ficl/ia64/sysdep.h
trunk/sys/boot/ficl/mips/
trunk/sys/boot/ficl/mips/sysdep.c
trunk/sys/boot/ficl/mips/sysdep.h
trunk/sys/boot/ficl/powerpc/
trunk/sys/boot/ficl/powerpc/sysdep.c
trunk/sys/boot/ficl/powerpc/sysdep.h
trunk/sys/boot/ficl/sparc64/
trunk/sys/boot/ficl/sparc64/sysdep.c
trunk/sys/boot/ficl/sparc64/sysdep.h
Property Changed:
----------------
trunk/sys/boot/ficl/softwords/classes.fr
trunk/sys/boot/ficl/softwords/ficlclass.fr
trunk/sys/boot/ficl/softwords/ficllocal.fr
trunk/sys/boot/ficl/softwords/fileaccess.fr
trunk/sys/boot/ficl/softwords/forml.fr
trunk/sys/boot/ficl/softwords/freebsd.fr
trunk/sys/boot/ficl/softwords/ifbrack.fr
trunk/sys/boot/ficl/softwords/jhlocal.fr
trunk/sys/boot/ficl/softwords/marker.fr
trunk/sys/boot/ficl/softwords/oo.fr
trunk/sys/boot/ficl/softwords/prefix.fr
trunk/sys/boot/ficl/softwords/softcore.awk
trunk/sys/boot/ficl/softwords/softcore.fr
trunk/sys/boot/ficl/softwords/string.fr
Modified: trunk/sys/boot/ficl/Makefile
===================================================================
--- trunk/sys/boot/ficl/Makefile 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/Makefile 2018-06-02 00:05:49 UTC (rev 10203)
@@ -1,7 +1,14 @@
# $MidnightBSD$
-# $FreeBSD: stable/9/sys/boot/ficl/Makefile 260096 2013-12-30 20:15:46Z dim $
+# $FreeBSD: stable/10/sys/boot/ficl/Makefile 281321 2015-04-09 19:36:06Z jhb $
#
-.PATH: ${.CURDIR}/${MACHINE_CPUARCH:S/amd64/i386/}
+
+FICLDIR?= ${.CURDIR}
+
+.if defined(FICL32)
+.PATH: ${FICLDIR}/${MACHINE_CPUARCH:S/amd64/i386/}
+.else
+.PATH: ${FICLDIR}/${MACHINE_CPUARCH}
+.endif
BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c math64.c \
prefix.c search.c stack.c tools.c vm.c words.c
@@ -8,14 +15,23 @@
SRCS= ${BASE_SRCS} sysdep.c softcore.c
CLEANFILES= softcore.c testmain testmain.o
CFLAGS+= -ffreestanding
-.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "i386" || \
+ (${MACHINE_CPUARCH} == "amd64" && defined(FICL32))
CFLAGS+= -march=i386
CFLAGS.gcc+= -mpreferred-stack-boundary=2
+.endif
+.if ${MACHINE_CPUARCH} == "amd64"
+CFLAGS+= -mno-red-zone
+.endif
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
.endif
-.if ${MACHINE_CPUARCH} == "arm"
+.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm"
CFLAGS+= -msoft-float
.endif
+.if ${MACHINE} == "pc98"
+CFLAGS+= -Os -DPC98
+.endif
.if HAVE_PNP
CFLAGS+= -DHAVE_PNP
.endif
@@ -31,7 +47,7 @@
.endif
# Standard softwords
-.PATH: ${.CURDIR}/softwords
+.PATH: ${FICLDIR}/softwords
SOFTWORDS= softcore.fr jhlocal.fr marker.fr freebsd.fr ficllocal.fr \
ifbrack.fr
# Optional OO extension softwords
@@ -38,17 +54,31 @@
#SOFTWORDS+= oo.fr classes.fr
.if ${MACHINE_CPUARCH} == "amd64"
+.if defined(FICL32)
CFLAGS+= -m32 -I.
+.else
+CFLAGS+= -fPIC
.endif
+.endif
-CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${MACHINE_CPUARCH:S/amd64/i386/} \
- -I${.CURDIR}/../common
+.if ${MACHINE_ARCH} == "powerpc64"
+CFLAGS+= -m32 -mcpu=powerpc -I.
+.endif
+.if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32)
+FICL_CPUARCH= i386
+.else
+FICL_CPUARCH= ${MACHINE_CPUARCH}
+.endif
+
+CFLAGS+= -I${FICLDIR} -I${FICLDIR}/${FICL_CPUARCH} \
+ -I${FICLDIR}/../common
+
softcore.c: ${SOFTWORDS} softcore.awk
- (cd ${.CURDIR}/softwords; cat ${SOFTWORDS} \
+ (cd ${FICLDIR}/softwords; cat ${SOFTWORDS} \
| awk -f softcore.awk -v datestamp="`LC_ALL=C date`") > ${.TARGET}
-.if ${MACHINE_CPUARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32)
.if !exists(machine)
${SRCS:M*.c:R:S/$/.o/g}: machine
Modified: trunk/sys/boot/ficl/amd64/sysdep.c
===================================================================
--- trunk/sys/boot/ficl/amd64/sysdep.c 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/amd64/sysdep.c 2018-06-02 00:05:49 UTC (rev 10203)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*******************************************************************
** s y s d e p . c
** Forth Inspired Command Language
@@ -7,7 +8,7 @@
**
*******************************************************************/
-/* $MidnightBSD$ */
+/* $FreeBSD: stable/10/sys/boot/ficl/amd64/sysdep.c 294445 2016-01-20 16:53:38Z emaste $ */
#ifdef TESTMAIN
#include <stdio.h>
@@ -55,7 +56,7 @@
IGNORE(pVM);
while(*msg != 0)
- putchar(*(msg++));
+ putchar((unsigned char)*(msg++));
if (fNewline)
putchar('\n');
Modified: trunk/sys/boot/ficl/amd64/sysdep.h
===================================================================
--- trunk/sys/boot/ficl/amd64/sysdep.h 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/amd64/sysdep.h 2018-06-02 00:05:49 UTC (rev 10203)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*******************************************************************
s y s d e p . h
** Forth Inspired Command Language
@@ -9,7 +10,7 @@
** FICL_ROBUST is enabled. This may require some consideration
** in firmware systems since assert often
** assumes stderr/stdout.
-** $Id: sysdep.h,v 1.2 2012-12-29 04:58:20 laffer1 Exp $
+** $Id: sysdep.h,v 1.11 2001/12/05 07:21:34 jsadler Exp $
*******************************************************************/
/*
** Copyright (c) 1997-2001 John Sadler (john_sadler at alum.mit.edu)
@@ -45,10 +46,10 @@
** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
** SUCH DAMAGE.
**
-** $Id: sysdep.h,v 1.2 2012-12-29 04:58:20 laffer1 Exp $
+** $Id: sysdep.h,v 1.6 2001-04-26 21:41:55-07 jsadler Exp jsadler $
*/
-/* $MidnightBSD$ */
+/* $FreeBSD: stable/10/sys/boot/ficl/amd64/sysdep.h 223695 2011-06-30 16:08:56Z dfr $ */
#if !defined (__SYSDEP_H__)
#define __SYSDEP_H__
Modified: trunk/sys/boot/ficl/arm/sysdep.c
===================================================================
--- trunk/sys/boot/ficl/arm/sysdep.c 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/arm/sysdep.c 2018-06-02 00:05:49 UTC (rev 10203)
@@ -8,7 +8,7 @@
**
*******************************************************************/
-/* $FreeBSD$ */
+/* $FreeBSD: stable/10/sys/boot/ficl/arm/sysdep.c 161454 2006-08-18 21:41:43Z imp $ */
#ifdef TESTMAIN
#include <stdio.h>
Modified: trunk/sys/boot/ficl/arm/sysdep.h
===================================================================
--- trunk/sys/boot/ficl/arm/sysdep.h 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/arm/sysdep.h 2018-06-02 00:05:49 UTC (rev 10203)
@@ -47,7 +47,7 @@
** contact me by email at the address above.
**
** $Id: sysdep.h,v 1.6 2001-04-26 21:41:55-07 jsadler Exp jsadler $
-** $FreeBSD$
+** $FreeBSD: stable/10/sys/boot/ficl/arm/sysdep.h 249222 2013-04-07 05:40:49Z kientzle $
*/
#if !defined (__SYSDEP_H__)
@@ -60,7 +60,7 @@
#include <assert.h>
#if !defined IGNORE /* Macro to silence unused param warnings */
-#define IGNORE(x) &x
+#define IGNORE(x) (void)(x)
#endif
/*
@@ -407,7 +407,7 @@
#if FICL_MULTITHREAD
int ficlLockDictionary(short fLock);
#else
-#define ficlLockDictionary(x) 0 /* ignore */
+#define ficlLockDictionary(x) /* ignore */
#endif
/*
Modified: trunk/sys/boot/ficl/dict.c
===================================================================
--- trunk/sys/boot/ficl/dict.c 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/dict.c 2018-06-02 00:05:49 UTC (rev 10203)
@@ -1,9 +1,10 @@
+/* $MidnightBSD$ */
/*******************************************************************
** d i c t . c
** Forth Inspired Command Language - dictionary methods
** Author: John Sadler (john_sadler at alum.mit.edu)
** Created: 19 July 1997
-** $Id: dict.c,v 1.2 2012-12-29 04:58:20 laffer1 Exp $
+** $Id: dict.c,v 1.14 2001/12/05 07:21:34 jsadler Exp $
*******************************************************************/
/*
** This file implements the dictionary -- FICL's model of
@@ -51,7 +52,7 @@
** SUCH DAMAGE.
*/
-/* $MidnightBSD$ */
+/* $FreeBSD: stable/10/sys/boot/ficl/dict.c 94290 2002-04-09 17:45:28Z dcs $ */
#ifdef TESTMAIN
#include <stdio.h>
Modified: trunk/sys/boot/ficl/ficl.c
===================================================================
--- trunk/sys/boot/ficl/ficl.c 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/ficl.c 2018-06-02 00:05:49 UTC (rev 10203)
@@ -1,9 +1,10 @@
+/* $MidnightBSD$ */
/*******************************************************************
** f i c l . c
** Forth Inspired Command Language - external interface
** Author: John Sadler (john_sadler at alum.mit.edu)
** Created: 19 July 1997
-** $Id: ficl.c,v 1.2 2012-12-29 04:58:20 laffer1 Exp $
+** $Id: ficl.c,v 1.16 2001/12/05 07:21:34 jsadler Exp $
*******************************************************************/
/*
** This is an ANS Forth interpreter written in C.
@@ -55,7 +56,7 @@
** SUCH DAMAGE.
*/
-/* $MidnightBSD$ */
+/* $FreeBSD: stable/10/sys/boot/ficl/ficl.c 94290 2002-04-09 17:45:28Z dcs $ */
#ifdef TESTMAIN
#include <stdlib.h>
Modified: trunk/sys/boot/ficl/ficl.h
===================================================================
--- trunk/sys/boot/ficl/ficl.h 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/ficl.h 2018-06-02 00:05:49 UTC (rev 10203)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*******************************************************************
** f i c l . h
** Forth Inspired Command Language
@@ -4,7 +5,7 @@
** Author: John Sadler (john_sadler at alum.mit.edu)
** Created: 19 July 1997
** Dedicated to RHS, in loving memory
-** $Id: ficl.h,v 1.3 2012-12-29 04:58:20 laffer1 Exp $
+** $Id: ficl.h,v 1.18 2001/12/05 07:21:34 jsadler Exp $
*******************************************************************/
/*
** Copyright (c) 1997-2001 John Sadler (john_sadler at alum.mit.edu)
@@ -41,7 +42,7 @@
** SUCH DAMAGE.
*/
-/* $MidnightBSD$ */
+/* $FreeBSD: stable/10/sys/boot/ficl/ficl.h 209361 2010-06-20 08:03:06Z brian $ */
#if !defined (__FICL_H__)
#define __FICL_H__
Modified: trunk/sys/boot/ficl/fileaccess.c
===================================================================
--- trunk/sys/boot/ficl/fileaccess.c 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/fileaccess.c 2018-06-02 00:05:49 UTC (rev 10203)
@@ -1,4 +1,5 @@
/* $MidnightBSD$ */
+/* $FreeBSD: stable/10/sys/boot/ficl/fileaccess.c 231042 2012-02-05 20:00:39Z rpaulo $ */
#include <errno.h>
#include <stdlib.h>
@@ -420,6 +421,6 @@
ficlSetEnv(pSys, "file-ext", FICL_TRUE);
#endif /* FICL_HAVE_FTRUNCATE */
#else
- &pSys;
+ (void)pSys;
#endif /* FICL_WANT_FILE */
}
Modified: trunk/sys/boot/ficl/float.c
===================================================================
--- trunk/sys/boot/ficl/float.c 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/float.c 2018-06-02 00:05:49 UTC (rev 10203)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*******************************************************************
** f l o a t . c
** Forth Inspired Command Language
@@ -4,7 +5,7 @@
** ANS Forth FLOAT word-set written in C
** Author: Guy Carver & John Sadler (john_sadler at alum.mit.edu)
** Created: Apr 2001
-** $Id: float.c,v 1.3 2012-12-29 04:58:20 laffer1 Exp $
+** $Id: float.c,v 1.8 2001/12/05 07:21:34 jsadler Exp $
*******************************************************************/
/*
** Copyright (c) 1997-2001 John Sadler (john_sadler at alum.mit.edu)
@@ -41,7 +42,7 @@
** SUCH DAMAGE.
*/
-/* $MidnightBSD$ */
+/* $FreeBSD: stable/10/sys/boot/ficl/float.c 167850 2007-03-23 22:26:01Z jkim $ */
#include <stdlib.h>
#include <stdio.h>
Modified: trunk/sys/boot/ficl/i386/sysdep.c
===================================================================
--- trunk/sys/boot/ficl/i386/sysdep.c 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/i386/sysdep.c 2018-06-02 00:05:49 UTC (rev 10203)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*******************************************************************
** s y s d e p . c
** Forth Inspired Command Language
@@ -7,7 +8,7 @@
**
*******************************************************************/
-/* $MidnightBSD$ */
+/* $FreeBSD: stable/10/sys/boot/ficl/i386/sysdep.c 295135 2016-02-02 03:08:37Z allanjude $ */
#ifdef TESTMAIN
#include <stdio.h>
@@ -58,7 +59,7 @@
IGNORE(pVM);
while(*msg != 0)
- putchar(*(msg++));
+ putchar((unsigned char)*(msg++));
if (fNewline)
putchar('\n');
Modified: trunk/sys/boot/ficl/i386/sysdep.h
===================================================================
--- trunk/sys/boot/ficl/i386/sysdep.h 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/i386/sysdep.h 2018-06-02 00:05:49 UTC (rev 10203)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*******************************************************************
s y s d e p . h
** Forth Inspired Command Language
@@ -9,7 +10,7 @@
** FICL_ROBUST is enabled. This may require some consideration
** in firmware systems since assert often
** assumes stderr/stdout.
-** $Id: sysdep.h,v 1.2 2012-12-29 04:58:20 laffer1 Exp $
+** $Id: sysdep.h,v 1.11 2001/12/05 07:21:34 jsadler Exp $
*******************************************************************/
/*
** Copyright (c) 1997-2001 John Sadler (john_sadler at alum.mit.edu)
@@ -46,7 +47,7 @@
** SUCH DAMAGE.
*/
-/* $MidnightBSD$ */
+/* $FreeBSD: stable/10/sys/boot/ficl/i386/sysdep.h 231042 2012-02-05 20:00:39Z rpaulo $ */
#if !defined (__SYSDEP_H__)
#define __SYSDEP_H__
@@ -58,7 +59,7 @@
#include <assert.h>
#if !defined IGNORE /* Macro to silence unused param warnings */
-#define IGNORE(x) &x
+#define IGNORE(x) (void)x
#endif
/*
@@ -405,7 +406,7 @@
#if FICL_MULTITHREAD
int ficlLockDictionary(short fLock);
#else
-#define ficlLockDictionary(x) 0 /* ignore */
+#define ficlLockDictionary(x) /* ignore */
#endif
/*
Added: trunk/sys/boot/ficl/ia64/sysdep.c
===================================================================
--- trunk/sys/boot/ficl/ia64/sysdep.c (rev 0)
+++ trunk/sys/boot/ficl/ia64/sysdep.c 2018-06-02 00:05:49 UTC (rev 10203)
@@ -0,0 +1,102 @@
+/* $MidnightBSD$ */
+/*******************************************************************
+** s y s d e p . c
+** Forth Inspired Command Language
+** Author: John Sadler (john_sadler at alum.mit.edu)
+** Created: 16 Oct 1997
+** Implementations of FICL external interface functions...
+**
+*******************************************************************/
+
+/* $FreeBSD: stable/10/sys/boot/ficl/ia64/sysdep.c 82940 2001-09-04 08:50:23Z dfr $ */
+
+#ifdef TESTMAIN
+#include <stdio.h>
+#include <stdlib.h>
+#else
+#include <stand.h>
+#endif
+#include "ficl.h"
+
+/*
+******************* FreeBSD P O R T B E G I N S H E R E ******************** Michael Smith
+*/
+
+#if PORTABLE_LONGMULDIV == 0
+DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y)
+{
+ DPUNS q;
+ u_int64_t qx;
+
+ qx = (u_int64_t)x * (u_int64_t) y;
+
+ q.hi = (u_int32_t)( qx >> 32 );
+ q.lo = (u_int32_t)( qx & 0xFFFFFFFFL);
+
+ return q;
+}
+
+UNSQR ficlLongDiv(DPUNS q, FICL_UNS y)
+{
+ UNSQR result;
+ u_int64_t qx, qh;
+
+ qh = q.hi;
+ qx = (qh << 32) | q.lo;
+
+ result.quot = qx / y;
+ result.rem = qx % y;
+
+ return result;
+}
+#endif
+
+void ficlTextOut(FICL_VM *pVM, char *msg, int fNewline)
+{
+ IGNORE(pVM);
+
+ while(*msg != 0)
+ putchar(*(msg++));
+ if (fNewline)
+ putchar('\n');
+
+ return;
+}
+
+void *ficlMalloc (size_t size)
+{
+ return malloc(size);
+}
+
+void *ficlRealloc (void *p, size_t size)
+{
+ return realloc(p, size);
+}
+
+void ficlFree (void *p)
+{
+ free(p);
+}
+
+
+/*
+** Stub function for dictionary access control - does nothing
+** by default, user can redefine to guarantee exclusive dict
+** access to a single thread for updates. All dict update code
+** is guaranteed to be bracketed as follows:
+** ficlLockDictionary(TRUE);
+** <code that updates dictionary>
+** ficlLockDictionary(FALSE);
+**
+** Returns zero if successful, nonzero if unable to acquire lock
+** befor timeout (optional - could also block forever)
+*/
+#if FICL_MULTITHREAD
+int ficlLockDictionary(short fLock)
+{
+ IGNORE(fLock);
+ return 0;
+}
+#endif /* FICL_MULTITHREAD */
+
+
Property changes on: trunk/sys/boot/ficl/ia64/sysdep.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/sys/boot/ficl/ia64/sysdep.h
===================================================================
--- trunk/sys/boot/ficl/ia64/sysdep.h (rev 0)
+++ trunk/sys/boot/ficl/ia64/sysdep.h 2018-06-02 00:05:49 UTC (rev 10203)
@@ -0,0 +1,435 @@
+/* $MidnightBSD$ */
+/*******************************************************************
+ s y s d e p . h
+** Forth Inspired Command Language
+** Author: John Sadler (john_sadler at alum.mit.edu)
+** Created: 16 Oct 1997
+** Ficl system dependent types and prototypes...
+**
+** Note: Ficl also depends on the use of "assert" when
+** FICL_ROBUST is enabled. This may require some consideration
+** in firmware systems since assert often
+** assumes stderr/stdout.
+** $Id: sysdep.h,v 1.11 2001/12/05 07:21:34 jsadler Exp $
+*******************************************************************/
+/*
+** Copyright (c) 1997-2001 John Sadler (john_sadler at alum.mit.edu)
+** All rights reserved.
+**
+** Get the latest Ficl release at http://ficl.sourceforge.net
+**
+** I am interested in hearing from anyone who uses ficl. If you have
+** a problem, a success story, a defect, an enhancement request, or
+** if you would like to contribute to the ficl release, please
+** contact me by email at the address above.
+**
+** L I C E N S E and D I S C L A I M E R
+**
+** Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions
+** are met:
+** 1. Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** 2. Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in the
+** documentation and/or other materials provided with the distribution.
+**
+** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+** ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+** OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+** SUCH DAMAGE.
+**
+** $Id: sysdep.h,v 1.6 2001-04-26 21:41:55-07 jsadler Exp jsadler $
+*/
+
+/* $FreeBSD: stable/10/sys/boot/ficl/ia64/sysdep.h 96755 2002-05-16 21:28:32Z trhodes $ */
+
+#if !defined (__SYSDEP_H__)
+#define __SYSDEP_H__
+
+#include <sys/types.h>
+
+#include <stddef.h> /* size_t, NULL */
+#include <setjmp.h>
+#include <assert.h>
+
+#if !defined IGNORE /* Macro to silence unused param warnings */
+#define IGNORE(x) &x
+#endif
+
+/*
+** TRUE and FALSE for C boolean operations, and
+** portable 32 bit types for CELLs
+**
+*/
+#if !defined TRUE
+#define TRUE 1
+#endif
+#if !defined FALSE
+#define FALSE 0
+#endif
+
+/*
+** System dependent data type declarations...
+*/
+#if !defined INT32
+#define INT32 int
+#endif
+
+#if !defined UNS32
+#define UNS32 unsigned int
+#endif
+
+#if !defined UNS16
+#define UNS16 unsigned short
+#endif
+
+#if !defined UNS8
+#define UNS8 unsigned char
+#endif
+
+#if !defined NULL
+#define NULL ((void *)0)
+#endif
+
+/*
+** FICL_UNS and FICL_INT must have the same size as a void* on
+** the target system. A CELL is a union of void*, FICL_UNS, and
+** FICL_INT.
+** (11/2000: same for FICL_FLOAT)
+*/
+#if !defined FICL_INT
+#define FICL_INT long
+#endif
+
+#if !defined FICL_UNS
+#define FICL_UNS unsigned long
+#endif
+
+#if !defined FICL_FLOAT
+#define FICL_FLOAT float
+#endif
+
+/*
+** Ficl presently supports values of 32 and 64 for BITS_PER_CELL
+*/
+#if !defined BITS_PER_CELL
+#define BITS_PER_CELL 64
+#endif
+
+#if ((BITS_PER_CELL != 32) && (BITS_PER_CELL != 64))
+ Error!
+#endif
+
+typedef struct
+{
+ FICL_UNS hi;
+ FICL_UNS lo;
+} DPUNS;
+
+typedef struct
+{
+ FICL_UNS quot;
+ FICL_UNS rem;
+} UNSQR;
+
+typedef struct
+{
+ FICL_INT hi;
+ FICL_INT lo;
+} DPINT;
+
+typedef struct
+{
+ FICL_INT quot;
+ FICL_INT rem;
+} INTQR;
+
+
+/*
+** B U I L D C O N T R O L S
+*/
+
+#if !defined (FICL_MINIMAL)
+#define FICL_MINIMAL 0
+#endif
+#if (FICL_MINIMAL)
+#define FICL_WANT_SOFTWORDS 0
+#define FICL_WANT_FILE 0
+#define FICL_WANT_FLOAT 0
+#define FICL_WANT_USER 0
+#define FICL_WANT_LOCALS 0
+#define FICL_WANT_DEBUGGER 0
+#define FICL_WANT_OOP 0
+#define FICL_PLATFORM_EXTEND 0
+#define FICL_MULTITHREAD 0
+#define FICL_ROBUST 0
+#define FICL_EXTENDED_PREFIX 0
+#endif
+
+/*
+** FICL_PLATFORM_EXTEND
+** Includes words defined in ficlCompilePlatform
+*/
+#if !defined (FICL_PLATFORM_EXTEND)
+#define FICL_PLATFORM_EXTEND 1
+#endif
+
+
+/*
+** FICL_WANT_FILE
+** Includes the FILE and FILE-EXT wordset and associated code. Turn this off if you do not
+** have a filesystem!
+** Contributed by Larry Hastings
+*/
+#if !defined (FICL_WANT_FILE)
+#define FICL_WANT_FILE 0
+#endif
+
+/*
+** FICL_WANT_FLOAT
+** Includes a floating point stack for the VM, and words to do float operations.
+** Contributed by Guy Carver
+*/
+#if !defined (FICL_WANT_FLOAT)
+#define FICL_WANT_FLOAT 0
+#endif
+
+/*
+** FICL_WANT_DEBUGGER
+** Inludes a simple source level debugger
+*/
+#if !defined (FICL_WANT_DEBUGGER)
+#define FICL_WANT_DEBUGGER 1
+#endif
+
+/*
+** FICL_EXTENDED_PREFIX enables a bunch of extra prefixes in prefix.c and prefix.fr (if
+** included as part of softcore.c)
+*/
+#if !defined FICL_EXTENDED_PREFIX
+#define FICL_EXTENDED_PREFIX 0
+#endif
+
+/*
+** User variables: per-instance variables bound to the VM.
+** Kinda like thread-local storage. Could be implemented in a
+** VM private dictionary, but I've chosen the lower overhead
+** approach of an array of CELLs instead.
+*/
+#if !defined FICL_WANT_USER
+#define FICL_WANT_USER 1
+#endif
+
+#if !defined FICL_USER_CELLS
+#define FICL_USER_CELLS 16
+#endif
+
+/*
+** FICL_WANT_LOCALS controls the creation of the LOCALS wordset and
+** a private dictionary for local variable compilation.
+*/
+#if !defined FICL_WANT_LOCALS
+#define FICL_WANT_LOCALS 1
+#endif
+
+/* Max number of local variables per definition */
+#if !defined FICL_MAX_LOCALS
+#define FICL_MAX_LOCALS 16
+#endif
+
+/*
+** FICL_WANT_OOP
+** Inludes object oriented programming support (in softwords)
+** OOP support requires locals and user variables!
+*/
+#if !(FICL_WANT_LOCALS) || !(FICL_WANT_USER)
+#if !defined (FICL_WANT_OOP)
+#define FICL_WANT_OOP 0
+#endif
+#endif
+
+#if !defined (FICL_WANT_OOP)
+#define FICL_WANT_OOP 1
+#endif
+
+/*
+** FICL_WANT_SOFTWORDS
+** Controls inclusion of all softwords in softcore.c
+*/
+#if !defined (FICL_WANT_SOFTWORDS)
+#define FICL_WANT_SOFTWORDS 1
+#endif
+
+/*
+** FICL_MULTITHREAD enables dictionary mutual exclusion
+** wia the ficlLockDictionary system dependent function.
+** Note: this implementation is experimental and poorly
+** tested. Further, it's unnecessary unless you really
+** intend to have multiple SESSIONS (poor choice of name
+** on my part) - that is, threads that modify the dictionary
+** at the same time.
+*/
+#if !defined FICL_MULTITHREAD
+#define FICL_MULTITHREAD 0
+#endif
+
+/*
+** PORTABLE_LONGMULDIV causes ficlLongMul and ficlLongDiv to be
+** defined in C in sysdep.c. Use this if you cannot easily
+** generate an inline asm definition
+*/
+#if !defined (PORTABLE_LONGMULDIV)
+#define PORTABLE_LONGMULDIV 0
+#endif
+
+/*
+** INLINE_INNER_LOOP causes the inner interpreter to be inline code
+** instead of a function call. This is mainly because MS VC++ 5
+** chokes with an internal compiler error on the function version.
+** in release mode. Sheesh.
+*/
+#if !defined INLINE_INNER_LOOP
+#if defined _DEBUG
+#define INLINE_INNER_LOOP 0
+#else
+#define INLINE_INNER_LOOP 1
+#endif
+#endif
+
+/*
+** FICL_ROBUST enables bounds checking of stacks and the dictionary.
+** This will detect stack over and underflows and dictionary overflows.
+** Any exceptional condition will result in an assertion failure.
+** (As generated by the ANSI assert macro)
+** FICL_ROBUST == 1 --> stack checking in the outer interpreter
+** FICL_ROBUST == 2 also enables checking in many primitives
+*/
+
+#if !defined FICL_ROBUST
+#define FICL_ROBUST 2
+#endif
+
+/*
+** FICL_DEFAULT_STACK Specifies the default size (in CELLs) of
+** a new virtual machine's stacks, unless overridden at
+** create time.
+*/
+#if !defined FICL_DEFAULT_STACK
+#define FICL_DEFAULT_STACK 128
+#endif
+
+/*
+** FICL_DEFAULT_DICT specifies the number of CELLs to allocate
+** for the system dictionary by default. The value
+** can be overridden at startup time as well.
+** FICL_DEFAULT_ENV specifies the number of cells to allot
+** for the environment-query dictionary.
+*/
+#if !defined FICL_DEFAULT_DICT
+#define FICL_DEFAULT_DICT 12288
+#endif
+
+#if !defined FICL_DEFAULT_ENV
+#define FICL_DEFAULT_ENV 260
+#endif
+
+/*
+** FICL_DEFAULT_VOCS specifies the maximum number of wordlists in
+** the dictionary search order. See Forth DPANS sec 16.3.3
+** (file://dpans16.htm#16.3.3)
+*/
+#if !defined FICL_DEFAULT_VOCS
+#define FICL_DEFAULT_VOCS 16
+#endif
+
+/*
+** FICL_MAX_PARSE_STEPS controls the size of an array in the FICL_SYSTEM structure
+** that stores pointers to parser extension functions. I would never expect to have
+** more than 8 of these, so that's the default limit. Too many of these functions
+** will probably exact a nasty performance penalty.
+*/
+#if !defined FICL_MAX_PARSE_STEPS
+#define FICL_MAX_PARSE_STEPS 8
+#endif
+
+/*
+** FICL_ALIGN is the power of two to which the dictionary
+** pointer address must be aligned. This value is usually
+** either 1 or 2, depending on the memory architecture
+** of the target system; 2 is safe on any 16 or 32 bit
+** machine. 3 would be appropriate for a 64 bit machine.
+*/
+#if !defined FICL_ALIGN
+#define FICL_ALIGN 3
+#define FICL_ALIGN_ADD ((1 << FICL_ALIGN) - 1)
+#endif
+
+/*
+** System dependent routines --
+** edit the implementations in sysdep.c to be compatible
+** with your runtime environment...
+** ficlTextOut sends a NULL terminated string to the
+** default output device - used for system error messages
+** ficlMalloc and ficlFree have the same semantics as malloc and free
+** in standard C
+** ficlLongMul multiplies two UNS32s and returns a 64 bit unsigned
+** product
+** ficlLongDiv divides an UNS64 by an UNS32 and returns UNS32 quotient
+** and remainder
+*/
+struct vm;
+void ficlTextOut(struct vm *pVM, char *msg, int fNewline);
+void *ficlMalloc (size_t size);
+void ficlFree (void *p);
+void *ficlRealloc(void *p, size_t size);
+/*
+** Stub function for dictionary access control - does nothing
+** by default, user can redefine to guarantee exclusive dict
+** access to a single thread for updates. All dict update code
+** must be bracketed as follows:
+** ficlLockDictionary(TRUE);
+** <code that updates dictionary>
+** ficlLockDictionary(FALSE);
+**
+** Returns zero if successful, nonzero if unable to acquire lock
+** before timeout (optional - could also block forever)
+**
+** NOTE: this function must be implemented with lock counting
+** semantics: nested calls must behave properly.
+*/
+#if FICL_MULTITHREAD
+int ficlLockDictionary(short fLock);
+#else
+#define ficlLockDictionary(x) 0 /* ignore */
+#endif
+
+/*
+** 64 bit integer math support routines: multiply two UNS32s
+** to get a 64 bit product, & divide the product by an UNS32
+** to get an UNS32 quotient and remainder. Much easier in asm
+** on a 32 bit CPU than in C, which usually doesn't support
+** the double length result (but it should).
+*/
+DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y);
+UNSQR ficlLongDiv(DPUNS q, FICL_UNS y);
+
+
+/*
+** FICL_HAVE_FTRUNCATE indicates whether the current OS supports
+** the ftruncate() function (available on most UNIXes). This
+** function is necessary to provide the complete File-Access wordset.
+*/
+#if !defined (FICL_HAVE_FTRUNCATE)
+#define FICL_HAVE_FTRUNCATE 0
+#endif
+
+
+#endif /*__SYSDEP_H__*/
Property changes on: trunk/sys/boot/ficl/ia64/sysdep.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/sys/boot/ficl/loader.c
===================================================================
--- trunk/sys/boot/ficl/loader.c 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/loader.c 2018-06-02 00:05:49 UTC (rev 10203)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 2000 Daniel Capo Sobral
* All rights reserved.
@@ -23,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/boot/ficl/loader.c 254155 2013-08-09 19:10:56Z marcel $
*/
/*******************************************************************
@@ -33,7 +34,13 @@
*******************************************************************/
#ifdef TESTMAIN
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <dirent.h>
+#include <fcntl.h>
+#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
#else
#include <stand.h>
#endif
@@ -135,9 +142,9 @@
ficlGetenv(FICL_VM *pVM)
{
#ifndef TESTMAIN
- char *name;
+ char *name, *value;
#endif
- char *namep, *value;
+ char *namep;
int names;
#if FICL_ROBUST > 1
@@ -243,9 +250,9 @@
ficlFindfile(FICL_VM *pVM)
{
#ifndef TESTMAIN
- char *name;
+ char *name, *type;
#endif
- char *type, *namep, *typep;
+ char *namep, *typep;
struct preloaded_file* fp;
int names, types;
@@ -404,6 +411,34 @@
return;
}
+/* isdir? - Return whether an fd corresponds to a directory.
+ *
+ * isdir? ( fd -- bool )
+ */
+static void isdirQuestion(FICL_VM *pVM)
+{
+ struct stat sb;
+ FICL_INT flag;
+ int fd;
+
+#if FICL_ROBUST > 1
+ vmCheckStack(pVM, 1, 1);
+#endif
+
+ fd = stackPopINT(pVM->pStack);
+ flag = FICL_FALSE;
+ do {
+ if (fd < 0)
+ break;
+ if (fstat(fd, &sb) < 0)
+ break;
+ if (!S_ISDIR(sb.st_mode))
+ break;
+ flag = FICL_TRUE;
+ } while (0);
+ stackPushINT(pVM->pStack, flag);
+}
+
/* fopen - open a file and return new fd on stack.
*
* fopen ( ptr count mode -- fd )
@@ -477,6 +512,79 @@
return;
}
+/* freaddir - read directory contents
+ *
+ * freaddir ( fd -- ptr len TRUE | FALSE )
+ */
+static void pfreaddir(FICL_VM *pVM)
+{
+#ifdef TESTMAIN
+ static struct dirent dirent;
+ struct stat sb;
+ char *buf;
+ off_t off, ptr;
+ u_int blksz;
+ int bufsz;
+#endif
+ struct dirent *d;
+ int fd;
+
+#if FICL_ROBUST > 1
+ vmCheckStack(pVM, 1, 3);
+#endif
+
+ fd = stackPopINT(pVM->pStack);
+#if TESTMAIN
+ /*
+ * The readdirfd() function is specific to the loader environment.
+ * We do the best we can to make freaddir work, but it's not at
+ * all guaranteed.
+ */
+ d = NULL;
+ buf = NULL;
+ do {
+ if (fd == -1)
+ break;
+ if (fstat(fd, &sb) == -1)
+ break;
+ blksz = (sb.st_blksize) ? sb.st_blksize : getpagesize();
+ if ((blksz & (blksz - 1)) != 0)
+ break;
+ buf = malloc(blksz);
+ if (buf == NULL)
+ break;
+ off = lseek(fd, 0LL, SEEK_CUR);
+ if (off == -1)
+ break;
+ ptr = off;
+ if (lseek(fd, 0, SEEK_SET) == -1)
+ break;
+ bufsz = getdents(fd, buf, blksz);
+ while (bufsz > 0 && bufsz <= ptr) {
+ ptr -= bufsz;
+ bufsz = getdents(fd, buf, blksz);
+ }
+ if (bufsz <= 0)
+ break;
+ d = (void *)(buf + ptr);
+ dirent = *d;
+ off += d->d_reclen;
+ d = (lseek(fd, off, SEEK_SET) != off) ? NULL : &dirent;
+ } while (0);
+ if (buf != NULL)
+ free(buf);
+#else
+ d = readdirfd(fd);
+#endif
+ if (d != NULL) {
+ stackPushPtr(pVM->pStack, d->d_name);
+ stackPushINT(pVM->pStack, strlen(d->d_name));
+ stackPushINT(pVM->pStack, FICL_TRUE);
+ } else {
+ stackPushINT(pVM->pStack, FICL_FALSE);
+ }
+}
+
/* fload - interpret file contents
*
* fload ( fd -- )
@@ -653,9 +761,11 @@
assert (dp);
dictAppendWord(dp, ".#", displayCellNoPad, FW_DEFAULT);
+ dictAppendWord(dp, "isdir?", isdirQuestion, FW_DEFAULT);
dictAppendWord(dp, "fopen", pfopen, FW_DEFAULT);
dictAppendWord(dp, "fclose", pfclose, FW_DEFAULT);
dictAppendWord(dp, "fread", pfread, FW_DEFAULT);
+ dictAppendWord(dp, "freaddir", pfreaddir, FW_DEFAULT);
dictAppendWord(dp, "fload", pfload, FW_DEFAULT);
dictAppendWord(dp, "fkey", fkey, FW_DEFAULT);
dictAppendWord(dp, "fseek", pfseek, FW_DEFAULT);
Modified: trunk/sys/boot/ficl/math64.c
===================================================================
--- trunk/sys/boot/ficl/math64.c 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/math64.c 2018-06-02 00:05:49 UTC (rev 10203)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*******************************************************************
** m a t h 6 4 . c
** Forth Inspired Command Language - 64 bit math support routines
@@ -5,7 +6,7 @@
** Created: 25 January 1998
** Rev 2.03: Support for 128 bit DP math. This file really ouught to
** be renamed!
-** $Id: math64.c,v 1.2 2012-12-29 04:58:20 laffer1 Exp $
+** $Id: math64.c,v 1.9 2001/12/05 07:21:34 jsadler Exp $
*******************************************************************/
/*
** Copyright (c) 1997-2001 John Sadler (john_sadler at alum.mit.edu)
@@ -42,7 +43,7 @@
** SUCH DAMAGE.
*/
-/* $MidnightBSD$ */
+/* $FreeBSD: stable/10/sys/boot/ficl/math64.c 94290 2002-04-09 17:45:28Z dcs $ */
#include "ficl.h"
#include "math64.h"
Modified: trunk/sys/boot/ficl/math64.h
===================================================================
--- trunk/sys/boot/ficl/math64.h 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/math64.h 2018-06-02 00:05:49 UTC (rev 10203)
@@ -1,9 +1,10 @@
+/* $MidnightBSD$ */
/*******************************************************************
** m a t h 6 4 . h
** Forth Inspired Command Language - 64 bit math support routines
** Author: John Sadler (john_sadler at alum.mit.edu)
** Created: 25 January 1998
-** $Id: math64.h,v 1.2 2012-12-29 04:58:20 laffer1 Exp $
+** $Id: math64.h,v 1.9 2001/12/05 07:21:34 jsadler Exp $
*******************************************************************/
/*
** Copyright (c) 1997-2001 John Sadler (john_sadler at alum.mit.edu)
@@ -40,7 +41,7 @@
** SUCH DAMAGE.
*/
-/* $MidnightBSD$ */
+/* $FreeBSD: stable/10/sys/boot/ficl/math64.h 94290 2002-04-09 17:45:28Z dcs $ */
#if !defined (__MATH64_H__)
#define __MATH64_H__
Added: trunk/sys/boot/ficl/mips/sysdep.c
===================================================================
--- trunk/sys/boot/ficl/mips/sysdep.c (rev 0)
+++ trunk/sys/boot/ficl/mips/sysdep.c 2018-06-02 00:05:49 UTC (rev 10203)
@@ -0,0 +1,102 @@
+/* $MidnightBSD$ */
+/*******************************************************************
+** s y s d e p . c
+** Forth Inspired Command Language
+** Author: John Sadler (john_sadler at alum.mit.edu)
+** Created: 16 Oct 1997
+** Implementations of FICL external interface functions...
+**
+*******************************************************************/
+
+/* $FreeBSD: stable/10/sys/boot/ficl/mips/sysdep.c 188824 2009-02-19 18:52:31Z imp $ */
+
+#ifdef TESTMAIN
+#include <stdio.h>
+#include <stdlib.h>
+#else
+#include <stand.h>
+#endif
+#include "ficl.h"
+
+/*
+******************* FreeBSD P O R T B E G I N S H E R E ******************** Michael Smith
+*/
+
+#if PORTABLE_LONGMULDIV == 0
+DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y)
+{
+ DPUNS q;
+ u_int64_t qx;
+
+ qx = (u_int64_t)x * (u_int64_t) y;
+
+ q.hi = (u_int32_t)( qx >> 32 );
+ q.lo = (u_int32_t)( qx & 0xFFFFFFFFL);
+
+ return q;
+}
+
+UNSQR ficlLongDiv(DPUNS q, FICL_UNS y)
+{
+ UNSQR result;
+ u_int64_t qx, qh;
+
+ qh = q.hi;
+ qx = (qh << 32) | q.lo;
+
+ result.quot = qx / y;
+ result.rem = qx % y;
+
+ return result;
+}
+#endif
+
+void ficlTextOut(FICL_VM *pVM, char *msg, int fNewline)
+{
+ IGNORE(pVM);
+
+ while(*msg != 0)
+ putchar(*(msg++));
+ if (fNewline)
+ putchar('\n');
+
+ return;
+}
+
+void *ficlMalloc (size_t size)
+{
+ return malloc(size);
+}
+
+void *ficlRealloc (void *p, size_t size)
+{
+ return realloc(p, size);
+}
+
+void ficlFree (void *p)
+{
+ free(p);
+}
+
+
+/*
+** Stub function for dictionary access control - does nothing
+** by default, user can redefine to guarantee exclusive dict
+** access to a single thread for updates. All dict update code
+** is guaranteed to be bracketed as follows:
+** ficlLockDictionary(TRUE);
+** <code that updates dictionary>
+** ficlLockDictionary(FALSE);
+**
+** Returns zero if successful, nonzero if unable to acquire lock
+** befor timeout (optional - could also block forever)
+*/
+#if FICL_MULTITHREAD
+int ficlLockDictionary(short fLock)
+{
+ IGNORE(fLock);
+ return 0;
+}
+#endif /* FICL_MULTITHREAD */
+
+
Property changes on: trunk/sys/boot/ficl/mips/sysdep.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/sys/boot/ficl/mips/sysdep.h
===================================================================
--- trunk/sys/boot/ficl/mips/sysdep.h (rev 0)
+++ trunk/sys/boot/ficl/mips/sysdep.h 2018-06-02 00:05:49 UTC (rev 10203)
@@ -0,0 +1,433 @@
+/* $MidnightBSD$ */
+/*******************************************************************
+ s y s d e p . h
+** Forth Inspired Command Language
+** Author: John Sadler (john_sadler at alum.mit.edu)
+** Created: 16 Oct 1997
+** Ficl system dependent types and prototypes...
+**
+** Note: Ficl also depends on the use of "assert" when
+** FICL_ROBUST is enabled. This may require some consideration
+** in firmware systems since assert often
+** assumes stderr/stdout.
+** $Id: sysdep.h,v 1.6 2001-04-26 21:41:55-07 jsadler Exp jsadler $
+*******************************************************************/
+/*
+** Copyright (c) 1997-2001 John Sadler (john_sadler at alum.mit.edu)
+** All rights reserved.
+**
+** Get the latest Ficl release at http://ficl.sourceforge.net
+**
+** L I C E N S E and D I S C L A I M E R
+**
+** Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions
+** are met:
+** 1. Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** 2. Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in the
+** documentation and/or other materials provided with the distribution.
+**
+** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+** ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+** OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+** SUCH DAMAGE.
+**
+** I am interested in hearing from anyone who uses ficl. If you have
+** a problem, a success story, a defect, an enhancement request, or
+** if you would like to contribute to the ficl release, please send
+** contact me by email at the address above.
+**
+** $Id: sysdep.h,v 1.6 2001-04-26 21:41:55-07 jsadler Exp jsadler $
+** $FreeBSD: stable/10/sys/boot/ficl/mips/sysdep.h 188824 2009-02-19 18:52:31Z imp $
+*/
+
+#if !defined (__SYSDEP_H__)
+#define __SYSDEP_H__
+
+#include <sys/types.h>
+
+#include <stddef.h> /* size_t, NULL */
+#include <setjmp.h>
+#include <assert.h>
+
+#if !defined IGNORE /* Macro to silence unused param warnings */
+#define IGNORE(x) &x
+#endif
+
+/*
+** TRUE and FALSE for C boolean operations, and
+** portable 32 bit types for CELLs
+**
+*/
+#if !defined TRUE
+#define TRUE 1
+#endif
+#if !defined FALSE
+#define FALSE 0
+#endif
+
+
+/*
+** System dependent data type declarations...
+*/
+#if !defined INT32
+#define INT32 int
+#endif
+
+#if !defined UNS32
+#define UNS32 unsigned int
+#endif
+
+#if !defined UNS16
+#define UNS16 unsigned short
+#endif
+
+#if !defined UNS8
+#define UNS8 unsigned char
+#endif
+
+#if !defined NULL
+#define NULL ((void *)0)
+#endif
+
+/*
+** FICL_UNS and FICL_INT must have the same size as a void* on
+** the target system. A CELL is a union of void*, FICL_UNS, and
+** FICL_INT.
+** (11/2000: same for FICL_FLOAT)
+*/
+#if !defined FICL_INT
+#define FICL_INT INT32
+#endif
+
+#if !defined FICL_UNS
+#define FICL_UNS UNS32
+#endif
+
+#if !defined FICL_FLOAT
+#define FICL_FLOAT float
+#endif
+
+/*
+** Ficl presently supports values of 32 and 64 for BITS_PER_CELL
+*/
+#if !defined BITS_PER_CELL
+#define BITS_PER_CELL 32
+#endif
+
+#if ((BITS_PER_CELL != 32) && (BITS_PER_CELL != 64))
+ Error!
+#endif
+
+typedef struct
+{
+ FICL_UNS hi;
+ FICL_UNS lo;
+} DPUNS;
+
+typedef struct
+{
+ FICL_UNS quot;
+ FICL_UNS rem;
+} UNSQR;
+
+typedef struct
+{
+ FICL_INT hi;
+ FICL_INT lo;
+} DPINT;
+
+typedef struct
+{
+ FICL_INT quot;
+ FICL_INT rem;
+} INTQR;
+
+
+/*
+** B U I L D C O N T R O L S
+*/
+
+#if !defined (FICL_MINIMAL)
+#define FICL_MINIMAL 0
+#endif
+#if (FICL_MINIMAL)
+#define FICL_WANT_SOFTWORDS 0
+#define FICL_WANT_FILE 0
+#define FICL_WANT_FLOAT 0
+#define FICL_WANT_USER 0
+#define FICL_WANT_LOCALS 0
+#define FICL_WANT_DEBUGGER 0
+#define FICL_WANT_OOP 0
+#define FICL_PLATFORM_EXTEND 0
+#define FICL_MULTITHREAD 0
+#define FICL_ROBUST 1
+#define FICL_EXTENDED_PREFIX 0
+#endif
+
+/*
+** FICL_PLATFORM_EXTEND
+** Includes words defined in ficlCompilePlatform
+*/
+#if !defined (FICL_PLATFORM_EXTEND)
+#define FICL_PLATFORM_EXTEND 1
+#endif
+
+/*
+** FICL_WANT_FILE
+** Includes the FILE and FILE-EXT wordset and associated code. Turn this off if you do not
+** have a filesystem!
+** Contributed by Larry Hastings
+*/
+#if !defined (FICL_WANT_FILE)
+#define FICL_WANT_FILE 0
+#endif
+
+/*
+** FICL_WANT_FLOAT
+** Includes a floating point stack for the VM, and words to do float operations.
+** Contributed by Guy Carver
+*/
+#if !defined (FICL_WANT_FLOAT)
+#define FICL_WANT_FLOAT 0
+#endif
+
+/*
+** FICL_WANT_DEBUGGER
+** Inludes a simple source level debugger
+*/
+#if !defined (FICL_WANT_DEBUGGER)
+#define FICL_WANT_DEBUGGER 1
+#endif
+
+/*
+** User variables: per-instance variables bound to the VM.
+** Kinda like thread-local storage. Could be implemented in a
+** VM private dictionary, but I've chosen the lower overhead
+** approach of an array of CELLs instead.
+*/
+#if !defined FICL_WANT_USER
+#define FICL_WANT_USER 1
+#endif
+
+#if !defined FICL_USER_CELLS
+#define FICL_USER_CELLS 16
+#endif
+
+/*
+** FICL_WANT_LOCALS controls the creation of the LOCALS wordset and
+** a private dictionary for local variable compilation.
+*/
+#if !defined FICL_WANT_LOCALS
+#define FICL_WANT_LOCALS 1
+#endif
+
+/* Max number of local variables per definition */
+#if !defined FICL_MAX_LOCALS
+#define FICL_MAX_LOCALS 16
+#endif
+
+/*
+** FICL_WANT_OOP
+** Inludes object oriented programming support (in softwords)
+** OOP support requires locals and user variables!
+*/
+#if !(FICL_WANT_LOCALS) || !(FICL_WANT_USER)
+#if !defined (FICL_WANT_OOP)
+#define FICL_WANT_OOP 0
+#endif
+#endif
+
+#if !defined (FICL_WANT_OOP)
+#define FICL_WANT_OOP 1
+#endif
+
+/*
+** FICL_WANT_SOFTWORDS
+** Controls inclusion of all softwords in softcore.c
+*/
+#if !defined (FICL_WANT_SOFTWORDS)
+#define FICL_WANT_SOFTWORDS 1
+#endif
+
+/*
+** FICL_MULTITHREAD enables dictionary mutual exclusion
+** wia the ficlLockDictionary system dependent function.
+** Note: this implementation is experimental and poorly
+** tested. Further, it's unnecessary unless you really
+** intend to have multiple SESSIONS (poor choice of name
+** on my part) - that is, threads that modify the dictionary
+** at the same time.
+*/
+#if !defined FICL_MULTITHREAD
+#define FICL_MULTITHREAD 0
+#endif
+
+/*
+** PORTABLE_LONGMULDIV causes ficlLongMul and ficlLongDiv to be
+** defined in C in sysdep.c. Use this if you cannot easily
+** generate an inline asm definition
+*/
+#if !defined (PORTABLE_LONGMULDIV)
+#define PORTABLE_LONGMULDIV 0
+#endif
+
+/*
+** INLINE_INNER_LOOP causes the inner interpreter to be inline code
+** instead of a function call. This is mainly because MS VC++ 5
+** chokes with an internal compiler error on the function version.
+** in release mode. Sheesh.
+*/
+#if !defined INLINE_INNER_LOOP
+#if defined _DEBUG
+#define INLINE_INNER_LOOP 0
+#else
+#define INLINE_INNER_LOOP 1
+#endif
+#endif
+
+/*
+** FICL_ROBUST enables bounds checking of stacks and the dictionary.
+** This will detect stack over and underflows and dictionary overflows.
+** Any exceptional condition will result in an assertion failure.
+** (As generated by the ANSI assert macro)
+** FICL_ROBUST == 1 --> stack checking in the outer interpreter
+** FICL_ROBUST == 2 also enables checking in many primitives
+*/
+
+#if !defined FICL_ROBUST
+#define FICL_ROBUST 2
+#endif
+
+/*
+** FICL_DEFAULT_STACK Specifies the default size (in CELLs) of
+** a new virtual machine's stacks, unless overridden at
+** create time.
+*/
+#if !defined FICL_DEFAULT_STACK
+#define FICL_DEFAULT_STACK 128
+#endif
+
+/*
+** FICL_DEFAULT_DICT specifies the number of CELLs to allocate
+** for the system dictionary by default. The value
+** can be overridden at startup time as well.
+** FICL_DEFAULT_ENV specifies the number of cells to allot
+** for the environment-query dictionary.
+*/
+#if !defined FICL_DEFAULT_DICT
+#define FICL_DEFAULT_DICT 12288
+#endif
+
+#if !defined FICL_DEFAULT_ENV
+#define FICL_DEFAULT_ENV 260
+#endif
+
+/*
+** FICL_DEFAULT_VOCS specifies the maximum number of wordlists in
+** the dictionary search order. See Forth DPANS sec 16.3.3
+** (file://dpans16.htm#16.3.3)
+*/
+#if !defined FICL_DEFAULT_VOCS
+#define FICL_DEFAULT_VOCS 16
+#endif
+
+/*
+** FICL_MAX_PARSE_STEPS controls the size of an array in the FICL_SYSTEM structure
+** that stores pointers to parser extension functions. I would never expect to have
+** more than 8 of these, so that's the default limit. Too many of these functions
+** will probably exact a nasty performance penalty.
+*/
+#if !defined FICL_MAX_PARSE_STEPS
+#define FICL_MAX_PARSE_STEPS 8
+#endif
+
+/*
+** FICL_EXTENDED_PREFIX enables a bunch of extra prefixes in prefix.c and prefix.fr (if
+** included as part of softcore.c)
+*/
+#if !defined FICL_EXTENDED_PREFIX
+#define FICL_EXTENDED_PREFIX 0
+#endif
+
+/*
+** FICL_ALIGN is the power of two to which the dictionary
+** pointer address must be aligned. This value is usually
+** either 1 or 2, depending on the memory architecture
+** of the target system; 2 is safe on any 16 or 32 bit
+** machine. 3 would be appropriate for a 64 bit machine.
+*/
+#if !defined FICL_ALIGN
+#define FICL_ALIGN 2
+#define FICL_ALIGN_ADD ((1 << FICL_ALIGN) - 1)
+#endif
+
+/*
+** System dependent routines --
+** edit the implementations in sysdep.c to be compatible
+** with your runtime environment...
+** ficlTextOut sends a NULL terminated string to the
+** default output device - used for system error messages
+** ficlMalloc and ficlFree have the same semantics as malloc and free
+** in standard C
+** ficlLongMul multiplies two UNS32s and returns a 64 bit unsigned
+** product
+** ficlLongDiv divides an UNS64 by an UNS32 and returns UNS32 quotient
+** and remainder
+*/
+struct vm;
+void ficlTextOut(struct vm *pVM, char *msg, int fNewline);
+void *ficlMalloc (size_t size);
+void ficlFree (void *p);
+void *ficlRealloc(void *p, size_t size);
+/*
+** Stub function for dictionary access control - does nothing
+** by default, user can redefine to guarantee exclusive dict
+** access to a single thread for updates. All dict update code
+** must be bracketed as follows:
+** ficlLockDictionary(TRUE);
+** <code that updates dictionary>
+** ficlLockDictionary(FALSE);
+**
+** Returns zero if successful, nonzero if unable to acquire lock
+** before timeout (optional - could also block forever)
+**
+** NOTE: this function must be implemented with lock counting
+** semantics: nested calls must behave properly.
+*/
+#if FICL_MULTITHREAD
+int ficlLockDictionary(short fLock);
+#else
+#define ficlLockDictionary(x) 0 /* ignore */
+#endif
+
+/*
+** 64 bit integer math support routines: multiply two UNS32s
+** to get a 64 bit product, & divide the product by an UNS32
+** to get an UNS32 quotient and remainder. Much easier in asm
+** on a 32 bit CPU than in C, which usually doesn't support
+** the double length result (but it should).
+*/
+DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y);
+UNSQR ficlLongDiv(DPUNS q, FICL_UNS y);
+
+/*
+** FICL_HAVE_FTRUNCATE indicates whether the current OS supports
+** the ftruncate() function (available on most UNIXes). This
+** function is necessary to provide the complete File-Access wordset.
+*/
+#if !defined (FICL_HAVE_FTRUNCATE)
+#define FICL_HAVE_FTRUNCATE 0
+#endif
+
+
+#endif /*__SYSDEP_H__*/
Property changes on: trunk/sys/boot/ficl/mips/sysdep.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/sys/boot/ficl/powerpc/sysdep.c
===================================================================
--- trunk/sys/boot/ficl/powerpc/sysdep.c (rev 0)
+++ trunk/sys/boot/ficl/powerpc/sysdep.c 2018-06-02 00:05:49 UTC (rev 10203)
@@ -0,0 +1,102 @@
+/* $MidnightBSD$ */
+/*******************************************************************
+** s y s d e p . c
+** Forth Inspired Command Language
+** Author: John Sadler (john_sadler at alum.mit.edu)
+** Created: 16 Oct 1997
+** Implementations of FICL external interface functions...
+**
+*******************************************************************/
+
+/* $FreeBSD: stable/10/sys/boot/ficl/powerpc/sysdep.c 123372 2003-12-10 09:05:08Z grehan $ */
+
+#ifdef TESTMAIN
+#include <stdio.h>
+#include <stdlib.h>
+#else
+#include <stand.h>
+#endif
+#include "ficl.h"
+
+/*
+******************* FreeBSD P O R T B E G I N S H E R E ******************** Michael Smith
+*/
+
+#if PORTABLE_LONGMULDIV == 0
+DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y)
+{
+ DPUNS q;
+ u_int64_t qx;
+
+ qx = (u_int64_t)x * (u_int64_t) y;
+
+ q.hi = (u_int32_t)( qx >> 32 );
+ q.lo = (u_int32_t)( qx & 0xFFFFFFFFL);
+
+ return q;
+}
+
+UNSQR ficlLongDiv(DPUNS q, FICL_UNS y)
+{
+ UNSQR result;
+ u_int64_t qx, qh;
+
+ qh = q.hi;
+ qx = (qh << 32) | q.lo;
+
+ result.quot = qx / y;
+ result.rem = qx % y;
+
+ return result;
+}
+#endif
+
+void ficlTextOut(FICL_VM *pVM, char *msg, int fNewline)
+{
+ IGNORE(pVM);
+
+ while(*msg != 0)
+ putchar(*(msg++));
+ if (fNewline)
+ putchar('\n');
+
+ return;
+}
+
+void *ficlMalloc (size_t size)
+{
+ return malloc(size);
+}
+
+void *ficlRealloc (void *p, size_t size)
+{
+ return realloc(p, size);
+}
+
+void ficlFree (void *p)
+{
+ free(p);
+}
+
+
+/*
+** Stub function for dictionary access control - does nothing
+** by default, user can redefine to guarantee exclusive dict
+** access to a single thread for updates. All dict update code
+** is guaranteed to be bracketed as follows:
+** ficlLockDictionary(TRUE);
+** <code that updates dictionary>
+** ficlLockDictionary(FALSE);
+**
+** Returns zero if successful, nonzero if unable to acquire lock
+** befor timeout (optional - could also block forever)
+*/
+#if FICL_MULTITHREAD
+int ficlLockDictionary(short fLock)
+{
+ IGNORE(fLock);
+ return 0;
+}
+#endif /* FICL_MULTITHREAD */
+
+
Property changes on: trunk/sys/boot/ficl/powerpc/sysdep.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/sys/boot/ficl/powerpc/sysdep.h
===================================================================
--- trunk/sys/boot/ficl/powerpc/sysdep.h (rev 0)
+++ trunk/sys/boot/ficl/powerpc/sysdep.h 2018-06-02 00:05:49 UTC (rev 10203)
@@ -0,0 +1,433 @@
+/* $MidnightBSD$ */
+/*******************************************************************
+ s y s d e p . h
+** Forth Inspired Command Language
+** Author: John Sadler (john_sadler at alum.mit.edu)
+** Created: 16 Oct 1997
+** Ficl system dependent types and prototypes...
+**
+** Note: Ficl also depends on the use of "assert" when
+** FICL_ROBUST is enabled. This may require some consideration
+** in firmware systems since assert often
+** assumes stderr/stdout.
+** $Id: sysdep.h,v 1.6 2001-04-26 21:41:55-07 jsadler Exp jsadler $
+*******************************************************************/
+/*
+** Copyright (c) 1997-2001 John Sadler (john_sadler at alum.mit.edu)
+** All rights reserved.
+**
+** Get the latest Ficl release at http://ficl.sourceforge.net
+**
+** L I C E N S E and D I S C L A I M E R
+**
+** Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions
+** are met:
+** 1. Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** 2. Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in the
+** documentation and/or other materials provided with the distribution.
+**
+** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+** ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+** OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+** SUCH DAMAGE.
+**
+** I am interested in hearing from anyone who uses ficl. If you have
+** a problem, a success story, a defect, an enhancement request, or
+** if you would like to contribute to the ficl release, please send
+** contact me by email at the address above.
+**
+** $Id: sysdep.h,v 1.6 2001-04-26 21:41:55-07 jsadler Exp jsadler $
+** $FreeBSD: stable/10/sys/boot/ficl/powerpc/sysdep.h 123372 2003-12-10 09:05:08Z grehan $
+*/
+
+#if !defined (__SYSDEP_H__)
+#define __SYSDEP_H__
+
+#include <sys/types.h>
+
+#include <stddef.h> /* size_t, NULL */
+#include <setjmp.h>
+#include <assert.h>
+
+#if !defined IGNORE /* Macro to silence unused param warnings */
+#define IGNORE(x) &x
+#endif
+
+/*
+** TRUE and FALSE for C boolean operations, and
+** portable 32 bit types for CELLs
+**
+*/
+#if !defined TRUE
+#define TRUE 1
+#endif
+#if !defined FALSE
+#define FALSE 0
+#endif
+
+
+/*
+** System dependent data type declarations...
+*/
+#if !defined INT32
+#define INT32 int
+#endif
+
+#if !defined UNS32
+#define UNS32 unsigned int
+#endif
+
+#if !defined UNS16
+#define UNS16 unsigned short
+#endif
+
+#if !defined UNS8
+#define UNS8 unsigned char
+#endif
+
+#if !defined NULL
+#define NULL ((void *)0)
+#endif
+
+/*
+** FICL_UNS and FICL_INT must have the same size as a void* on
+** the target system. A CELL is a union of void*, FICL_UNS, and
+** FICL_INT.
+** (11/2000: same for FICL_FLOAT)
+*/
+#if !defined FICL_INT
+#define FICL_INT INT32
+#endif
+
+#if !defined FICL_UNS
+#define FICL_UNS UNS32
+#endif
+
+#if !defined FICL_FLOAT
+#define FICL_FLOAT float
+#endif
+
+/*
+** Ficl presently supports values of 32 and 64 for BITS_PER_CELL
+*/
+#if !defined BITS_PER_CELL
+#define BITS_PER_CELL 32
+#endif
+
+#if ((BITS_PER_CELL != 32) && (BITS_PER_CELL != 64))
+ Error!
+#endif
+
+typedef struct
+{
+ FICL_UNS hi;
+ FICL_UNS lo;
+} DPUNS;
+
+typedef struct
+{
+ FICL_UNS quot;
+ FICL_UNS rem;
+} UNSQR;
+
+typedef struct
+{
+ FICL_INT hi;
+ FICL_INT lo;
+} DPINT;
+
+typedef struct
+{
+ FICL_INT quot;
+ FICL_INT rem;
+} INTQR;
+
+
+/*
+** B U I L D C O N T R O L S
+*/
+
+#if !defined (FICL_MINIMAL)
+#define FICL_MINIMAL 0
+#endif
+#if (FICL_MINIMAL)
+#define FICL_WANT_SOFTWORDS 0
+#define FICL_WANT_FILE 0
+#define FICL_WANT_FLOAT 0
+#define FICL_WANT_USER 0
+#define FICL_WANT_LOCALS 0
+#define FICL_WANT_DEBUGGER 0
+#define FICL_WANT_OOP 0
+#define FICL_PLATFORM_EXTEND 0
+#define FICL_MULTITHREAD 0
+#define FICL_ROBUST 1
+#define FICL_EXTENDED_PREFIX 0
+#endif
+
+/*
+** FICL_PLATFORM_EXTEND
+** Includes words defined in ficlCompilePlatform
+*/
+#if !defined (FICL_PLATFORM_EXTEND)
+#define FICL_PLATFORM_EXTEND 1
+#endif
+
+/*
+** FICL_WANT_FILE
+** Includes the FILE and FILE-EXT wordset and associated code. Turn this off if you do not
+** have a filesystem!
+** Contributed by Larry Hastings
+*/
+#if !defined (FICL_WANT_FILE)
+#define FICL_WANT_FILE 0
+#endif
+
+/*
+** FICL_WANT_FLOAT
+** Includes a floating point stack for the VM, and words to do float operations.
+** Contributed by Guy Carver
+*/
+#if !defined (FICL_WANT_FLOAT)
+#define FICL_WANT_FLOAT 0
+#endif
+
+/*
+** FICL_WANT_DEBUGGER
+** Inludes a simple source level debugger
+*/
+#if !defined (FICL_WANT_DEBUGGER)
+#define FICL_WANT_DEBUGGER 1
+#endif
+
+/*
+** User variables: per-instance variables bound to the VM.
+** Kinda like thread-local storage. Could be implemented in a
+** VM private dictionary, but I've chosen the lower overhead
+** approach of an array of CELLs instead.
+*/
+#if !defined FICL_WANT_USER
+#define FICL_WANT_USER 1
+#endif
+
+#if !defined FICL_USER_CELLS
+#define FICL_USER_CELLS 16
+#endif
+
+/*
+** FICL_WANT_LOCALS controls the creation of the LOCALS wordset and
+** a private dictionary for local variable compilation.
+*/
+#if !defined FICL_WANT_LOCALS
+#define FICL_WANT_LOCALS 1
+#endif
+
+/* Max number of local variables per definition */
+#if !defined FICL_MAX_LOCALS
+#define FICL_MAX_LOCALS 16
+#endif
+
+/*
+** FICL_WANT_OOP
+** Inludes object oriented programming support (in softwords)
+** OOP support requires locals and user variables!
+*/
+#if !(FICL_WANT_LOCALS) || !(FICL_WANT_USER)
+#if !defined (FICL_WANT_OOP)
+#define FICL_WANT_OOP 0
+#endif
+#endif
+
+#if !defined (FICL_WANT_OOP)
+#define FICL_WANT_OOP 1
+#endif
+
+/*
+** FICL_WANT_SOFTWORDS
+** Controls inclusion of all softwords in softcore.c
+*/
+#if !defined (FICL_WANT_SOFTWORDS)
+#define FICL_WANT_SOFTWORDS 1
+#endif
+
+/*
+** FICL_MULTITHREAD enables dictionary mutual exclusion
+** wia the ficlLockDictionary system dependent function.
+** Note: this implementation is experimental and poorly
+** tested. Further, it's unnecessary unless you really
+** intend to have multiple SESSIONS (poor choice of name
+** on my part) - that is, threads that modify the dictionary
+** at the same time.
+*/
+#if !defined FICL_MULTITHREAD
+#define FICL_MULTITHREAD 0
+#endif
+
+/*
+** PORTABLE_LONGMULDIV causes ficlLongMul and ficlLongDiv to be
+** defined in C in sysdep.c. Use this if you cannot easily
+** generate an inline asm definition
+*/
+#if !defined (PORTABLE_LONGMULDIV)
+#define PORTABLE_LONGMULDIV 0
+#endif
+
+/*
+** INLINE_INNER_LOOP causes the inner interpreter to be inline code
+** instead of a function call. This is mainly because MS VC++ 5
+** chokes with an internal compiler error on the function version.
+** in release mode. Sheesh.
+*/
+#if !defined INLINE_INNER_LOOP
+#if defined _DEBUG
+#define INLINE_INNER_LOOP 0
+#else
+#define INLINE_INNER_LOOP 1
+#endif
+#endif
+
+/*
+** FICL_ROBUST enables bounds checking of stacks and the dictionary.
+** This will detect stack over and underflows and dictionary overflows.
+** Any exceptional condition will result in an assertion failure.
+** (As generated by the ANSI assert macro)
+** FICL_ROBUST == 1 --> stack checking in the outer interpreter
+** FICL_ROBUST == 2 also enables checking in many primitives
+*/
+
+#if !defined FICL_ROBUST
+#define FICL_ROBUST 2
+#endif
+
+/*
+** FICL_DEFAULT_STACK Specifies the default size (in CELLs) of
+** a new virtual machine's stacks, unless overridden at
+** create time.
+*/
+#if !defined FICL_DEFAULT_STACK
+#define FICL_DEFAULT_STACK 128
+#endif
+
+/*
+** FICL_DEFAULT_DICT specifies the number of CELLs to allocate
+** for the system dictionary by default. The value
+** can be overridden at startup time as well.
+** FICL_DEFAULT_ENV specifies the number of cells to allot
+** for the environment-query dictionary.
+*/
+#if !defined FICL_DEFAULT_DICT
+#define FICL_DEFAULT_DICT 12288
+#endif
+
+#if !defined FICL_DEFAULT_ENV
+#define FICL_DEFAULT_ENV 260
+#endif
+
+/*
+** FICL_DEFAULT_VOCS specifies the maximum number of wordlists in
+** the dictionary search order. See Forth DPANS sec 16.3.3
+** (file://dpans16.htm#16.3.3)
+*/
+#if !defined FICL_DEFAULT_VOCS
+#define FICL_DEFAULT_VOCS 16
+#endif
+
+/*
+** FICL_MAX_PARSE_STEPS controls the size of an array in the FICL_SYSTEM structure
+** that stores pointers to parser extension functions. I would never expect to have
+** more than 8 of these, so that's the default limit. Too many of these functions
+** will probably exact a nasty performance penalty.
+*/
+#if !defined FICL_MAX_PARSE_STEPS
+#define FICL_MAX_PARSE_STEPS 8
+#endif
+
+/*
+** FICL_EXTENDED_PREFIX enables a bunch of extra prefixes in prefix.c and prefix.fr (if
+** included as part of softcore.c)
+*/
+#if !defined FICL_EXTENDED_PREFIX
+#define FICL_EXTENDED_PREFIX 0
+#endif
+
+/*
+** FICL_ALIGN is the power of two to which the dictionary
+** pointer address must be aligned. This value is usually
+** either 1 or 2, depending on the memory architecture
+** of the target system; 2 is safe on any 16 or 32 bit
+** machine. 3 would be appropriate for a 64 bit machine.
+*/
+#if !defined FICL_ALIGN
+#define FICL_ALIGN 2
+#define FICL_ALIGN_ADD ((1 << FICL_ALIGN) - 1)
+#endif
+
+/*
+** System dependent routines --
+** edit the implementations in sysdep.c to be compatible
+** with your runtime environment...
+** ficlTextOut sends a NULL terminated string to the
+** default output device - used for system error messages
+** ficlMalloc and ficlFree have the same semantics as malloc and free
+** in standard C
+** ficlLongMul multiplies two UNS32s and returns a 64 bit unsigned
+** product
+** ficlLongDiv divides an UNS64 by an UNS32 and returns UNS32 quotient
+** and remainder
+*/
+struct vm;
+void ficlTextOut(struct vm *pVM, char *msg, int fNewline);
+void *ficlMalloc (size_t size);
+void ficlFree (void *p);
+void *ficlRealloc(void *p, size_t size);
+/*
+** Stub function for dictionary access control - does nothing
+** by default, user can redefine to guarantee exclusive dict
+** access to a single thread for updates. All dict update code
+** must be bracketed as follows:
+** ficlLockDictionary(TRUE);
+** <code that updates dictionary>
+** ficlLockDictionary(FALSE);
+**
+** Returns zero if successful, nonzero if unable to acquire lock
+** before timeout (optional - could also block forever)
+**
+** NOTE: this function must be implemented with lock counting
+** semantics: nested calls must behave properly.
+*/
+#if FICL_MULTITHREAD
+int ficlLockDictionary(short fLock);
+#else
+#define ficlLockDictionary(x) 0 /* ignore */
+#endif
+
+/*
+** 64 bit integer math support routines: multiply two UNS32s
+** to get a 64 bit product, & divide the product by an UNS32
+** to get an UNS32 quotient and remainder. Much easier in asm
+** on a 32 bit CPU than in C, which usually doesn't support
+** the double length result (but it should).
+*/
+DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y);
+UNSQR ficlLongDiv(DPUNS q, FICL_UNS y);
+
+/*
+** FICL_HAVE_FTRUNCATE indicates whether the current OS supports
+** the ftruncate() function (available on most UNIXes). This
+** function is necessary to provide the complete File-Access wordset.
+*/
+#if !defined (FICL_HAVE_FTRUNCATE)
+#define FICL_HAVE_FTRUNCATE 0
+#endif
+
+
+#endif /*__SYSDEP_H__*/
Property changes on: trunk/sys/boot/ficl/powerpc/sysdep.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/sys/boot/ficl/prefix.c
===================================================================
--- trunk/sys/boot/ficl/prefix.c 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/prefix.c 2018-06-02 00:05:49 UTC (rev 10203)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*******************************************************************
** p r e f i x . c
** Forth Inspired Command Language
@@ -4,7 +5,7 @@
** Parser extensions for Ficl
** Authors: Larry Hastings & John Sadler (john_sadler at alum.mit.edu)
** Created: April 2001
-** $Id: prefix.c,v 1.2 2012-12-29 04:58:20 laffer1 Exp $
+** $Id: prefix.c,v 1.6 2001/12/05 07:21:34 jsadler Exp $
*******************************************************************/
/*
** Copyright (c) 1997-2001 John Sadler (john_sadler at alum.mit.edu)
@@ -41,7 +42,7 @@
** SUCH DAMAGE.
*/
-/* $MidnightBSD$ */
+/* $FreeBSD: stable/10/sys/boot/ficl/prefix.c 102657 2002-08-31 01:04:53Z scottl $ */
#include <string.h>
#include <ctype.h>
Modified: trunk/sys/boot/ficl/search.c
===================================================================
--- trunk/sys/boot/ficl/search.c 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/search.c 2018-06-02 00:05:49 UTC (rev 10203)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*******************************************************************
** s e a r c h . c
** Forth Inspired Command Language
@@ -4,7 +5,7 @@
** ANS Forth SEARCH and SEARCH-EXT word-set written in C
** Author: John Sadler (john_sadler at alum.mit.edu)
** Created: 6 June 2000
-** $Id: search.c,v 1.2 2012-12-29 04:58:20 laffer1 Exp $
+** $Id: search.c,v 1.9 2001/12/05 07:21:34 jsadler Exp $
*******************************************************************/
/*
** Copyright (c) 1997-2001 John Sadler (john_sadler at alum.mit.edu)
@@ -41,7 +42,7 @@
** SUCH DAMAGE.
*/
-/* $MidnightBSD$ */
+/* $FreeBSD: stable/10/sys/boot/ficl/search.c 94290 2002-04-09 17:45:28Z dcs $ */
#include <string.h>
#include "ficl.h"
Modified: trunk/sys/boot/ficl/softwords/classes.fr
===================================================================
--- trunk/sys/boot/ficl/softwords/classes.fr 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/softwords/classes.fr 2018-06-02 00:05:49 UTC (rev 10203)
@@ -4,7 +4,7 @@
\ john sadler 1 sep 98
\ Needs oop.fr
\
-\ $MidnightBSD$
+\ $FreeBSD: stable/10/sys/boot/ficl/softwords/classes.fr 76116 2001-04-29 02:36:36Z dcs $
also oop definitions
Property changes on: trunk/sys/boot/ficl/softwords/classes.fr
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/boot/ficl/softwords/ficlclass.fr
===================================================================
--- trunk/sys/boot/ficl/softwords/ficlclass.fr 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/softwords/ficlclass.fr 2018-06-02 00:05:49 UTC (rev 10203)
@@ -7,7 +7,7 @@
\ ** C - W O R D
\ Models a FICL_WORD
\
-\ $MidnightBSD$
+\ $FreeBSD: stable/10/sys/boot/ficl/softwords/ficlclass.fr 94290 2002-04-09 17:45:28Z dcs $
object subclass c-word
c-word ref: .link
Property changes on: trunk/sys/boot/ficl/softwords/ficlclass.fr
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/boot/ficl/softwords/ficllocal.fr
===================================================================
--- trunk/sys/boot/ficl/softwords/ficllocal.fr 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/softwords/ficllocal.fr 2018-06-02 00:05:49 UTC (rev 10203)
@@ -7,7 +7,7 @@
\ locstate: 0 = looking for -- or }}
\ 1 = found --
\
-\ $MidnightBSD$
+\ $FreeBSD: stable/10/sys/boot/ficl/softwords/ficllocal.fr 51786 1999-09-29 04:43:16Z dcs $
hide
0 constant zero
Property changes on: trunk/sys/boot/ficl/softwords/ficllocal.fr
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/boot/ficl/softwords/fileaccess.fr
===================================================================
--- trunk/sys/boot/ficl/softwords/fileaccess.fr 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/softwords/fileaccess.fr 2018-06-02 00:05:49 UTC (rev 10203)
@@ -4,7 +4,7 @@
\ ** submitted by Larry Hastings, larry at hastings.org
\ **
\
-\ $MidnightBSD$
+\ $FreeBSD: stable/10/sys/boot/ficl/softwords/fileaccess.fr 167850 2007-03-23 22:26:01Z jkim $
: r/o 1 ;
: r/w 3 ;
Property changes on: trunk/sys/boot/ficl/softwords/fileaccess.fr
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/boot/ficl/softwords/forml.fr
===================================================================
--- trunk/sys/boot/ficl/softwords/forml.fr 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/softwords/forml.fr 2018-06-02 00:05:49 UTC (rev 10203)
@@ -1,7 +1,7 @@
\ examples from FORML conference paper Nov 98
\ sadler
\
-\ $MidnightBSD$
+\ $FreeBSD: stable/10/sys/boot/ficl/softwords/forml.fr 94290 2002-04-09 17:45:28Z dcs $
.( loading FORML examples ) cr
object --> sub c-example
Property changes on: trunk/sys/boot/ficl/softwords/forml.fr
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/boot/ficl/softwords/freebsd.fr
===================================================================
--- trunk/sys/boot/ficl/softwords/freebsd.fr 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/softwords/freebsd.fr 2018-06-02 00:05:49 UTC (rev 10203)
@@ -22,7 +22,7 @@
\ ** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
\ ** SUCH DAMAGE.
\ **
-\ ** $MidnightBSD$
+\ ** $FreeBSD: stable/10/sys/boot/ficl/softwords/freebsd.fr 50477 1999-08-28 01:08:13Z peter $
\ Words for use in scripts:
\ % ignore errors here
Property changes on: trunk/sys/boot/ficl/softwords/freebsd.fr
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/boot/ficl/softwords/ifbrack.fr
===================================================================
--- trunk/sys/boot/ficl/softwords/ifbrack.fr 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/softwords/ifbrack.fr 2018-06-02 00:05:49 UTC (rev 10203)
@@ -2,7 +2,7 @@
\ ** ANS conditional compile directives [if] [else] [then]
\ ** Requires ficl 2.0 or greater...
\
-\ $MidnightBSD$
+\ $FreeBSD: stable/10/sys/boot/ficl/softwords/ifbrack.fr 94290 2002-04-09 17:45:28Z dcs $
hide
Property changes on: trunk/sys/boot/ficl/softwords/ifbrack.fr
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/boot/ficl/softwords/jhlocal.fr
===================================================================
--- trunk/sys/boot/ficl/softwords/jhlocal.fr 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/softwords/jhlocal.fr 2018-06-02 00:05:49 UTC (rev 10203)
@@ -14,7 +14,7 @@
\
\ revised 2 June 2000 - { | a -- } now works correctly
\
-\ $MidnightBSD$
+\ $FreeBSD: stable/10/sys/boot/ficl/softwords/jhlocal.fr 167850 2007-03-23 22:26:01Z jkim $
hide
Property changes on: trunk/sys/boot/ficl/softwords/jhlocal.fr
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/boot/ficl/softwords/marker.fr
===================================================================
--- trunk/sys/boot/ficl/softwords/marker.fr 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/softwords/marker.fr 2018-06-02 00:05:49 UTC (rev 10203)
@@ -3,7 +3,7 @@
\ John Sadler, 4 Oct 98
\ Requires ficl 2.02 FORGET-WID !!
\
-\ $MidnightBSD$
+\ $FreeBSD: stable/10/sys/boot/ficl/softwords/marker.fr 94290 2002-04-09 17:45:28Z dcs $
: marker ( "name" -- )
create
Property changes on: trunk/sys/boot/ficl/softwords/marker.fr
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/boot/ficl/softwords/oo.fr
===================================================================
--- trunk/sys/boot/ficl/softwords/oo.fr 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/softwords/oo.fr 2018-06-02 00:05:49 UTC (rev 10203)
@@ -3,7 +3,7 @@
\ ** F I C L O - O E X T E N S I O N S
\ ** john sadler aug 1998
\
-\ $MidnightBSD$
+\ $FreeBSD: stable/10/sys/boot/ficl/softwords/oo.fr 167850 2007-03-23 22:26:01Z jkim $
17 ficl-vocabulary oop
also oop definitions
Property changes on: trunk/sys/boot/ficl/softwords/oo.fr
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/boot/ficl/softwords/prefix.fr
===================================================================
--- trunk/sys/boot/ficl/softwords/prefix.fr 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/softwords/prefix.fr 2018-06-02 00:05:49 UTC (rev 10203)
@@ -5,7 +5,7 @@
\ (jws) To make a prefix, simply create a new definition in the <prefixes>
\ wordlist. start-prefixes and end-prefixes handle the bookkeeping
\
-\ $MidnightBSD$
+\ $FreeBSD: stable/10/sys/boot/ficl/softwords/prefix.fr 167850 2007-03-23 22:26:01Z jkim $
variable save-current
Property changes on: trunk/sys/boot/ficl/softwords/prefix.fr
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/boot/ficl/softwords/softcore.awk
===================================================================
--- trunk/sys/boot/ficl/softwords/softcore.awk 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/softwords/softcore.awk 2018-06-02 00:05:49 UTC (rev 10203)
@@ -10,7 +10,7 @@
# Note! This script uses strftime() which is a gawk-ism, and the
# POSIX [[:space:]] character class.
#
-# $MidnightBSD$
+# $FreeBSD: stable/10/sys/boot/ficl/softwords/softcore.awk 167850 2007-03-23 22:26:01Z jkim $
BEGIN \
{
Property changes on: trunk/sys/boot/ficl/softwords/softcore.awk
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/boot/ficl/softwords/softcore.fr
===================================================================
--- trunk/sys/boot/ficl/softwords/softcore.fr 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/softwords/softcore.fr 2018-06-02 00:05:49 UTC (rev 10203)
@@ -3,7 +3,7 @@
\ ** John Sadler (john_sadler at alum.mit.edu)
\ ** September, 1998
\
-\ $MidnightBSD$
+\ $FreeBSD: stable/10/sys/boot/ficl/softwords/softcore.fr 94290 2002-04-09 17:45:28Z dcs $
\ ** Ficl USER variables
\ ** See words.c for primitive def'n of USER
Property changes on: trunk/sys/boot/ficl/softwords/softcore.fr
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/boot/ficl/softwords/string.fr
===================================================================
--- trunk/sys/boot/ficl/softwords/string.fr 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/softwords/string.fr 2018-06-02 00:05:49 UTC (rev 10203)
@@ -11,7 +11,7 @@
\ s" woof woof woof " str --> cat
\ str --> type cr
\
-\ $MidnightBSD$
+\ $FreeBSD: stable/10/sys/boot/ficl/softwords/string.fr 76116 2001-04-29 02:36:36Z dcs $
also oop definitions
Property changes on: trunk/sys/boot/ficl/softwords/string.fr
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: trunk/sys/boot/ficl/sparc64/sysdep.c
===================================================================
--- trunk/sys/boot/ficl/sparc64/sysdep.c (rev 0)
+++ trunk/sys/boot/ficl/sparc64/sysdep.c 2018-06-02 00:05:49 UTC (rev 10203)
@@ -0,0 +1,102 @@
+/* $MidnightBSD$ */
+/*******************************************************************
+** s y s d e p . c
+** Forth Inspired Command Language
+** Author: John Sadler (john_sadler at alum.mit.edu)
+** Created: 16 Oct 1997
+** Implementations of FICL external interface functions...
+**
+*******************************************************************/
+
+/* $FreeBSD: stable/10/sys/boot/ficl/sparc64/sysdep.c 96962 2002-05-19 23:20:56Z jake $ */
+
+#ifdef TESTMAIN
+#include <stdio.h>
+#include <stdlib.h>
+#else
+#include <stand.h>
+#endif
+#include "ficl.h"
+
+/*
+******************* FreeBSD P O R T B E G I N S H E R E ******************** Michael Smith
+*/
+
+#if PORTABLE_LONGMULDIV == 0
+DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y)
+{
+ DPUNS q;
+ u_int64_t qx;
+
+ qx = (u_int64_t)x * (u_int64_t) y;
+
+ q.hi = (u_int32_t)( qx >> 32 );
+ q.lo = (u_int32_t)( qx & 0xFFFFFFFFL);
+
+ return q;
+}
+
+UNSQR ficlLongDiv(DPUNS q, FICL_UNS y)
+{
+ UNSQR result;
+ u_int64_t qx, qh;
+
+ qh = q.hi;
+ qx = (qh << 32) | q.lo;
+
+ result.quot = qx / y;
+ result.rem = qx % y;
+
+ return result;
+}
+#endif
+
+void ficlTextOut(FICL_VM *pVM, char *msg, int fNewline)
+{
+ IGNORE(pVM);
+
+ while(*msg != 0)
+ putchar(*(msg++));
+ if (fNewline)
+ putchar('\n');
+
+ return;
+}
+
+void *ficlMalloc (size_t size)
+{
+ return malloc(size);
+}
+
+void *ficlRealloc (void *p, size_t size)
+{
+ return realloc(p, size);
+}
+
+void ficlFree (void *p)
+{
+ free(p);
+}
+
+
+/*
+** Stub function for dictionary access control - does nothing
+** by default, user can redefine to guarantee exclusive dict
+** access to a single thread for updates. All dict update code
+** is guaranteed to be bracketed as follows:
+** ficlLockDictionary(TRUE);
+** <code that updates dictionary>
+** ficlLockDictionary(FALSE);
+**
+** Returns zero if successful, nonzero if unable to acquire lock
+** befor timeout (optional - could also block forever)
+*/
+#if FICL_MULTITHREAD
+int ficlLockDictionary(short fLock)
+{
+ IGNORE(fLock);
+ return 0;
+}
+#endif /* FICL_MULTITHREAD */
+
+
Property changes on: trunk/sys/boot/ficl/sparc64/sysdep.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/sys/boot/ficl/sparc64/sysdep.h
===================================================================
--- trunk/sys/boot/ficl/sparc64/sysdep.h (rev 0)
+++ trunk/sys/boot/ficl/sparc64/sysdep.h 2018-06-02 00:05:49 UTC (rev 10203)
@@ -0,0 +1,413 @@
+/* $MidnightBSD$ */
+/*******************************************************************
+ s y s d e p . h
+** Forth Inspired Command Language
+** Author: John Sadler (john_sadler at alum.mit.edu)
+** Created: 16 Oct 1997
+** Ficl system dependent types and prototypes...
+**
+** Note: Ficl also depends on the use of "assert" when
+** FICL_ROBUST is enabled. This may require some consideration
+** in firmware systems since assert often
+** assumes stderr/stdout.
+** $Id: sysdep.h,v 1.6 2001-04-26 21:41:55-07 jsadler Exp jsadler $
+*******************************************************************/
+/*
+** Copyright (c) 1997-2001 John Sadler (john_sadler at alum.mit.edu)
+** All rights reserved.
+**
+** Get the latest Ficl release at http://ficl.sourceforge.net
+**
+** L I C E N S E and D I S C L A I M E R
+**
+** Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions
+** are met:
+** 1. Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** 2. Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in the
+** documentation and/or other materials provided with the distribution.
+**
+** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+** ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+** OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+** SUCH DAMAGE.
+**
+** I am interested in hearing from anyone who uses ficl. If you have
+** a problem, a success story, a defect, an enhancement request, or
+** if you would like to contribute to the ficl release, please send
+** contact me by email at the address above.
+**
+** $Id: sysdep.h,v 1.6 2001-04-26 21:41:55-07 jsadler Exp jsadler $
+*/
+
+/* $FreeBSD: stable/10/sys/boot/ficl/sparc64/sysdep.h 96962 2002-05-19 23:20:56Z jake $ */
+
+#if !defined (__SYSDEP_H__)
+#define __SYSDEP_H__
+
+#include <sys/types.h>
+
+#include <stddef.h> /* size_t, NULL */
+#include <setjmp.h>
+#include <assert.h>
+
+#if !defined IGNORE /* Macro to silence unused param warnings */
+#define IGNORE(x) &x
+#endif
+
+/*
+** TRUE and FALSE for C boolean operations, and
+** portable 32 bit types for CELLs
+**
+*/
+#if !defined TRUE
+#define TRUE 1
+#endif
+#if !defined FALSE
+#define FALSE 0
+#endif
+
+
+/*
+** System dependent data type declarations...
+*/
+#if !defined INT32
+#define INT32 int
+#endif
+
+#if !defined UNS32
+#define UNS32 unsigned int
+#endif
+
+#if !defined UNS16
+#define UNS16 unsigned short
+#endif
+
+#if !defined UNS8
+#define UNS8 unsigned char
+#endif
+
+#if !defined NULL
+#define NULL ((void *)0)
+#endif
+
+/*
+** FICL_UNS and FICL_INT must have the same size as a void* on
+** the target system. A CELL is a union of void*, FICL_UNS, and
+** FICL_INT.
+** (11/2000: same for FICL_FLOAT)
+*/
+#if !defined FICL_INT
+#define FICL_INT long
+#endif
+
+#if !defined FICL_UNS
+#define FICL_UNS unsigned long
+#endif
+
+#if !defined FICL_FLOAT
+#define FICL_FLOAT float
+#endif
+
+/*
+** Ficl presently supports values of 32 and 64 for BITS_PER_CELL
+*/
+#if !defined BITS_PER_CELL
+#define BITS_PER_CELL 64
+#endif
+
+#if ((BITS_PER_CELL != 32) && (BITS_PER_CELL != 64))
+ Error!
+#endif
+
+typedef struct
+{
+ FICL_UNS hi;
+ FICL_UNS lo;
+} DPUNS;
+
+typedef struct
+{
+ FICL_UNS quot;
+ FICL_UNS rem;
+} UNSQR;
+
+typedef struct
+{
+ FICL_INT hi;
+ FICL_INT lo;
+} DPINT;
+
+typedef struct
+{
+ FICL_INT quot;
+ FICL_INT rem;
+} INTQR;
+
+
+/*
+** B U I L D C O N T R O L S
+*/
+
+#if !defined (FICL_MINIMAL)
+#define FICL_MINIMAL 0
+#endif
+#if (FICL_MINIMAL)
+#define FICL_WANT_SOFTWORDS 0
+#define FICL_WANT_FLOAT 0
+#define FICL_WANT_USER 0
+#define FICL_WANT_LOCALS 0
+#define FICL_WANT_DEBUGGER 0
+#define FICL_WANT_OOP 0
+#define FICL_PLATFORM_EXTEND 0
+#define FICL_MULTITHREAD 0
+#define FICL_ROBUST 0
+#define FICL_EXTENDED_PREFIX 0
+#endif
+
+/*
+** FICL_PLATFORM_EXTEND
+** Includes words defined in ficlCompilePlatform
+*/
+#if !defined (FICL_PLATFORM_EXTEND)
+#define FICL_PLATFORM_EXTEND 1
+#endif
+
+/*
+** FICL_WANT_FLOAT
+** Includes a floating point stack for the VM, and words to do float operations.
+** Contributed by Guy Carver
+*/
+#if !defined (FICL_WANT_FLOAT)
+#define FICL_WANT_FLOAT 0
+#endif
+
+/*
+** FICL_WANT_DEBUGGER
+** Inludes a simple source level debugger
+*/
+#if !defined (FICL_WANT_DEBUGGER)
+#define FICL_WANT_DEBUGGER 1
+#endif
+
+/*
+** User variables: per-instance variables bound to the VM.
+** Kinda like thread-local storage. Could be implemented in a
+** VM private dictionary, but I've chosen the lower overhead
+** approach of an array of CELLs instead.
+*/
+#if !defined FICL_WANT_USER
+#define FICL_WANT_USER 1
+#endif
+
+#if !defined FICL_USER_CELLS
+#define FICL_USER_CELLS 16
+#endif
+
+/*
+** FICL_WANT_LOCALS controls the creation of the LOCALS wordset and
+** a private dictionary for local variable compilation.
+*/
+#if !defined FICL_WANT_LOCALS
+#define FICL_WANT_LOCALS 1
+#endif
+
+/* Max number of local variables per definition */
+#if !defined FICL_MAX_LOCALS
+#define FICL_MAX_LOCALS 16
+#endif
+
+/*
+** FICL_WANT_OOP
+** Inludes object oriented programming support (in softwords)
+** OOP support requires locals and user variables!
+*/
+#if !(FICL_WANT_LOCALS) || !(FICL_WANT_USER)
+#if !defined (FICL_WANT_OOP)
+#define FICL_WANT_OOP 0
+#endif
+#endif
+
+#if !defined (FICL_WANT_OOP)
+#define FICL_WANT_OOP 1
+#endif
+
+/*
+** FICL_WANT_SOFTWORDS
+** Controls inclusion of all softwords in softcore.c
+*/
+#if !defined (FICL_WANT_SOFTWORDS)
+#define FICL_WANT_SOFTWORDS 1
+#endif
+
+/*
+** FICL_MULTITHREAD enables dictionary mutual exclusion
+** wia the ficlLockDictionary system dependent function.
+** Note: this implementation is experimental and poorly
+** tested. Further, it's unnecessary unless you really
+** intend to have multiple SESSIONS (poor choice of name
+** on my part) - that is, threads that modify the dictionary
+** at the same time.
+*/
+#if !defined FICL_MULTITHREAD
+#define FICL_MULTITHREAD 0
+#endif
+
+/*
+** PORTABLE_LONGMULDIV causes ficlLongMul and ficlLongDiv to be
+** defined in C in sysdep.c. Use this if you cannot easily
+** generate an inline asm definition
+*/
+#if !defined (PORTABLE_LONGMULDIV)
+#define PORTABLE_LONGMULDIV 0
+#endif
+
+/*
+** INLINE_INNER_LOOP causes the inner interpreter to be inline code
+** instead of a function call. This is mainly because MS VC++ 5
+** chokes with an internal compiler error on the function version.
+** in release mode. Sheesh.
+*/
+#if !defined INLINE_INNER_LOOP
+#if defined _DEBUG
+#define INLINE_INNER_LOOP 0
+#else
+#define INLINE_INNER_LOOP 1
+#endif
+#endif
+
+/*
+** FICL_ROBUST enables bounds checking of stacks and the dictionary.
+** This will detect stack over and underflows and dictionary overflows.
+** Any exceptional condition will result in an assertion failure.
+** (As generated by the ANSI assert macro)
+** FICL_ROBUST == 1 --> stack checking in the outer interpreter
+** FICL_ROBUST == 2 also enables checking in many primitives
+*/
+
+#if !defined FICL_ROBUST
+#define FICL_ROBUST 2
+#endif
+
+/*
+** FICL_DEFAULT_STACK Specifies the default size (in CELLs) of
+** a new virtual machine's stacks, unless overridden at
+** create time.
+*/
+#if !defined FICL_DEFAULT_STACK
+#define FICL_DEFAULT_STACK 128
+#endif
+
+/*
+** FICL_DEFAULT_DICT specifies the number of CELLs to allocate
+** for the system dictionary by default. The value
+** can be overridden at startup time as well.
+** FICL_DEFAULT_ENV specifies the number of cells to allot
+** for the environment-query dictionary.
+*/
+#if !defined FICL_DEFAULT_DICT
+#define FICL_DEFAULT_DICT 12288
+#endif
+
+#if !defined FICL_DEFAULT_ENV
+#define FICL_DEFAULT_ENV 260
+#endif
+
+/*
+** FICL_DEFAULT_VOCS specifies the maximum number of wordlists in
+** the dictionary search order. See Forth DPANS sec 16.3.3
+** (file://dpans16.htm#16.3.3)
+*/
+#if !defined FICL_DEFAULT_VOCS
+#define FICL_DEFAULT_VOCS 16
+#endif
+
+/*
+** FICL_MAX_PARSE_STEPS controls the size of an array in the FICL_SYSTEM structure
+** that stores pointers to parser extension functions. I would never expect to have
+** more than 8 of these, so that's the default limit. Too many of these functions
+** will probably exact a nasty performance penalty.
+*/
+#if !defined FICL_MAX_PARSE_STEPS
+#define FICL_MAX_PARSE_STEPS 8
+#endif
+
+/*
+** FICL_EXTENDED_PREFIX enables a bunch of extra prefixes in prefix.c and prefix.fr (if
+** included as part of softcore.c)
+*/
+#if !defined FICL_EXTENDED_PREFIX
+#define FICL_EXTENDED_PREFIX 0
+#endif
+
+/*
+** FICL_ALIGN is the power of two to which the dictionary
+** pointer address must be aligned. This value is usually
+** either 1 or 2, depending on the memory architecture
+** of the target system; 2 is safe on any 16 or 32 bit
+** machine. 3 would be appropriate for a 64 bit machine.
+*/
+#if !defined FICL_ALIGN
+#define FICL_ALIGN 3
+#define FICL_ALIGN_ADD ((1 << FICL_ALIGN) - 1)
+#endif
+
+/*
+** System dependent routines --
+** edit the implementations in sysdep.c to be compatible
+** with your runtime environment...
+** ficlTextOut sends a NULL terminated string to the
+** default output device - used for system error messages
+** ficlMalloc and ficlFree have the same semantics as malloc and free
+** in standard C
+** ficlLongMul multiplies two UNS32s and returns a 64 bit unsigned
+** product
+** ficlLongDiv divides an UNS64 by an UNS32 and returns UNS32 quotient
+** and remainder
+*/
+struct vm;
+void ficlTextOut(struct vm *pVM, char *msg, int fNewline);
+void *ficlMalloc (size_t size);
+void ficlFree (void *p);
+void *ficlRealloc(void *p, size_t size);
+/*
+** Stub function for dictionary access control - does nothing
+** by default, user can redefine to guarantee exclusive dict
+** access to a single thread for updates. All dict update code
+** must be bracketed as follows:
+** ficlLockDictionary(TRUE);
+** <code that updates dictionary>
+** ficlLockDictionary(FALSE);
+**
+** Returns zero if successful, nonzero if unable to acquire lock
+** before timeout (optional - could also block forever)
+**
+** NOTE: this function must be implemented with lock counting
+** semantics: nested calls must behave properly.
+*/
+#if FICL_MULTITHREAD
+int ficlLockDictionary(short fLock);
+#else
+#define ficlLockDictionary(x) 0 /* ignore */
+#endif
+
+/*
+** 64 bit integer math support routines: multiply two UNS32s
+** to get a 64 bit product, & divide the product by an UNS32
+** to get an UNS32 quotient and remainder. Much easier in asm
+** on a 32 bit CPU than in C, which usually doesn't support
+** the double length result (but it should).
+*/
+DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y);
+UNSQR ficlLongDiv(DPUNS q, FICL_UNS y);
+
+#endif /*__SYSDEP_H__*/
Property changes on: trunk/sys/boot/ficl/sparc64/sysdep.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/sys/boot/ficl/stack.c
===================================================================
--- trunk/sys/boot/ficl/stack.c 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/stack.c 2018-06-02 00:05:49 UTC (rev 10203)
@@ -1,9 +1,10 @@
+/* $MidnightBSD$ */
/*******************************************************************
** s t a c k . c
** Forth Inspired Command Language
** Author: John Sadler (john_sadler at alum.mit.edu)
** Created: 16 Oct 1997
-** $Id: stack.c,v 1.2 2012-12-29 04:58:20 laffer1 Exp $
+** $Id: stack.c,v 1.10 2001/12/05 07:21:34 jsadler Exp $
*******************************************************************/
/*
** Copyright (c) 1997-2001 John Sadler (john_sadler at alum.mit.edu)
@@ -40,7 +41,7 @@
** SUCH DAMAGE.
*/
-/* $MidnightBSD$ */
+/* $FreeBSD: stable/10/sys/boot/ficl/stack.c 94290 2002-04-09 17:45:28Z dcs $ */
#ifdef TESTMAIN
#include <stdlib.h>
Modified: trunk/sys/boot/ficl/testmain.c
===================================================================
--- trunk/sys/boot/ficl/testmain.c 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/testmain.c 2018-06-02 00:05:49 UTC (rev 10203)
@@ -1,6 +1,7 @@
+/* $MidnightBSD$ */
/*
** stub main for testing FICL under userland
-** $Id: testmain.c,v 1.2 2012-12-29 04:58:20 laffer1 Exp $
+** $Id: testmain.c,v 1.13 2001/12/05 07:21:34 jsadler Exp $
*/
/*
** Copyright (c) 1997-2001 John Sadler (john_sadler at alum.mit.edu)
@@ -37,7 +38,7 @@
** SUCH DAMAGE.
*/
-/* $MidnightBSD$ */
+/* $FreeBSD: stable/10/sys/boot/ficl/testmain.c 94290 2002-04-09 17:45:28Z dcs $ */
#include <stdlib.h>
#include <stdio.h>
Modified: trunk/sys/boot/ficl/tools.c
===================================================================
--- trunk/sys/boot/ficl/tools.c 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/tools.c 2018-06-02 00:05:49 UTC (rev 10203)
@@ -1,9 +1,10 @@
+/* $MidnightBSD$ */
/*******************************************************************
** t o o l s . c
** Forth Inspired Command Language - programming tools
** Author: John Sadler (john_sadler at alum.mit.edu)
** Created: 20 June 2000
-** $Id: tools.c,v 1.3 2012-12-29 04:58:20 laffer1 Exp $
+** $Id: tools.c,v 1.11 2001/12/05 07:21:34 jsadler Exp $
*******************************************************************/
/*
** Copyright (c) 1997-2001 John Sadler (john_sadler at alum.mit.edu)
@@ -54,7 +55,7 @@
** Specify breakpoint default action
*/
-/* $MidnightBSD$ */
+/* $FreeBSD: stable/10/sys/boot/ficl/tools.c 271135 2014-09-04 21:01:10Z emaste $ */
#ifdef TESTMAIN
#include <stdlib.h>
@@ -201,7 +202,7 @@
*cp++ = '>';
else
*cp++ = ' ';
- cp += sprintf(cp, "%3d ", pc-param0);
+ cp += sprintf(cp, "%3d ", (int)(pc-param0));
if (isAFiclWord(pd, pFW))
{
@@ -216,10 +217,11 @@
{
FICL_WORD *pLit = (FICL_WORD *)c.p;
sprintf(cp, "%.*s ( %#lx literal )",
- pLit->nName, pLit->name, c.u);
+ pLit->nName, pLit->name, (unsigned long)c.u);
}
else
- sprintf(cp, "literal %ld (%#lx)", c.i, c.u);
+ sprintf(cp, "literal %ld (%#lx)",
+ (long)c.i, (unsigned long)c.u);
break;
case STRINGLIT:
{
@@ -238,40 +240,40 @@
case IF:
c = *++pc;
if (c.i > 0)
- sprintf(cp, "if / while (branch %d)", pc+c.i-param0);
+ sprintf(cp, "if / while (branch %d)", (int)(pc+c.i-param0));
else
- sprintf(cp, "until (branch %d)", pc+c.i-param0);
+ sprintf(cp, "until (branch %d)", (int)(pc+c.i-param0));
break;
case BRANCH:
c = *++pc;
if (c.i == 0)
- sprintf(cp, "repeat (branch %d)", pc+c.i-param0);
+ sprintf(cp, "repeat (branch %d)", (int)(pc+c.i-param0));
else if (c.i == 1)
- sprintf(cp, "else (branch %d)", pc+c.i-param0);
+ sprintf(cp, "else (branch %d)", (int)(pc+c.i-param0));
else
- sprintf(cp, "endof (branch %d)", pc+c.i-param0);
+ sprintf(cp, "endof (branch %d)", (int)(pc+c.i-param0));
break;
case OF:
c = *++pc;
- sprintf(cp, "of (branch %d)", pc+c.i-param0);
+ sprintf(cp, "of (branch %d)", (int)(pc+c.i-param0));
break;
case QDO:
c = *++pc;
- sprintf(cp, "?do (leave %d)", (CELL *)c.p-param0);
+ sprintf(cp, "?do (leave %d)", (int)((CELL *)c.p-param0));
break;
case DO:
c = *++pc;
- sprintf(cp, "do (leave %d)", (CELL *)c.p-param0);
+ sprintf(cp, "do (leave %d)", (int)((CELL *)c.p-param0));
break;
case LOOP:
c = *++pc;
- sprintf(cp, "loop (branch %d)", pc+c.i-param0);
+ sprintf(cp, "loop (branch %d)", (int)(pc+c.i-param0));
break;
case PLOOP:
c = *++pc;
- sprintf(cp, "+loop (branch %d)", pc+c.i-param0);
+ sprintf(cp, "+loop (branch %d)", (int)(pc+c.i-param0));
break;
default:
sprintf(cp, "%.*s", pFW->nName, pFW->name);
@@ -281,7 +283,7 @@
}
else /* probably not a word - punt and print value */
{
- sprintf(cp, "%ld ( %#lx )", pc->i, pc->u);
+ sprintf(cp, "%ld ( %#lx )", (long)pc->i, (unsigned long)pc->u);
}
vmTextOut(pVM, pVM->pad, 1);
@@ -324,19 +326,22 @@
break;
case VARIABLE:
- sprintf(pVM->pad, "variable = %ld (%#lx)", pFW->param->i, pFW->param->u);
+ sprintf(pVM->pad, "variable = %ld (%#lx)",
+ (long)pFW->param->i, (unsigned long)pFW->param->u);
vmTextOut(pVM, pVM->pad, 1);
break;
#if FICL_WANT_USER
case USER:
- sprintf(pVM->pad, "user variable %ld (%#lx)", pFW->param->i, pFW->param->u);
+ sprintf(pVM->pad, "user variable %ld (%#lx)",
+ (long)pFW->param->i, (unsigned long)pFW->param->u);
vmTextOut(pVM, pVM->pad, 1);
break;
#endif
case CONSTANT:
- sprintf(pVM->pad, "constant = %ld (%#lx)", pFW->param->i, pFW->param->u);
+ sprintf(pVM->pad, "constant = %ld (%#lx)",
+ (long)pFW->param->i, (unsigned long)pFW->param->u);
vmTextOut(pVM, pVM->pad, 1);
default:
Modified: trunk/sys/boot/ficl/unix.c
===================================================================
--- trunk/sys/boot/ficl/unix.c 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/unix.c 2018-06-02 00:05:49 UTC (rev 10203)
@@ -1,4 +1,5 @@
/* $MidnightBSD$ */
+/* $FreeBSD: stable/10/sys/boot/ficl/unix.c 167850 2007-03-23 22:26:01Z jkim $ */
#include <string.h>
#include <netinet/in.h>
Modified: trunk/sys/boot/ficl/vm.c
===================================================================
--- trunk/sys/boot/ficl/vm.c 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/vm.c 2018-06-02 00:05:49 UTC (rev 10203)
@@ -1,9 +1,10 @@
+/* $MidnightBSD$ */
/*******************************************************************
** v m . c
** Forth Inspired Command Language - virtual machine methods
** Author: John Sadler (john_sadler at alum.mit.edu)
** Created: 19 July 1997
-** $Id: vm.c,v 1.3 2012-12-29 04:58:20 laffer1 Exp $
+** $Id: vm.c,v 1.13 2001/12/05 07:21:34 jsadler Exp $
*******************************************************************/
/*
** This file implements the virtual machine of FICL. Each virtual
@@ -47,7 +48,7 @@
** SUCH DAMAGE.
*/
-/* $MidnightBSD$ */
+/* $FreeBSD: stable/10/sys/boot/ficl/vm.c 167850 2007-03-23 22:26:01Z jkim $ */
#ifdef TESTMAIN
#include <stdlib.h>
Modified: trunk/sys/boot/ficl/words.c
===================================================================
--- trunk/sys/boot/ficl/words.c 2018-06-02 00:02:57 UTC (rev 10202)
+++ trunk/sys/boot/ficl/words.c 2018-06-02 00:05:49 UTC (rev 10203)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*******************************************************************
** w o r d s . c
** Forth Inspired Command Language
@@ -4,7 +5,7 @@
** ANS Forth CORE word-set written in C
** Author: John Sadler (john_sadler at alum.mit.edu)
** Created: 19 July 1997
-** $Id: words.c,v 1.3 2012-12-29 04:58:20 laffer1 Exp $
+** $Id: words.c,v 1.17 2001/12/05 07:21:34 jsadler Exp $
*******************************************************************/
/*
** Copyright (c) 1997-2001 John Sadler (john_sadler at alum.mit.edu)
@@ -41,7 +42,7 @@
** SUCH DAMAGE.
*/
-/* $MidnightBSD$ */
+/* $FreeBSD: stable/10/sys/boot/ficl/words.c 271135 2014-09-04 21:01:10Z emaste $ */
#ifdef TESTMAIN
#include <stdlib.h>
@@ -2567,7 +2568,7 @@
static void isObject(FICL_VM *pVM)
{
- int flag;
+ FICL_INT flag;
FICL_WORD *pFW = (FICL_WORD *)stackPopPtr(pVM->pStack);
flag = ((pFW != NULL) && (pFW->flags & FW_ISOBJECT)) ? FICL_TRUE : FICL_FALSE;
More information about the Midnightbsd-cvs
mailing list