This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 7d6e12917f7c73b20d8d959c19d5b26a47cce363
Author: YAMAMOTO Takashi <yamam...@midokura.com>
AuthorDate: Tue Dec 20 01:07:50 2022 +0900

    interpreter/toywasm: Update toywasm version
    
    The situation of toywasm_config.c is similar to toywasm_config.h.
    It's cmake-generated in the upstream. The original template is covered
    by a different license. I'm the author of the file and hereby re-license
    this copy.
    
    Tested on sim/macOS.
---
 interpreters/toywasm/Kconfig                       |  5 +++
 interpreters/toywasm/Makefile                      | 13 +++++++-
 interpreters/toywasm/include/toywasm_config.h      |  2 ++
 .../toywasm_config.h => src/toywasm_config.c}      | 36 ++++++++++++----------
 4 files changed, 38 insertions(+), 18 deletions(-)

diff --git a/interpreters/toywasm/Kconfig b/interpreters/toywasm/Kconfig
index aa71eb526..d849f7ac2 100644
--- a/interpreters/toywasm/Kconfig
+++ b/interpreters/toywasm/Kconfig
@@ -7,6 +7,11 @@ config INTERPRETERS_TOYWASM
        tristate "Toywasm Webassembly Runtime"
        default n
 
+       # TOYWASM_ENABLE_WASM_THREADS and TOYWASM_ENABLE_WASI_THREADS
+       # depends on pthread
+       # REVISIT: make these Kconfig
+       depends on !DISABLE_PTHREAD
+
 if INTERPRETERS_TOYWASM
 
 config INTERPRETERS_TOYWASM_PRIORITY
diff --git a/interpreters/toywasm/Makefile b/interpreters/toywasm/Makefile
index c975386c7..1818e5578 100644
--- a/interpreters/toywasm/Makefile
+++ b/interpreters/toywasm/Makefile
@@ -28,6 +28,7 @@ MODULE    = $(CONFIG_INTERPRETERS_TOYWASM)
 # cli
 MAINSRC = main.c
 CSRCS += repl.c
+CSRCS += toywasm_config.c
 
 # lib
 CSRCS += bitmap.c
@@ -39,6 +40,7 @@ CSRCS += exec.c
 CSRCS += expr.c
 CSRCS += fileio.c
 CSRCS += host_instance.c
+CSRCS += idalloc.c
 CSRCS += import_object.c
 CSRCS += insn.c
 CSRCS += instance.c
@@ -46,6 +48,7 @@ CSRCS += leb128.c
 CSRCS += module.c
 CSRCS += module_writer.c
 CSRCS += report.c
+CSRCS += timeutil.c
 CSRCS += type.c
 CSRCS += util.c
 CSRCS += validation.c
@@ -53,10 +56,17 @@ CSRCS += vec.c
 CSRCS += wasi.c
 CSRCS += xlog.c
 
+# TOYWASM_ENABLE_WASM_THREADS
+CSRCS += lock.c
+CSRCS += waitlist.c
+
+# TOYWASM_ENABLE_WASI_THREADS
+CSRCS += wasi_threads.c
+
 CFLAGS += ${shell $(INCDIR) "$(CC)" $(APPDIR)/interpreters/toywasm/include}
 CFLAGS += ${shell $(INCDIR) "$(CC)" $(APPDIR)/interpreters/toywasm/toywasm/lib}
 
-TOYWASM_VERSION  = ab861c89be54144d2bdff432e21d431c8a1c1e74
+TOYWASM_VERSION  = 7c55fe4478e01ae651967f7c5d3fd3fa98a851ba
 TOYWASM_UNPACK   = toywasm
 TOYWASM_TARBALL  = $(TOYWASM_VERSION).zip
 TOYWASM_URL_BASE = https://github.com/yamt/toywasm/archive/
