summaryrefslogtreecommitdiff
path: root/usr/src/lib/libficl
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/libficl')
-rw-r--r--usr/src/lib/libficl/Makefile48
-rw-r--r--usr/src/lib/libficl/Makefile.com63
-rw-r--r--usr/src/lib/libficl/amd64/Makefile19
-rw-r--r--usr/src/lib/libficl/ficllocal.h35
-rw-r--r--usr/src/lib/libficl/i386/Makefile18
-rw-r--r--usr/src/lib/libficl/llib-lficl-sys20
-rw-r--r--usr/src/lib/libficl/mapfile-vers204
-rw-r--r--usr/src/lib/libficl/softcore/Makefile46
-rw-r--r--usr/src/lib/libficl/sparc/Makefile18
-rw-r--r--usr/src/lib/libficl/sparcv9/Makefile19
10 files changed, 490 insertions, 0 deletions
diff --git a/usr/src/lib/libficl/Makefile b/usr/src/lib/libficl/Makefile
new file mode 100644
index 0000000000..c29321843f
--- /dev/null
+++ b/usr/src/lib/libficl/Makefile
@@ -0,0 +1,48 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2016 Toomas Soome <tsoome@me.com>
+#
+
+include ../Makefile.lib
+
+HDRS= ficllocal.h
+
+HDRDIR= $(SRC)/common/ficl
+
+SUBDIRS= softcore $(MACH)
+$(BUILD64)SUBDIRS += $(MACH64)
+
+all := TARGET= all
+clean := TARGET= clean
+clobber := TARGET= clobber
+install := TARGET= install
+
+.KEEP_STATE:
+
+all install: install_h $(SUBDIRS)
+
+clean clobber: $(SUBDIRS)
+
+install_h: $(PLATHDRDIR) $(ROOTHDRS)
+
+check: $(CHECKHDRS)
+
+$(SUBDIRS): FRC
+ @cd $@; pwd; $(MAKE) $(TARGET)
+
+$(ROOTHDRDIR)/%: ./%
+ $(INS.file)
+
+FRC:
+
+include $(SRC)/lib/Makefile.targ
diff --git a/usr/src/lib/libficl/Makefile.com b/usr/src/lib/libficl/Makefile.com
new file mode 100644
index 0000000000..a2c37d27c2
--- /dev/null
+++ b/usr/src/lib/libficl/Makefile.com
@@ -0,0 +1,63 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2016 Toomas Soome <tsoome@me.com>
+#
+
+LIBRARY=libficl-sys.a
+MAJOR = 4
+MINOR = 1.0
+VERS=.$(MAJOR).$(MINOR)
+
+OBJECTS= dictionary.o system.o fileaccess.o float.o double.o prefix.o search.o \
+ softcore.o stack.o tools.o vm.o primitives.o unix.o utility.o \
+ hash.o callback.o word.o loader.o pager.o extras.o \
+ loader_emu.o lz4.o
+
+include $(SRC)/lib/Makefile.lib
+
+LIBS= $(DYNLIB) $(LINTLIB)
+
+FICLDIR= $(SRC)/common/ficl
+C99MODE= $(C99_ENABLE)
+CPPFLAGS += -I.. -I$(FICLDIR) -D_LARGEFILE64_SOURCE=1
+
+LDLIBS += -lc -lm -lumem
+
+HEADERS= $(FICLDIR)/ficl.h $(FICLDIR)/ficltokens.h ../ficllocal.h \
+ $(FICLDIR)/ficlplatform/unix.h
+
+pics/%.o: ../softcore/%.c $(HEADERS)
+ $(COMPILE.c) -o $@ $<
+ $(POST_PROCESS_O)
+
+pics/%.o: $(FICLDIR)/%.c $(HEADERS)
+ $(COMPILE.c) -o $@ $<
+ $(POST_PROCESS_O)
+
+pics/%.o: $(FICLDIR)/ficlplatform/%.c $(HEADERS)
+ $(COMPILE.c) -o $@ $<
+ $(POST_PROCESS_O)
+
+pics/%.o: $(FICLDIR)/emu/%.c $(HEADERS)
+ $(COMPILE.c) -o $@ $<
+ $(POST_PROCESS_O)
+
+pics/%.o: $(FICLDIR)/softcore/%.c $(HEADERS)
+ $(COMPILE.c) -o $@ $<
+ $(POST_PROCESS_O)
+
+$(LINTLIB) := SRCS= ../$(LINTSRC)
+
+all: $(LIBS)
+
+include $(SRC)/lib/Makefile.targ
diff --git a/usr/src/lib/libficl/amd64/Makefile b/usr/src/lib/libficl/amd64/Makefile
new file mode 100644
index 0000000000..1cac1cfedd
--- /dev/null
+++ b/usr/src/lib/libficl/amd64/Makefile
@@ -0,0 +1,19 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2016 Toomas Soome <tsoome@me.com>
+#
+
+include ../Makefile.com
+include ../../Makefile.lib.64
+
+install: all $(ROOTLIBS64) $(ROOTLINKS64) $(ROOTLINT64)
diff --git a/usr/src/lib/libficl/ficllocal.h b/usr/src/lib/libficl/ficllocal.h
new file mode 100644
index 0000000000..a5449464d2
--- /dev/null
+++ b/usr/src/lib/libficl/ficllocal.h
@@ -0,0 +1,35 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2016 Toomas Soome <tsoome@me.com>
+ */
+
+#ifndef _FICLLOCAL_H
+#define _FICLLOCAL_H
+
+/*
+ * ficllocal.h
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Put all local settings here. This file will always ship empty.
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _FICLLOCAL_H */
diff --git a/usr/src/lib/libficl/i386/Makefile b/usr/src/lib/libficl/i386/Makefile
new file mode 100644
index 0000000000..ae94623a64
--- /dev/null
+++ b/usr/src/lib/libficl/i386/Makefile
@@ -0,0 +1,18 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2016 Toomas Soome <tsoome@me.com>
+#
+
+include ../Makefile.com
+
+install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
diff --git a/usr/src/lib/libficl/llib-lficl-sys b/usr/src/lib/libficl/llib-lficl-sys
new file mode 100644
index 0000000000..77d9e45d72
--- /dev/null
+++ b/usr/src/lib/libficl/llib-lficl-sys
@@ -0,0 +1,20 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2016 Toomas Soome <tsoome@me.com>
+ */
+
+/*LINTLIBRARY*/
+/*PROTOLIB1*/
+
+#include <ficl.h>
+#include <ficlplatform/emu.h>
diff --git a/usr/src/lib/libficl/mapfile-vers b/usr/src/lib/libficl/mapfile-vers
new file mode 100644
index 0000000000..acb556e223
--- /dev/null
+++ b/usr/src/lib/libficl/mapfile-vers
@@ -0,0 +1,204 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2016, Toomas Soome <tsoome@me.com>
+#
+
+#
+# MAPFILE HEADER START
+#
+# WARNING: STOP NOW. DO NOT MODIFY THIS FILE.
+# Object versioning must comply with the rules detailed in
+#
+# usr/src/lib/README.mapfiles
+#
+# You should not be making modifications here until you've read the most current
+# copy of that file. If you need help, contact a gatekeeper for guidance.
+#
+# MAPFILE HEADER END
+#
+
+# NOTE: libficl should be kept in sync with interfaces used in standalone
+# ficl in loader, so we can use this library to verify loader functionality.
+
+$mapfile_version 2
+
+SYMBOL_VERSION ILLUMOSprivate {
+ global:
+ bf_init;
+ bf_fini;
+ bf_run;
+ ficl2IntegerDivideFloored;
+ ficl2IntegerDivideSymmetric;
+ ficl2UnsignedDivide;
+ ficlAlignPointer;
+ ficlCallbackAssert;
+ ficlCallbackDefaultTextOut;
+ ficlCallbackTextOut;
+ ficlDictionaryAbortDefinition;
+ ficlDictionaryAlign;
+ ficlDictionaryAllot;
+ ficlDictionaryAllotCells;
+ ficlDictionaryAppend2Constant;
+ ficlDictionaryAppend2ConstantInstruction;
+ ficlDictionaryAppendCell;
+ ficlDictionaryAppendCharacter;
+ ficlDictionaryAppendConstant;
+ ficlDictionaryAppendConstantInstruction;
+ ficlDictionaryAppendData;
+ ficlDictionaryAppendInstruction;
+ ficlDictionaryAppendPrimitive;
+ ficlDictionaryAppendString;
+ ficlDictionaryAppendUnsigned;
+ ficlDictionaryAppendWord;
+ ficlDictionaryCellsAvailable;
+ ficlDictionaryCellsUsed;
+ ficlDictionaryClearFlags;
+ ficlDictionaryCreate;
+ ficlDictionaryCreateHashed;
+ ficlDictionaryCreateWordlist;
+ ficlDictionaryDestroy;
+ ficlDictionaryEmpty;
+ ficlDictionaryFindEnclosingWord;
+ ficlDictionaryIncludes;
+ ficlDictionaryIsAWord;
+ ficlDictionaryLookup;
+ ficlDictionaryResetSearchOrder;
+ ficlDictionarySee;
+ ficlDictionarySet2Constant;
+ ficlDictionarySet2ConstantInstruction;
+ ficlDictionarySetConstant;
+ ficlDictionarySetConstantInstruction;
+ ficlDictionarySetFlags;
+ ficlDictionarySetImmediate;
+ ficlDictionarySetInstruction;
+ ficlDictionarySetPrimitive;
+ ficlDictionaryUnsmudge;
+ ficlDictionaryWhere;
+ ficlDigitToCharacter;
+ ficlFree;
+ ficlHashCode;
+ ficlHashForget;
+ ficlHashInsertWord;
+ ficlHashLookup;
+ ficlHashReset;
+ ficlIsPowerOfTwo;
+ ficlLocalParen;
+ ficlLocalParenIm;
+ ficlLtoa;
+ ficlMalloc;
+ ficlPrimitiveHashSummary;
+ ficlPrimitiveLiteralIm;
+ ficlPrimitiveParseStepParen;
+ ficlPrimitiveTick;
+ ficlRealloc;
+ ficlStackCheck;
+ ficlStackCreate;
+ ficlStackDepth;
+ ficlStackDestroy;
+ ficlStackWalk;
+ ficlStackDisplay;
+ ficlStackDrop;
+ ficlStackFetch;
+ ficlStackGetTop;
+ ficlStackLink;
+ ficlStackPick;
+ ficlStackPop;
+ ficlStackPop2Integer;
+ ficlStackPop2Unsigned;
+ ficlStackPopFloat;
+ ficlStackPopInteger;
+ ficlStackPopPointer;
+ ficlStackPopUnsigned;
+ ficlStackPush;
+ ficlStackPush2Integer;
+ ficlStackPush2Unsigned;
+ ficlStackPushFloat;
+ ficlStackPushInteger;
+ ficlStackPushPointer;
+ ficlStackPushUnsigned;
+ ficlStackReset;
+ ficlStackRoll;
+ ficlStackSetTop;
+ ficlStackStore;
+ ficlStackUnlink;
+ ficlStrincmp;
+ ficlStringCaseFold;
+ ficlStringReverse;
+ ficlStringSkipSpace;
+ ficlSystemAddParseStep;
+ ficlSystemAddPrimitiveParseStep;
+ ficlSystemCompileCore;
+ ficlSystemCompileExtras;
+ ficlSystemCompileFile;
+ ficlSystemCompileFloat;
+ ficlSystemCompilePlatform;
+ ficlSystemCompilePrefix;
+ ficlSystemCompileSearch;
+ ficlSystemCompileSoftCore;
+ ficlSystemCompileTools;
+ ficlSystemCreate;
+ ficlSystemCreateVm;
+ ficlSystemDestroy;
+ ficlSystemDestroyVm;
+ ficlSystemGetDictionary;
+ ficlSystemGetEnvironment;
+ ficlSystemGetLocals;
+ ficlSystemLookup;
+ ficlSystemLookupLocal;
+ ficlUltoa;
+ ficlVmBranchRelative;
+ ficlVmCreate;
+ ficlVmDestroy;
+ ficlVmDictionaryAllot;
+ ficlVmDictionaryAllotCells;
+ ficlVmDictionaryCheck;
+ ficlVmDictionarySimpleCheck;
+ ficlVmDisplayDataStack;
+ ficlVmDisplayDataStackSimple;
+ ficlVmDisplayFloatStack;
+ ficlVmDisplayReturnStack;
+ ficlVmEvaluate;
+ ficlVmExecuteString;
+ ficlVmExecuteWord;
+ ficlVmExecuteXT;
+ ficlVmGetDictionary;
+ ficlVmGetString;
+ ficlVmGetWord;
+ ficlVmGetWord0;
+ ficlVmGetWordToPad;
+ ficlVmInnerLoop;
+ ficlVmParseFloatNumber;
+ ficlVmParseNumber;
+ ficlVmParseString;
+ ficlVmParseStringEx;
+ ficlVmParseWord;
+ ficlVmParsePrefix;
+ ficlVmPop;
+ ficlVmPopIP;
+ ficlVmPopTib;
+ ficlVmPush;
+ ficlVmPushIP;
+ ficlVmPushTib;
+ ficlVmQuit;
+ ficlVmReset;
+ ficlVmSetTextOut;
+ ficlVmTextOut;
+ ficlVmThrow;
+ ficlVmThrowError;
+ ficlWordClassify;
+ ficlWordIsCompileOnly;
+ ficlWordIsImmediate;
+
+ local:
+ *;
+};
diff --git a/usr/src/lib/libficl/softcore/Makefile b/usr/src/lib/libficl/softcore/Makefile
new file mode 100644
index 0000000000..a1cec6287f
--- /dev/null
+++ b/usr/src/lib/libficl/softcore/Makefile
@@ -0,0 +1,46 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2016 Toomas Soome <tsoome@me.com>
+#
+
+include $(SRC)/tools/Makefile.tools
+
+install all: softcore.c
+
+SOFTCORE= $(SRC)/common/ficl/softcore
+PROG = makesoftcore
+
+#
+# not needed: file access
+#
+FR = softcore.fr ifbrack.fr prefix.fr ficl.fr jhlocal.fr marker.fr
+FR += freebsd.fr ficllocal.fr oo.fr classes.fr string.fr
+SOURCES= $(FR:%=$(SOFTCORE)/%)
+
+OBJS= makesoftcore.o lz4.o
+SRCS= makesoftcore.c lz4.c
+LDLIBS= -lumem
+
+CPPFLAGS += -I.. -I$(SRC)/common/ficl
+
+softcore.c: $(PROG) $(SOURCES)
+ ./$(PROG) $(SOURCES)
+
+$(PROG): $(OBJS)
+ $(LINK.c) -o $@ $(OBJS) $(LDLIBS)
+
+%.o: $(SOFTCORE)/%.c
+ $(COMPILE.c) $<
+
+clobber clean:
+ $(RM) softcore.c $(OBJS) $(PROG)
diff --git a/usr/src/lib/libficl/sparc/Makefile b/usr/src/lib/libficl/sparc/Makefile
new file mode 100644
index 0000000000..ae94623a64
--- /dev/null
+++ b/usr/src/lib/libficl/sparc/Makefile
@@ -0,0 +1,18 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2016 Toomas Soome <tsoome@me.com>
+#
+
+include ../Makefile.com
+
+install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
diff --git a/usr/src/lib/libficl/sparcv9/Makefile b/usr/src/lib/libficl/sparcv9/Makefile
new file mode 100644
index 0000000000..1cac1cfedd
--- /dev/null
+++ b/usr/src/lib/libficl/sparcv9/Makefile
@@ -0,0 +1,19 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2016 Toomas Soome <tsoome@me.com>
+#
+
+include ../Makefile.com
+include ../../Makefile.lib.64
+
+install: all $(ROOTLIBS64) $(ROOTLINKS64) $(ROOTLINT64)