summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/boot/common/interp_forth.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/boot/common/interp_forth.c b/sys/boot/common/interp_forth.c
index 41530b0..45cff4e 100644
--- a/sys/boot/common/interp_forth.c
+++ b/sys/boot/common/interp_forth.c
@@ -53,6 +53,7 @@ extern char bootprog_rev[];
* BootForth Interface to Ficl Forth interpreter.
*/
+FICL_SYSTEM *bf_sys;
FICL_VM *bf_vm;
FICL_WORD *pInterp;
@@ -232,8 +233,8 @@ bf_init(void)
char create_buf[41]; /* 31 characters-long builtins */
int fd;
- ficlInitSystem(10000); /* Default dictionary ~4000 cells */
- bf_vm = ficlNewVM();
+ bf_sys = ficlInitSystem(10000); /* Default dictionary ~4000 cells */
+ bf_vm = ficlNewVM(bf_sys);
/* Put all private definitions in a "builtins" vocabulary */
ficlExec(bf_vm, "vocabulary builtins also builtins definitions");
@@ -243,7 +244,7 @@ bf_init(void)
/* make all commands appear as Forth words */
SET_FOREACH(cmdp, Xcommand_set) {
- ficlBuild((*cmdp)->c_name, bf_command, FW_DEFAULT);
+ ficlBuild(bf_sys, (char *)(*cmdp)->c_name, bf_command, FW_DEFAULT);
ficlExec(bf_vm, "forth definitions builtins");
sprintf(create_buf, "builtin: %s", (*cmdp)->c_name);
ficlExec(bf_vm, create_buf);
@@ -252,8 +253,8 @@ bf_init(void)
ficlExec(bf_vm, "only forth definitions");
/* Export some version numbers so that code can detect the loader/host version */
- ficlSetEnv("FreeBSD_version", __FreeBSD_version);
- ficlSetEnv("loader_version",
+ ficlSetEnv(bf_sys, "FreeBSD_version", __FreeBSD_version);
+ ficlSetEnv(bf_sys, "loader_version",
(bootprog_rev[0] - '0') * 10 + (bootprog_rev[2] - '0'));
/* try to load and run init file if present */
@@ -263,7 +264,7 @@ bf_init(void)
}
/* Do this last, so /boot/boot.4th can change it */
- pInterp = ficlLookup("interpret");
+ pInterp = ficlLookup(bf_sys, "interpret");
}
/*
OpenPOWER on IntegriCloud