From 31c12de0fecec5889020191ca6de0b7fbf8c51ba Mon Sep 17 00:00:00 2001 From: Chloe Marcec Date: Sun, 8 Nov 2020 19:11:34 +1100 Subject: core: Make nvservices more standardized --- src/core/hle/service/nvdrv/nvdrv.h | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'src/core/hle/service/nvdrv/nvdrv.h') diff --git a/src/core/hle/service/nvdrv/nvdrv.h b/src/core/hle/service/nvdrv/nvdrv.h index f3d863dac..3ccc62a76 100644 --- a/src/core/hle/service/nvdrv/nvdrv.h +++ b/src/core/hle/service/nvdrv/nvdrv.h @@ -112,14 +112,23 @@ public: return std::static_pointer_cast(itr->second); } + NvResult VerifyFd(DeviceFD fd) const; + /// Opens a device node and returns a file descriptor to it. - u32 Open(const std::string& device_name); + DeviceFD Open(const std::string& device_name); + /// Sends an ioctl command to the specified file descriptor. - u32 Ioctl(u32 fd, u32 command, const std::vector& input, const std::vector& input2, - std::vector& output, std::vector& output2, IoctlCtrl& ctrl, - IoctlVersion version); + NvResult Ioctl1(DeviceFD fd, Ioctl command, const std::vector& input, + std::vector& output); + + NvResult Ioctl2(DeviceFD fd, Ioctl command, const std::vector& input, + const std::vector& inline_input, std::vector& output); + + NvResult Ioctl3(DeviceFD fd, Ioctl command, const std::vector& input, + std::vector& output, std::vector& inline_output); + /// Closes a device file descriptor and returns operation success. - ResultCode Close(u32 fd); + NvResult Close(DeviceFD fd); void SignalSyncpt(const u32 syncpoint_id, const u32 value); @@ -132,10 +141,10 @@ private: SyncpointManager syncpoint_manager; /// Id to use for the next open file descriptor. - u32 next_fd = 1; + DeviceFD next_fd = 1; /// Mapping of file descriptors to the devices they reference. - std::unordered_map> open_files; + std::unordered_map> open_files; /// Mapping of device node names to their implementation. std::unordered_map> devices; -- cgit v1.2.3