This repository has been archived on 2023-11-05. You can view files and clone it, but cannot push or open issues or pull requests.
wasm-micro-runtime/core/shared-lib/include/config.h
wenyongh f8f61dc898 Add a switch to build simple sample without gui support (#126)
* Implement memory profiler, optimize memory usage, modify code indent

* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default

* Add a new extension library: connection

* Fix bug of reading magic number and version in big endian platform

* Re-org platform APIs: move most platform APIs from iwasm to shared-lib

* Enhance wasm loader to fix some security issues

* Fix issue about illegal load of EXC_RETURN into PC on stm32 board

* Updates that let a restricted version of the interpreter run in SGX

* Enable native/app address validation and conversion for wasm app

* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused

* Refine binary size and fix several minor issues

Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c

* Add more strict security checks for libc wrapper API's

* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files

* Enhance security of libc strcpy/sprintf wrapper function

* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions

* Remove get_module_inst() and fix issue of call native

* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate

* Refine interpreter call native process, refine memory boudary check

* Fix issues of invokeNative function of arm/mips/general version

* Add a switch to build simple sample without gui support
2019-09-25 03:42:56 -05:00

137 lines
3.6 KiB
C

/*
* Copyright (C) 2019 Intel Corporation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _CONFIG_H_
/* Memory allocator ems */
#define MEM_ALLOCATOR_EMS 0
/* Memory allocator tlsf */
#define MEM_ALLOCATOR_TLSF 1
/* Default memory allocator */
#define DEFAULT_MEM_ALLOCATOR MEM_ALLOCATOR_EMS
/* Beihai log system */
#define BEIHAI_ENABLE_LOG 1
/* Beihai debugger support */
#define BEIHAI_ENABLE_TOOL_AGENT 1
/* Beihai debug monitoring server, must define
BEIHAI_ENABLE_TOOL_AGENT firstly */
#define BEIHAI_ENABLE_TOOL_AGENT_BDMS 1
/* enable no signature on sdv since verify doesn't work as lacking public key */
#ifdef CONFIG_SDV
#define BEIHAI_ENABLE_NO_SIGNATURE 1
#else
#define BEIHAI_ENABLE_NO_SIGNATURE 0
#endif
/* WASM VM log system */
#ifndef WASM_ENABLE_LOG
#define WASM_ENABLE_LOG 1
#endif
/* WASM Interpreter labels-as-values feature */
#define WASM_ENABLE_LABELS_AS_VALUES 1
/* WASM Branch Block address hashmap */
#define WASM_ENABLE_HASH_BLOCK_ADDR 0
/* Heap and stack profiling */
#define BEIHAI_ENABLE_MEMORY_PROFILING 0
/* Max app number of all modules */
#define MAX_APP_INSTALLATIONS 3
/* Default timer number in one app */
#define DEFAULT_TIMERS_PER_APP 20
/* Max timer number in one app */
#define MAX_TIMERS_PER_APP 30
/* Max connection number in one app */
#define MAX_CONNECTION_PER_APP 20
/* Max resource registration number in one app */
#define RESOURCE_REGISTRATION_NUM_MAX 16
/* Max length of resource/event url */
#define RESOUCE_EVENT_URL_LEN_MAX 256
/* Default length of queue */
#define DEFAULT_QUEUE_LENGTH 50
/* Default watchdog interval in ms */
#define DEFAULT_WATCHDOG_INTERVAL (3 * 60 * 1000)
/* Workflow heap size */
/*
#define WORKING_FLOW_HEAP_SIZE 0
*/
/* Support memory.grow opcode and enlargeMemory function */
#define WASM_ENABLE_MEMORY_GROW 1
/* The max percentage of global heap that app memory space can grow */
#define APP_MEMORY_MAX_GLOBAL_HEAP_PERCENT 1 / 3
/* Default base offset of app heap space */
#define DEFAULT_APP_HEAP_BASE_OFFSET (1 * BH_GB)
/* Default min/max heap size of each app */
#define APP_HEAP_SIZE_DEFAULT (8 * 1024)
#define APP_HEAP_SIZE_MIN (2 * 1024)
#define APP_HEAP_SIZE_MAX (1024 * 1024)
/* Default wasm stack size of each app */
#ifdef __x86_64__
#define DEFAULT_WASM_STACK_SIZE (12 * 1024)
#else
#define DEFAULT_WASM_STACK_SIZE (8 * 1024)
#endif
/* Default/min/max stack size of each app thread */
#ifndef __ZEPHYR__
#define APP_THREAD_STACK_SIZE_DEFAULT (20 * 1024)
#define APP_THREAD_STACK_SIZE_MIN (16 * 1024)
#define APP_THREAD_STACK_SIZE_MAX (256 * 1024)
#else
#define APP_THREAD_STACK_SIZE_DEFAULT (4 * 1024)
#define APP_THREAD_STACK_SIZE_MIN (2 * 1024)
#define APP_THREAD_STACK_SIZE_MAX (256 * 1024)
#endif
#endif
/* External memory space provided by user,
but not wasm memory space and app heap space */
#ifndef WASM_ENABLE_EXT_MEMORY_SPACE
#define WASM_ENABLE_EXT_MEMORY_SPACE 0
#endif
/* Default base offset of external memory space */
#define DEFAULT_EXT_MEM_BASE_OFFSET (-2 * BH_GB)
#ifndef bh_printf
#define bh_printf printf
#endif
#ifndef WASM_ENABLE_GUI
#define WASM_ENABLE_GUI 0
#endif