From bca88685bd75fa0bc5ad79d5e86193faebf21ae9 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Thu, 12 May 2022 17:38:06 +0100 Subject: [PATCH] Stub nvdrv {Get,Dump}Status --- .../skyline/services/nvdrv/INvDrvServices.cpp | 17 +++++++++++++++++ .../cpp/skyline/services/nvdrv/INvDrvServices.h | 13 +++++++++++++ 2 files changed, 30 insertions(+) diff --git a/app/src/main/cpp/skyline/services/nvdrv/INvDrvServices.cpp b/app/src/main/cpp/skyline/services/nvdrv/INvDrvServices.cpp index b7f52bba..e7578412 100644 --- a/app/src/main/cpp/skyline/services/nvdrv/INvDrvServices.cpp +++ b/app/src/main/cpp/skyline/services/nvdrv/INvDrvServices.cpp @@ -133,10 +133,27 @@ namespace skyline::service::nvdrv { return NVRESULT(driver.Ioctl3(fd, ioctl, *buf, inlineBuf)); } + Result INvDrvServices::GetStatus(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + struct Status { + u32 freeSize; + u32 allocatableSize; + u32 minimumFreeSize; + u32 minimumAllocatableSize; + u32 reserved; + }; + + // Return empty values since we don't use the transfer memory for allocations + response.Push({}); + return NVRESULT(NvResult::Success); + } + Result INvDrvServices::SetAruid(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { return NVRESULT(NvResult::Success); } + Result INvDrvServices::DumpStatus(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + return {}; + } Result INvDrvServices::SetGraphicsFirmwareMemoryMarginEnabled(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { return {}; diff --git a/app/src/main/cpp/skyline/services/nvdrv/INvDrvServices.h b/app/src/main/cpp/skyline/services/nvdrv/INvDrvServices.h index 86a297c6..a699b57c 100644 --- a/app/src/main/cpp/skyline/services/nvdrv/INvDrvServices.h +++ b/app/src/main/cpp/skyline/services/nvdrv/INvDrvServices.h @@ -53,12 +53,23 @@ namespace skyline::service::nvdrv { */ Result QueryEvent(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + /** + * @brief Returns info about the usage of the transfer memory by the internal allocator + * @url https://switchbrew.org/wiki/NV_services#GetStatus + */ + Result GetStatus(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + /** * @brief Sets the AppletResourceUserId which matches the PID * @url https://switchbrew.org/wiki/NV_services#SetAruid */ Result SetAruid(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + /** + * @url https://switchbrew.org/wiki/NV_services#DumpStatus + */ + Result DumpStatus(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + /** * @brief Perform an IOCTL on the specified FD with an extra input buffer * @url https://switchbrew.org/wiki/NV_services#Ioctl2 @@ -83,7 +94,9 @@ namespace skyline::service::nvdrv { SFUNC(0x2, INvDrvServices, Close), SFUNC(0x3, INvDrvServices, Initialize), SFUNC(0x4, INvDrvServices, QueryEvent), + SFUNC(0x6, INvDrvServices, GetStatus), SFUNC(0x8, INvDrvServices, SetAruid), + SFUNC(0x9, INvDrvServices, DumpStatus), SFUNC(0xB, INvDrvServices, Ioctl2), SFUNC(0xC, INvDrvServices, Ioctl3), SFUNC(0xD, INvDrvServices, SetGraphicsFirmwareMemoryMarginEnabled)