Re-org shared lib header files, remove unused info (#136)
And fix compile issues of vxworks
This commit is contained in:
@ -28,7 +28,6 @@
|
||||
#include "conn_tcp.h"
|
||||
#include "conn_udp.h"
|
||||
#include "conn_uart.h"
|
||||
#include "bh_definition.h"
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sys/epoll.h>
|
||||
@ -545,7 +544,7 @@ bool init_connection_framework()
|
||||
if (epollfd == -1)
|
||||
return false;
|
||||
|
||||
if (vm_mutex_init(&g_lock) != BH_SUCCESS) {
|
||||
if (vm_mutex_init(&g_lock) != 0) {
|
||||
close(epollfd);
|
||||
return false;
|
||||
}
|
||||
@ -562,7 +561,7 @@ bool init_connection_framework()
|
||||
if (vm_thread_create(&tid,
|
||||
polling_thread_routine,
|
||||
NULL,
|
||||
BH_APPLET_PRESERVED_STACK_SIZE) != BH_SUCCESS) {
|
||||
BH_APPLET_PRESERVED_STACK_SIZE) != 0) {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
@ -32,13 +32,17 @@ if (NOT ("$ENV{VALGRIND}" STREQUAL "YES"))
|
||||
endif ()
|
||||
|
||||
# Set BUILD_TARGET, currently values supported:
|
||||
# "X86_64", "AMD_64", "X86_32", "ARM_32", "MIPS_32", "XTENSA_32"
|
||||
# "X86_64", "AMD_64", "X86_32", "ARM_32", "MIPS_32", "XTENSA_32", "GENERAL"
|
||||
#set (BUILD_TARGET "X86_64")
|
||||
|
||||
if (NOT BUILD_TARGET)
|
||||
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
# Build as X86_64 by default in 64-bit platform
|
||||
# if BUILD_TARGET isn't set
|
||||
set (BUILD_TARGET "X86_64")
|
||||
else ()
|
||||
# Build as X86_32 by default in 32-bit platform
|
||||
# if BUILD_TARGET isn't set
|
||||
set (BUILD_TARGET "X86_32")
|
||||
endif ()
|
||||
endif ()
|
||||
@ -58,6 +62,14 @@ elseif (BUILD_TARGET STREQUAL "MIPS_32")
|
||||
add_definitions(-DBUILD_TARGET_MIPS_32)
|
||||
elseif (BUILD_TARGET STREQUAL "XTENSA_32")
|
||||
add_definitions(-DBUILD_TARGET_XTENSA_32)
|
||||
elseif (BUILD_TARGET STREQUAL "GENERAL")
|
||||
# Will use invokeNative_general.c instead of assembly code,
|
||||
# but the maximum number of native arguments is limited to 20,
|
||||
# and there are possible issues when passing arguments to
|
||||
# native function for some cpus, e.g. int64 and double arguments
|
||||
# in arm and mips need to be 8-bytes aligned, and some arguments
|
||||
# of x86_64 are passed by registers but not stack
|
||||
add_definitions(-DBUILD_TARGET_GENERAL)
|
||||
else ()
|
||||
message (FATAL_ERROR "-- Build target isn't set")
|
||||
endif ()
|
||||
@ -91,6 +103,8 @@ include_directories (.
|
||||
../../runtime/platform/include
|
||||
${SHARED_LIB_DIR}/include)
|
||||
|
||||
enable_language (ASM)
|
||||
|
||||
include (../../runtime/platform/${PLATFORM}/platform.cmake)
|
||||
include (../../runtime/utils/utils.cmake)
|
||||
include (../../runtime/vmcore-wasm/vmcore.cmake)
|
||||
|
||||
@ -19,9 +19,9 @@
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "bh_platform.h"
|
||||
#include "wasm_assert.h"
|
||||
#include "wasm_log.h"
|
||||
#include "wasm_platform.h"
|
||||
#include "wasm_platform_log.h"
|
||||
#include "wasm_thread.h"
|
||||
#include "wasm_export.h"
|
||||
|
||||
@ -30,6 +30,8 @@ elseif (${BUILD_TARGET} STREQUAL "MIPS_32")
|
||||
set (source_all ${c_source_all} ${VMCORE_LIB_DIR}/invokeNative_mips.s)
|
||||
elseif (${BUILD_TARGET} STREQUAL "XTENSA_32")
|
||||
set (source_all ${c_source_all} ${VMCORE_LIB_DIR}/invokeNative_xtensa.s)
|
||||
elseif (${BUILD_TARGET} STREQUAL "GENERAL")
|
||||
set (source_all ${c_source_all} ${VMCORE_LIB_DIR}/invokeNative_general.c)
|
||||
else ()
|
||||
message (FATAL_ERROR "Build target isn't set")
|
||||
endif ()
|
||||
|
||||
Reference in New Issue
Block a user