get mapmemory working

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
2023-12-31 16:38:53 +08:00
parent f54c3bdc6e
commit dfb33a95a1
5 changed files with 676 additions and 428 deletions

View File

@@ -22,6 +22,12 @@ pub enum Syscall {
i64, /* number of bytes to add */
i64, /* memory flags */
),
MapMemory(
i64, /* address */
i64, /* size */
i64, /* flags */
i64, /* name */
),
}
#[derive(Debug)]
@@ -50,6 +56,7 @@ impl From<[i64; 8]> for Syscall {
fn from(value: [i64; 8]) -> Self {
match value[0].into() {
SyscallNumber::IncreaseHeap => Syscall::IncreaseHeap(value[1], value[2]),
SyscallNumber::MapMemory => Syscall::MapMemory(value[1], value[2], value[3], value[4]),
_ => Syscall::Unknown(value),
}
}