From 33730cbd925c95e36461152a595a43de29409707 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Sat, 24 Oct 2020 11:20:36 +0330 Subject: UserspaceEmulator: Add support for some more ioctl() requests --- DevTools/UserspaceEmulator/Emulator.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'DevTools/UserspaceEmulator') diff --git a/DevTools/UserspaceEmulator/Emulator.cpp b/DevTools/UserspaceEmulator/Emulator.cpp index fe7d1afb72..5739636991 100644 --- a/DevTools/UserspaceEmulator/Emulator.cpp +++ b/DevTools/UserspaceEmulator/Emulator.cpp @@ -34,6 +34,8 @@ #include #include #include +#include +#include #include #include #include @@ -965,6 +967,25 @@ int Emulator::virt$ioctl(int fd, unsigned request, FlatPtr arg) mmu().copy_from_vm(&termios, arg, sizeof(termios)); return syscall(SC_ioctl, fd, request, &termios); } + if (request == TIOCNOTTY || request == TIOCSCTTY) { + return syscall(SC_ioctl, fd, request, 0); + } + if (request == FB_IOCTL_GET_SIZE_IN_BYTES) { + size_t size = 0; + auto rc = syscall(SC_ioctl, fd, request, &size); + mmu().copy_to_vm(arg, &size, sizeof(size)); + return rc; + } + if (request == FB_IOCTL_SET_RESOLUTION) { + FBResolution user_resolution; + mmu().copy_from_vm(&user_resolution, arg, sizeof(user_resolution)); + auto rc = syscall(SC_ioctl, fd, request, &user_resolution); + mmu().copy_to_vm(arg, &user_resolution, sizeof(user_resolution)); + return rc; + } + if (request == FB_IOCTL_SET_BUFFER) { + return syscall(SC_ioctl, fd, request, arg); + } reportln("Unsupported ioctl: {}", request); dump_backtrace(); TODO(); -- cgit v1.2.3