diff options
| author | bunnei <bunneidev@gmail.com> | 2021-03-29 12:53:55 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-29 12:53:55 -0700 |
| commit | fb7dcbf7af4fc718bccd3641dcdf997a4310da53 (patch) | |
| tree | c5a8bd45de1f318f36c0b876898d8b716f143679 /src/core/hle/service/nvdrv/nvdrv.cpp | |
| parent | a63dcb6d56a6aac433da276e55cfb3b6b96fe065 (diff) | |
| parent | 99fdfa1fcdcdba6abcc04733dc2bacd92b285f0a (diff) | |
Merge pull request #6102 from ogniK5377/fd-pass
nvdrv: Pass device fd and handle device create methods for device opening and closing
Diffstat (limited to 'src/core/hle/service/nvdrv/nvdrv.cpp')
| -rw-r--r-- | src/core/hle/service/nvdrv/nvdrv.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/hle/service/nvdrv/nvdrv.cpp b/src/core/hle/service/nvdrv/nvdrv.cpp index abba80112..ede77858a 100644 --- a/src/core/hle/service/nvdrv/nvdrv.cpp +++ b/src/core/hle/service/nvdrv/nvdrv.cpp @@ -89,6 +89,8 @@ DeviceFD Module::Open(const std::string& device_name) { auto device = devices[device_name]; const DeviceFD fd = next_fd++; + device->OnOpen(fd); + open_files[fd] = std::move(device); return fd; @@ -108,7 +110,7 @@ NvResult Module::Ioctl1(DeviceFD fd, Ioctl command, const std::vector<u8>& input return NvResult::NotImplemented; } - return itr->second->Ioctl1(command, input, output); + return itr->second->Ioctl1(fd, command, input, output); } NvResult Module::Ioctl2(DeviceFD fd, Ioctl command, const std::vector<u8>& input, @@ -125,7 +127,7 @@ NvResult Module::Ioctl2(DeviceFD fd, Ioctl command, const std::vector<u8>& input return NvResult::NotImplemented; } - return itr->second->Ioctl2(command, input, inline_input, output); + return itr->second->Ioctl2(fd, command, input, inline_input, output); } NvResult Module::Ioctl3(DeviceFD fd, Ioctl command, const std::vector<u8>& input, @@ -142,7 +144,7 @@ NvResult Module::Ioctl3(DeviceFD fd, Ioctl command, const std::vector<u8>& input return NvResult::NotImplemented; } - return itr->second->Ioctl3(command, input, output, inline_output); + return itr->second->Ioctl3(fd, command, input, output, inline_output); } NvResult Module::Close(DeviceFD fd) { @@ -158,6 +160,8 @@ NvResult Module::Close(DeviceFD fd) { return NvResult::NotImplemented; } + itr->second->OnClose(fd); + open_files.erase(itr); return NvResult::Success; |
