Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/compilation_on_android_ubuntu_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,6 @@ jobs:
# uncompatiable feature and platform
- os: macos-latest
make_options_feature: "-DWAMR_BUILD_DEBUG_AOT=1"
- os: macos-latest
make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
# uncompatiable mode and feature
# MULTI_MODULE only on INTERP mode
- make_options_run_mode: $LAZY_JIT_BUILD_OPTIONS
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/compilation_on_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,10 @@ jobs:
cmake .. -DWAMR_BUILD_SIMD=1
cmake --build . --config Release --parallel 4
cd .. && rm -force -r build
- name: Build iwasm [source debugger]
run: |
cd product-mini/platforms/windows
mkdir build && cd build
cmake .. -DWAMR_BUILD_DEBUG_INTERP=1
cmake --build . --config Release --parallel 4
cd .. && rm -force -r build
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
/.idea
**/cmake-build-*/
**/*build/
*.obj
*.a
*.so

core/deps/**
core/shared/mem-alloc/tlsf
core/app-framework/wgl
Expand All @@ -12,6 +16,9 @@ wamr-sdk/out/
wamr-sdk/runtime/build_runtime_sdk/
test-tools/host-tool/bin/
product-mini/app-samples/hello-world/test.wasm
product-mini/platforms/linux-sgx/enclave-sample/App/
product-mini/platforms/linux-sgx/enclave-sample/Enclave/
product-mini/platforms/linux-sgx/enclave-sample/iwasm

build_out
tests/wamr-test-suites/workspace
4 changes: 2 additions & 2 deletions core/app-framework/sensor/app/sensor_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ uint32
wasm_sensor_open(const char *name, int instance);

bool
wasm_sensor_config(uint32 sensor, int interval, int bit_cfg, int delay);
wasm_sensor_config(uint32 sensor, uint32 interval, int bit_cfg, uint32 delay);

bool
wasm_sensor_config_with_attr_container(uint32 sensor, char *buffer, int len);
wasm_sensor_config_with_attr_container(uint32 sensor, char *buffer, uint32 len);

bool
wasm_sensor_close(uint32 sensor);
Expand Down
30 changes: 15 additions & 15 deletions core/app-framework/sensor/native/runtime_sensor.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "bh_platform.h"

static sys_sensor_t *g_sys_sensors = NULL;
static int g_sensor_id_max = 0;
static uint32 g_sensor_id_max = 0;

static sensor_client_t *
find_sensor_client(sys_sensor_t *sensor, unsigned int client_id,
Expand Down Expand Up @@ -85,8 +85,8 @@ wasm_sensor_callback(void *client, uint32 sensor_id, void *user_data)
}

bool
wasm_sensor_config(wasm_exec_env_t exec_env, uint32 sensor, int interval,
int bit_cfg, int delay)
wasm_sensor_config(wasm_exec_env_t exec_env, uint32 sensor, uint32 interval,
int bit_cfg, uint32 delay)
{
wasm_module_inst_t module_inst = get_module_inst(exec_env);
attr_container_t *attr_cont;
Expand Down Expand Up @@ -115,9 +115,9 @@ wasm_sensor_config(wasm_exec_env_t exec_env, uint32 sensor, int interval,

if (s->config != NULL) {
attr_cont = attr_container_create("config sensor");
attr_container_set_int(&attr_cont, "interval", interval);
attr_container_set_int(&attr_cont, "interval", (int)interval);
attr_container_set_int(&attr_cont, "bit_cfg", bit_cfg);
attr_container_set_int(&attr_cont, "delay", delay);
attr_container_set_int(&attr_cont, "delay", (int)delay);
s->config(s, attr_cont);
attr_container_destroy(attr_cont);
}
Expand All @@ -138,7 +138,7 @@ wasm_sensor_open(wasm_exec_env_t exec_env, char *name, int instance)
sensor_client_t *c;
sys_sensor_t *s = find_sys_sensor(name, instance);
if (s == NULL)
return -1;
return (uint32)-1;

unsigned int mod_id =
app_manager_get_module_id(Module_WASM_App, module_inst);
Expand All @@ -150,14 +150,14 @@ wasm_sensor_open(wasm_exec_env_t exec_env, char *name, int instance)
if (c) {
// the app already opened this sensor
os_mutex_unlock(&s->lock);
return -1;
return (uint32)-1;
}

sensor_client_t *client =
(sensor_client_t *)wasm_runtime_malloc(sizeof(sensor_client_t));
if (client == NULL) {
os_mutex_unlock(&s->lock);
return -1;
return (uint32)-1;
}

memset(client, 0, sizeof(sensor_client_t));
Expand All @@ -176,7 +176,7 @@ wasm_sensor_open(wasm_exec_env_t exec_env, char *name, int instance)
return s->sensor_id;
}

return -1;
return (uint32)-1;
}

bool
Expand Down Expand Up @@ -294,7 +294,7 @@ add_sys_sensor(char *name, char *description, int instance,
}

g_sensor_id_max++;
if (g_sensor_id_max == -1)
if (g_sensor_id_max == UINT32_MAX)
g_sensor_id_max++;
s->sensor_id = g_sensor_id_max;

Expand Down Expand Up @@ -366,10 +366,10 @@ find_sensor_client(sys_sensor_t *sensor, unsigned int client_id,
}

// return the milliseconds to next check
int
uint32
check_sensor_timers()
{
int ms_to_next_check = -1;
uint32 ms_to_next_check = UINT32_MAX;
uint32 now = (uint32)bh_get_tick_ms();

sys_sensor_t *s = g_sys_sensors;
Expand All @@ -395,12 +395,12 @@ check_sensor_timers()

s->last_read = now;

if (ms_to_next_check == -1 || (ms_to_next_check < s->read_interval))
if (s->read_interval < ms_to_next_check)
ms_to_next_check = s->read_interval;
}
else {
int remaining = s->read_interval - elpased_ms;
if (ms_to_next_check == -1 || (ms_to_next_check < remaining))
uint32 remaining = s->read_interval - elpased_ms;
if (remaining < ms_to_next_check)
ms_to_next_check = remaining;
}

Expand Down
6 changes: 3 additions & 3 deletions core/app-framework/sensor/native/runtime_sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ typedef struct _sys_sensor *sensor_obj_t;
typedef struct _sensor_client {
struct _sensor_client *next;
unsigned int client_id; // the app id
int interval;
uint32 interval;
int bit_cfg;
int delay;
uint32 delay;
void (*client_callback)(void *client, uint32, attr_container_t *);
} sensor_client_t;

Expand Down Expand Up @@ -54,7 +54,7 @@ void
refresh_read_interval(sensor_obj_t sensor);
void
sensor_cleanup_callback(uint32 module_id);
int
uint32
check_sensor_timers();
void
reschedule_sensor_read();
Expand Down
4 changes: 2 additions & 2 deletions core/app-framework/sensor/native/sensor_mgr_ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ static void
thread_sensor_check(void *arg)
{
while (sensor_check_thread_run) {
int ms_to_expiry = check_sensor_timers();
if (ms_to_expiry == -1)
uint32 ms_to_expiry = check_sensor_timers();
if (ms_to_expiry == UINT32_MAX)
ms_to_expiry = 5000;
os_mutex_lock(&mutex);
os_cond_reltimedwait(&cond, &mutex, ms_to_expiry * 1000);
Expand Down
4 changes: 2 additions & 2 deletions core/app-framework/sensor/native/sensor_native_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ extern "C" {
#endif

bool
wasm_sensor_config(wasm_exec_env_t exec_env, uint32 sensor, int interval,
int bit_cfg, int delay);
wasm_sensor_config(wasm_exec_env_t exec_env, uint32 sensor, uint32 interval,
int bit_cfg, uint32 delay);
uint32
wasm_sensor_open(wasm_exec_env_t exec_env, char *name, int instance);

Expand Down
6 changes: 3 additions & 3 deletions core/iwasm/aot/aot_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,7 @@ load_import_funcs(const uint8 **p_buf, const uint8 *buf_end, AOTModule *module,
#if WASM_ENABLE_LIBC_WASI != 0
if (!strcmp(import_funcs[i].module_name, "wasi_unstable")
|| !strcmp(import_funcs[i].module_name, "wasi_snapshot_preview1"))
module->is_wasi_module = true;
module->import_wasi_api = true;
#endif
}

Expand Down Expand Up @@ -3008,7 +3008,7 @@ aot_load_from_comp_data(AOTCompData *comp_data, AOTCompContext *comp_ctx,
module->comp_data = comp_data;

#if WASM_ENABLE_LIBC_WASI != 0
module->is_wasi_module = comp_data->wasm_module->is_wasi_module;
module->import_wasi_api = comp_data->wasm_module->import_wasi_api;
#endif

return module;
Expand Down Expand Up @@ -3206,7 +3206,7 @@ aot_unload(AOTModule *module)
wasm_runtime_free(module->aux_func_indexes);
}
if (module->aux_func_names) {
wasm_runtime_free(module->aux_func_names);
wasm_runtime_free((void *)module->aux_func_names);
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion core/iwasm/aot/aot_runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ aot_instantiate(AOTModule *module, bool is_sub_inst, uint32 stack_size,

#if WASM_ENABLE_BULK_MEMORY != 0
#if WASM_ENABLE_LIBC_WASI != 0
if (!module->is_wasi_module) {
if (!module->import_wasi_api) {
#endif
/* Only execute the memory init function for main instance because
the data segments will be dropped once initialized.
Expand Down
2 changes: 1 addition & 1 deletion core/iwasm/aot/aot_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ typedef struct AOTModule {

#if WASM_ENABLE_LIBC_WASI != 0
WASIArguments wasi_args;
bool is_wasi_module;
bool import_wasi_api;
#endif
#if WASM_ENABLE_DEBUG_AOT != 0
void *elf_hdr;
Expand Down
Loading