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
This commit is contained in:
wenyongh
2019-09-25 03:42:56 -05:00
committed by GitHub
parent 2fca3aa3f5
commit f8f61dc898
14 changed files with 150 additions and 12 deletions

View File

@ -1,12 +1,17 @@
#include "lib_export.h"
#include "sensor_api.h"
#include "connection_api.h"
#if WASM_ENABLE_GUI != 0
#include "gui_api.h"
#endif
static NativeSymbol extended_native_symbol_defs[] = {
#include "runtime_sensor.inl"
#include "connection.inl"
#if WASM_ENABLE_GUI != 0
#include "wamr_gui.inl"
#endif
};
#include "ext_lib_export.h"

View File

@ -33,8 +33,10 @@
#include "module_wasm_app.h"
#include "wasm_export.h"
#if WASM_ENABLE_GUI != 0
#include "lv_drivers/display/monitor.h"
#include "lv_drivers/indev/mouse.h"
#endif
#define MAX 2048
@ -430,6 +432,7 @@ static bool parse_args(int argc, char *argv[])
return true;
}
#if WASM_ENABLE_GUI != 0
/**
* Initialize the Hardware Abstraction Layer (HAL) for the Littlev graphics library
*/
@ -461,6 +464,8 @@ static void hal_init(void)
indev_drv.read_cb = mouse_read; /*This function will be called periodically (by the library) to get the mouse position and state*/
lv_indev_drv_register(&indev_drv);
}
#endif
// Driver function
int iwasm_main(int argc, char *argv[])
{
@ -484,8 +489,11 @@ int iwasm_main(int argc, char *argv[])
goto fail1;
}
#if WASM_ENABLE_GUI != 0
wgl_init();
hal_init();
#endif
init_sensor_framework();
// timer manager