diff --git a/core/iwasm/runtime/vmcore-wasm/invokeNative_arm.s b/core/iwasm/runtime/vmcore-wasm/invokeNative_arm.s index 10f6b591d..8d9091449 100644 --- a/core/iwasm/runtime/vmcore-wasm/invokeNative_arm.s +++ b/core/iwasm/runtime/vmcore-wasm/invokeNative_arm.s @@ -21,16 +21,16 @@ /* * Arguments passed in: * - * r0 argv - * r1 argc - * r2 function pntr + * r0 function pntr + * r1 argv + * r2 argc */ invokeNative: stmfd sp!, {r4, r5, r6, r7, lr} - mov r4, r0 /* get argv */ - mov r5, r1 /* get argc */ - mov ip, r2 /* get function ptr */ + mov ip, r0 /* get function ptr */ + mov r4, r1 /* get argv */ + mov r5, r2 /* get argc */ cmp r5, #2 /* is argc < 2 ? */ blt return diff --git a/core/iwasm/runtime/vmcore-wasm/invokeNative_general.c b/core/iwasm/runtime/vmcore-wasm/invokeNative_general.c index 3cb34cffd..99c0473a0 100644 --- a/core/iwasm/runtime/vmcore-wasm/invokeNative_general.c +++ b/core/iwasm/runtime/vmcore-wasm/invokeNative_general.c @@ -16,7 +16,7 @@ #include "wasm_runtime.h" -void invokeNative(uint32 argv[], uint32 argc, void (*native_code)()) +void invokeNative(void (*native_code)(), uint32 argv[], uint32 argc) { WASMThread *self; switch(argc) { diff --git a/core/iwasm/runtime/vmcore-wasm/invokeNative_mips.s b/core/iwasm/runtime/vmcore-wasm/invokeNative_mips.s index bf1ad5965..78a212b2e 100644 --- a/core/iwasm/runtime/vmcore-wasm/invokeNative_mips.s +++ b/core/iwasm/runtime/vmcore-wasm/invokeNative_mips.s @@ -22,9 +22,9 @@ /** * On function entry parameters: - * $4 = args - * $5 = arg_num - * $6 = func_ptr + * $4 = func_ptr + * $5 = args + * $6 = arg_num */ invokeNative: @@ -43,22 +43,22 @@ invokeNative: move $fp, $sp /* allocate enough stack space */ - sll $11, $5, 2 + sll $11, $6, 2 /* $11 == arg_num * 4 */ subu $sp, $11 /* make 8-byte aligned */ - and $sp, ~7 + and $sp, ~7 move $9, $sp - move $25, $6 /* $25 = func_ptr */ + move $25, $4 /* $25 = func_ptr */ push_args: - beq $5, 0, done /* arg_num == 0 ? */ - lw $8, 0($4) - sw $8, 0($9) - addu $4, 4 - addu $9, 4 - subu $5, 1 /* arg_index-- */ + beq $6, 0, done /* arg_num == 0 ? */ + lw $8, 0($5) /* $8 = *args */ + sw $8, 0($9) /* store $8 to stack */ + addu $5, 4 /* args++ */ + addu $9, 4 /* sp++ */ + subu $6, 1 /* arg_num-- */ j push_args done: diff --git a/samples/gui/README.md b/samples/gui/README.md index e04e33dc7..3f3659236 100644 --- a/samples/gui/README.md +++ b/samples/gui/README.md @@ -52,7 +52,7 @@ Linux -------------------------------- - Build
`./build.sh`
- All binaries are in "out", which contains "host_tool", "lvgl_native_ui_app", "ui_app.wasm", "ui_app_lvgl_compatible" and "wasm_runtime_wgl". + All binaries are in "out", which contains "host_tool", "lvgl_native_ui_app", "ui_app.wasm", "ui_app_lvgl_compatible.wasm" and "wasm_runtime_wgl". - Run native Linux application
`./lvgl_native_ui_app`
@@ -61,7 +61,7 @@ Linux `./wasm_runtime_wgl -s`
Then install wasm APP use host tool.
`./host_tool -i ui_app -f ui_app.wasm`
-`./host_tool -i ui_app -f ui_app_compatible.wasm`
+`./host_tool -i ui_app -f ui_app_lvgl_compatible.wasm`
Zephyr --------------------------------