re-org platform APIs, simplify porting process (#201)

Co-authored-by: Xu Jun <jun1.xu@intel.com>
This commit is contained in:
Xu Jun
2020-03-16 16:43:57 +08:00
committed by GitHub
parent ef5ceffe71
commit f1a0e75ab7
177 changed files with 2954 additions and 7904 deletions

View File

@ -24,9 +24,7 @@
#include "runtime_timer.h"
#include "native_interface.h"
#include "app_manager_export.h"
#include "bh_common.h"
#include "bh_queue.h"
#include "bh_thread.h"
#include "bh_platform.h"
#include "runtime_sensor.h"
#include "bi-inc/attr_container.h"
#include "module_wasm_app.h"
@ -466,7 +464,7 @@ static void hal_init(void)
int iwasm_main(int argc, char *argv[])
{
RuntimeInitArgs init_args;
korp_thread tid;
korp_tid tid;
if (!parse_args(argc, argv))
return -1;
@ -479,12 +477,11 @@ int iwasm_main(int argc, char *argv[])
/* initialize runtime environment */
if (!wasm_runtime_full_init(&init_args)) {
bh_printf("Init runtime environment failed.\n");
printf("Init runtime environment failed.\n");
return -1;
}
if (!init_connection_framework()) {
vm_thread_sys_destroy();
goto fail1;
}
@ -499,12 +496,12 @@ int iwasm_main(int argc, char *argv[])
#ifndef CONNECTION_UART
if (server_mode)
vm_thread_create(&tid, func_server_mode, NULL,
os_thread_create(&tid, func_server_mode, NULL,
BH_APPLET_PRESERVED_STACK_SIZE);
else
vm_thread_create(&tid, func, NULL, BH_APPLET_PRESERVED_STACK_SIZE);
os_thread_create(&tid, func, NULL, BH_APPLET_PRESERVED_STACK_SIZE);
#else
vm_thread_create(&tid, func_uart_mode, NULL, BH_APPLET_PRESERVED_STACK_SIZE);
os_thread_create(&tid, func_uart_mode, NULL, BH_APPLET_PRESERVED_STACK_SIZE);
#endif
app_manager_startup(&interface);