Skip to content

Commit

Permalink
Add simple perceptron program and wasi fd_prestat_set_flags
Browse files Browse the repository at this point in the history
Signed-off-by: Ádám Kulcsár <[email protected]>
  • Loading branch information
kulcsaradam committed Jan 7, 2025
1 parent 9637530 commit 90c56e0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/wasi/WASI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,15 @@ void WASI::fd_prestat_get(ExecutionState& state, Value* argv, Value* result, Ins
result[0] = Value(uvwasi_fd_prestat_get(WASI::g_uvwasi, fd, buf));
}


void WASI::fd_fdstat_set_flags(ExecutionState& state, Value* argv, Value* result, Instance* instance)
{
uint32_t fd = argv[0].asI32();
uint32_t flags = argv[1].asI32();

result[0] = Value(uvwasi_fd_fdstat_set_flags(WASI::g_uvwasi, fd, flags));
}

void WASI::fd_prestat_dir_name(ExecutionState& state, Value* argv, Value* result, Instance* instance)
{
uint32_t fd = argv[0].asI32();
Expand Down
1 change: 1 addition & 0 deletions src/wasi/WASI.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class WASI {
F(fd_read, I32I32I32I32_RI32) \
F(fd_close, I32_RI32) \
F(fd_fdstat_get, I32I32_RI32) \
F(fd_fdstat_set_flags, I32I32_RI32) \
F(fd_prestat_dir_name, I32I32I32_RI32) \
F(fd_prestat_get, I32I32_RI32) \
F(fd_seek, I32I64I32I32_RI32) \
Expand Down
1 change: 1 addition & 0 deletions test/programs/perceptronAlgorithm
Submodule perceptronAlgorithm added at 968157

0 comments on commit 90c56e0

Please sign in to comment.