UserspaceEmulator: Add stub for sys$futex

This commit is contained in:
Gunnar Beutner 2021-05-03 00:41:38 +02:00 committed by Andreas Kling
parent 8b5ea01cfb
commit ce0c76dcb5
Notes: sideshowbarker 2024-07-18 18:45:50 +09:00
2 changed files with 11 additions and 0 deletions

View file

@ -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);

View file

@ -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;
}
}