re-org platform APIs, simplify porting process (#201)
Co-authored-by: Xu Jun <jun1.xu@intel.com>
This commit is contained in:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user