diff options
Diffstat (limited to 'DevTools')
-rw-r--r-- | DevTools/UserspaceEmulator/Emulator.cpp | 16 | ||||
-rw-r--r-- | DevTools/UserspaceEmulator/Emulator.h | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/DevTools/UserspaceEmulator/Emulator.cpp b/DevTools/UserspaceEmulator/Emulator.cpp index 0430367e37..fe7d1afb72 100644 --- a/DevTools/UserspaceEmulator/Emulator.cpp +++ b/DevTools/UserspaceEmulator/Emulator.cpp @@ -286,6 +286,8 @@ u32 Emulator::virt_syscall(u32 function, u32 arg1, u32 arg2, u32 arg3) return virt$shbuf_set_volatile(arg1, arg2); case SC_mmap: return virt$mmap(arg1); + case SC_mount: + return virt$mount(arg1); case SC_munmap: return virt$munmap(arg1, arg2); case SC_gettid: @@ -819,6 +821,20 @@ u32 Emulator::virt$mmap(u32 params_addr) return final_address; } +u32 Emulator::virt$mount(u32 params_addr) +{ + Syscall::SC_mount_params params; + mmu().copy_from_vm(¶ms, params_addr, sizeof(params)); + auto target = mmu().copy_buffer_from_vm((FlatPtr)params.target.characters, params.target.length); + auto fs_path = mmu().copy_buffer_from_vm((FlatPtr)params.fs_type.characters, params.fs_type.length); + params.fs_type.characters = (char*)fs_path.data(); + params.fs_type.length = fs_path.size(); + params.target.characters = (char*)target.data(); + params.target.length = target.size(); + + return syscall(SC_mount, ¶ms); +} + u32 Emulator::virt$gettid() { return gettid(); diff --git a/DevTools/UserspaceEmulator/Emulator.h b/DevTools/UserspaceEmulator/Emulator.h index 1b55ebd3c6..0dcb1016f8 100644 --- a/DevTools/UserspaceEmulator/Emulator.h +++ b/DevTools/UserspaceEmulator/Emulator.h @@ -94,6 +94,7 @@ private: int virt$shbuf_seal(int shbuf_id); int virt$shbuf_set_volatile(int shbuf_id, bool); u32 virt$mmap(u32); + u32 virt$mount(u32); u32 virt$munmap(FlatPtr address, u32 size); u32 virt$gettid(); u32 virt$getpid(); |