diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp | 14 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_ctrl.h | 11 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp index ee99ab280..45711d686 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp | |||
| @@ -17,6 +17,8 @@ u32 nvhost_ctrl::ioctl(Ioctl command, const std::vector<u8>& input, std::vector< | |||
| 17 | switch (static_cast<IoctlCommand>(command.raw)) { | 17 | switch (static_cast<IoctlCommand>(command.raw)) { |
| 18 | case IoctlCommand::IocGetConfigCommand: | 18 | case IoctlCommand::IocGetConfigCommand: |
| 19 | return NvOsGetConfigU32(input, output); | 19 | return NvOsGetConfigU32(input, output); |
| 20 | case IoctlCommand::IocCtrlEventWaitCommand: | ||
| 21 | return IocCtrlEventWait(input, output); | ||
| 20 | } | 22 | } |
| 21 | UNIMPLEMENTED(); | 23 | UNIMPLEMENTED(); |
| 22 | return 0; | 24 | return 0; |
| @@ -45,6 +47,18 @@ u32 nvhost_ctrl::NvOsGetConfigU32(const std::vector<u8>& input, std::vector<u8>& | |||
| 45 | return 0; | 47 | return 0; |
| 46 | } | 48 | } |
| 47 | 49 | ||
| 50 | u32 nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>& output) { | ||
| 51 | IocCtrlEventWaitParams params{}; | ||
| 52 | std::memcpy(¶ms, input.data(), sizeof(params)); | ||
| 53 | LOG_WARNING(Service_NVDRV, "(STUBBED) called, syncpt_id=%u threshold=%u timeout=%d", | ||
| 54 | params.syncpt_id, params.threshold, params.timeout); | ||
| 55 | |||
| 56 | // TODO(Subv): Implement actual syncpt waiting. | ||
| 57 | params.value = 0; | ||
| 58 | std::memcpy(output.data(), ¶ms, sizeof(params)); | ||
| 59 | return 0; | ||
| 60 | } | ||
| 61 | |||
| 48 | } // namespace Devices | 62 | } // namespace Devices |
| 49 | } // namespace Nvidia | 63 | } // namespace Nvidia |
| 50 | } // namespace Service | 64 | } // namespace Service |
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.h b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.h index fd02a5e45..0ca01aa6d 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.h +++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.h | |||
| @@ -31,6 +31,7 @@ private: | |||
| 31 | IocModuleRegRDWRCommand = 0xC008010E, | 31 | IocModuleRegRDWRCommand = 0xC008010E, |
| 32 | IocSyncptWaitexCommand = 0xC0100019, | 32 | IocSyncptWaitexCommand = 0xC0100019, |
| 33 | IocSyncptReadMaxCommand = 0xC008001A, | 33 | IocSyncptReadMaxCommand = 0xC008001A, |
| 34 | IocCtrlEventWaitCommand = 0xC010001D, | ||
| 34 | IocGetConfigCommand = 0xC183001B, | 35 | IocGetConfigCommand = 0xC183001B, |
| 35 | }; | 36 | }; |
| 36 | 37 | ||
| @@ -41,7 +42,17 @@ private: | |||
| 41 | }; | 42 | }; |
| 42 | static_assert(sizeof(IocGetConfigParams) == 387, "IocGetConfigParams is incorrect size"); | 43 | static_assert(sizeof(IocGetConfigParams) == 387, "IocGetConfigParams is incorrect size"); |
| 43 | 44 | ||
| 45 | struct IocCtrlEventWaitParams { | ||
| 46 | u32_le syncpt_id; | ||
| 47 | u32_le threshold; | ||
| 48 | s32_le timeout; | ||
| 49 | u32_le value; | ||
| 50 | }; | ||
| 51 | static_assert(sizeof(IocCtrlEventWaitParams) == 16, "IocCtrlEventWaitParams is incorrect size"); | ||
| 52 | |||
| 44 | u32 NvOsGetConfigU32(const std::vector<u8>& input, std::vector<u8>& output); | 53 | u32 NvOsGetConfigU32(const std::vector<u8>& input, std::vector<u8>& output); |
| 54 | |||
| 55 | u32 IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>& output); | ||
| 45 | }; | 56 | }; |
| 46 | 57 | ||
| 47 | } // namespace Devices | 58 | } // namespace Devices |