diff options
author | Brendan Coles <bcoles@gmail.com> | 2020-12-21 05:40:56 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-12-21 09:57:51 +0100 |
commit | 9ca34c3047ee9539172e43dac526c82ecaa0ff38 (patch) | |
tree | 64775189b2fb828a71c43393ac05404756895110 /DevTools | |
parent | 39c92dad83dc2e933ed6f55cf59a782676301c52 (diff) | |
download | serenity-9ca34c3047ee9539172e43dac526c82ecaa0ff38.zip |
UserspaceEmulator: Implement profiling, disown, purge syscalls
Diffstat (limited to 'DevTools')
-rw-r--r-- | DevTools/UserspaceEmulator/Emulator.cpp | 28 | ||||
-rw-r--r-- | DevTools/UserspaceEmulator/Emulator.h | 4 |
2 files changed, 32 insertions, 0 deletions
diff --git a/DevTools/UserspaceEmulator/Emulator.cpp b/DevTools/UserspaceEmulator/Emulator.cpp index edf5950559..0436fbebd4 100644 --- a/DevTools/UserspaceEmulator/Emulator.cpp +++ b/DevTools/UserspaceEmulator/Emulator.cpp @@ -395,6 +395,14 @@ u32 Emulator::virt_syscall(u32 function, u32 arg1, u32 arg2, u32 arg3) return virt$shbuf_seal(arg1); case SC_shbuf_set_volatile: return virt$shbuf_set_volatile(arg1, arg2); + case SC_profiling_enable: + return virt$profiling_enable(arg1); + case SC_profiling_disable: + return virt$profiling_disable(arg1); + case SC_disown: + return virt$disown(arg1); + case SC_purge: + return virt$purge(arg1); case SC_mmap: return virt$mmap(arg1); case SC_mount: @@ -590,6 +598,26 @@ int Emulator::virt$shbuf_set_volatile(int shbuf_id, bool is_volatile) return region->set_volatile(is_volatile); } +int Emulator::virt$profiling_enable(pid_t pid) +{ + return syscall(SC_profiling_enable, pid); +} + +int Emulator::virt$profiling_disable(pid_t pid) +{ + return syscall(SC_profiling_disable, pid); +} + +int Emulator::virt$disown(pid_t pid) +{ + return syscall(SC_disown, pid); +} + +int Emulator::virt$purge(int mode) +{ + return syscall(SC_purge, mode); +} + int Emulator::virt$fstat(int fd, FlatPtr statbuf) { struct stat local_statbuf; diff --git a/DevTools/UserspaceEmulator/Emulator.h b/DevTools/UserspaceEmulator/Emulator.h index aa43fdf2f1..2dfe223ce4 100644 --- a/DevTools/UserspaceEmulator/Emulator.h +++ b/DevTools/UserspaceEmulator/Emulator.h @@ -98,6 +98,10 @@ private: int virt$shbuf_release(int shbuf_id); int virt$shbuf_seal(int shbuf_id); int virt$shbuf_set_volatile(int shbuf_id, bool); + int virt$profiling_enable(pid_t); + int virt$profiling_disable(pid_t); + int virt$disown(pid_t); + int virt$purge(int mode); u32 virt$mmap(u32); u32 virt$mount(u32); u32 virt$munmap(FlatPtr address, u32 size); |