@@ -64,6 +74,7 @@ TOYWASM_URL      = $(TOYWASM_URL_BASE)/$(TOYWASM_TARBALL)
 
 VPATH += $(TOYWASM_UNPACK)/cli
 VPATH += $(TOYWASM_UNPACK)/lib
+VPATH += src
 
 $(TOYWASM_TARBALL):
        $(Q) echo "Downloading $(TOYWASM_TARBALL)"
diff --git a/interpreters/toywasm/include/toywasm_config.h 
b/interpreters/toywasm/include/toywasm_config.h
index fd018d13f..70f61517c 100644
--- a/interpreters/toywasm/include/toywasm_config.h
+++ b/interpreters/toywasm/include/toywasm_config.h
@@ -33,5 +33,7 @@
 #define TOYWASM_USE_RESULTTYPE_CELLIDX
 #define TOYWASM_USE_LOCALTYPE_CELLIDX
 #define TOYWASM_ENABLE_WRITER
+#define TOYWASM_ENABLE_WASM_THREADS
+#define TOYWASM_ENABLE_WASI_THREADS
 
 #endif /* !defined(_TOYWASM_CONFIG_H) */
diff --git a/interpreters/toywasm/include/toywasm_config.h 
b/interpreters/toywasm/src/toywasm_config.c
similarity index 55%
copy from interpreters/toywasm/include/toywasm_config.h
copy to interpreters/toywasm/src/toywasm_config.c
index fd018d13f..56c7f85d1 100644
--- a/interpreters/toywasm/include/toywasm_config.h
+++ b/interpreters/toywasm/src/toywasm_config.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * apps/interpreters/toywasm/include/toywasm_config.h
+ * apps/interpreters/toywasm/src/toywasm_config.c
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -18,20 +18,22 @@
  *
  ****************************************************************************/
 
-#if !defined(_TOYWASM_CONFIG_H)
-#define _TOYWASM_CONFIG_H
-
-#define TOYWASM_USE_SEPARATE_EXECUTE
-#define TOYWASM_USE_TAILCALL
-/* #undef TOYWASM_ENABLE_TRACING */
-#define TOYWASM_USE_JUMP_BINARY_SEARCH
-/* #undef TOYWASM_USE_JUMP_CACHE */
-#define TOYWASM_JUMP_CACHE2_SIZE 4
-#define TOYWASM_USE_LOCALS_CACHE
-#define TOYWASM_USE_SEPARATE_LOCALS
-#define TOYWASM_USE_SMALL_CELLS
-#define TOYWASM_USE_RESULTTYPE_CELLIDX
-#define TOYWASM_USE_LOCALTYPE_CELLIDX
-#define TOYWASM_ENABLE_WRITER
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
 
-#endif /* !defined(_TOYWASM_CONFIG_H) */
+const char *toywasm_config_string =
+"\tTOYWASM_USE_SEPARATE_EXECUTE = ON\n"
+"\tTOYWASM_USE_TAILCALL = ON\n"
+"\tTOYWASM_ENABLE_TRACING = OFF\n"
+"\tTOYWASM_USE_JUMP_BINARY_SEARCH = ON\n"
+"\tTOYWASM_USE_JUMP_CACHE = OFF\n"
+"\tTOYWASM_JUMP_CACHE2_SIZE = 4\n"
+"\tTOYWASM_USE_LOCALS_CACHE = ON\n"
+"\tTOYWASM_USE_SEPARATE_LOCALS = ON\n"
+"\tTOYWASM_USE_SMALL_CELLS = ON\n"
+"\tTOYWASM_USE_RESULTTYPE_CELLIDX = ON\n"
+"\tTOYWASM_USE_LOCALTYPE_CELLIDX = ON\n"
+"\tTOYWASM_ENABLE_WRITER = ON\n"
+"\tTOYWASM_ENABLE_WASM_THREADS = ON\n"
+"\tTOYWASM_ENABLE_WASI_THREADS = ON\n";

Reply via email to