-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement clock related functions in wasi
Improve pointer handling of wasi functions. Signed-off-by: Zoltan Herczeg [email protected]
- Loading branch information
1 parent
e5f6c55
commit 20d770b
Showing
5 changed files
with
133 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
(module | ||
(import "wasi_snapshot_preview1" "clock_res_get" (func $clock_res_get (param i32 i32) (result i32))) | ||
(import "wasi_snapshot_preview1" "clock_time_get" (func $clock_time_get (param i32 i64 i32) (result i32))) | ||
(import "wasi_snapshot_preview1" "proc_exit" (func $proc_exit (param i32))) | ||
(memory 1) | ||
(export "_start" (func $_start)) | ||
(func $_start | ||
(call $clock_res_get (i32.const 0) (i32.const 0)) | ||
(if | ||
(then | ||
i32.const 1 | ||
call $proc_exit | ||
) | ||
) | ||
|
||
(call $clock_time_get (i32.const 0) (i64.const 1000000) (i32.const 0)) | ||
i32.eqz | ||
i32.eqz | ||
call $proc_exit | ||
) | ||
) | ||
|
||
(assert_return (invoke "_start")) |