summaryrefslogtreecommitdiff
path: root/Userland/DevTools/UserspaceEmulator
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-05-03 00:41:38 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-03 08:25:44 +0200
commitce0c76dcb596b1b0e68cd644841ed6daf09bf4b4 (patch)
tree8923356c3d65cf4563d70f4a18722aaa4f55a1bb /Userland/DevTools/UserspaceEmulator
parent8b5ea01cfb936b8fc2f586d0ea6f94352504ba62 (diff)
downloadserenity-ce0c76dcb596b1b0e68cd644841ed6daf09bf4b4.zip
UserspaceEmulator: Add stub for sys$futex
Diffstat (limited to 'Userland/DevTools/UserspaceEmulator')
-rw-r--r--Userland/DevTools/UserspaceEmulator/Emulator.h1
-rw-r--r--Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp10
2 files changed, 11 insertions, 0 deletions
diff --git a/Userland/DevTools/UserspaceEmulator/Emulator.h b/Userland/DevTools/UserspaceEmulator/Emulator.h
index 0fe3191aad..5cc02aaa30 100644
--- a/Userland/DevTools/UserspaceEmulator/Emulator.h
+++ b/Userland/DevTools/UserspaceEmulator/Emulator.h
@@ -169,6 +169,7 @@ private:
int virt$recvfd(int, int);
int virt$sendfd(int, int);
int virt$msyscall(FlatPtr);
+ int virt$futex(FlatPtr);
bool find_malloc_symbols(const MmapRegion& libc_text);
diff --git a/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp b/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp
index 090533b937..4eea04b2b2 100644
--- a/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp
+++ b/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp
@@ -242,6 +242,8 @@ u32 Emulator::virt_syscall(u32 function, u32 arg1, u32 arg2, u32 arg3)
return virt$chown(arg1);
case SC_msyscall:
return virt$msyscall(arg1);
+ case SC_futex:
+ return virt$futex(arg1);
default:
reportln("\n=={}== \033[31;1mUnimplemented syscall: {}\033[0m, {:p}", getpid(), Syscall::to_string((Syscall::Function)function), function);
dump_backtrace();
@@ -1463,4 +1465,12 @@ int Emulator::virt$msyscall(FlatPtr)
return 0;
}
+int Emulator::virt$futex(FlatPtr params_addr)
+{
+ Syscall::SC_futex_params params;
+ mmu().copy_from_vm(&params, params_addr, sizeof(params));
+
+ // FIXME: Implement this.
+ return 0;
+}
}