diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2024-02-27 18:26:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-27 18:26:26 +0100 |
commit | dc94882c9062ab88d3d5de35dcb8731111baaea2 (patch) | |
tree | b00be6f4a4b2c826f116e212e15f4498e4b50504 /src/core/hle/service/hid/applet_resource.cpp | |
parent | Merge pull request #13175 from liamwhite/asan (diff) | |
parent | service: hid: Migrate HidServer to new IPC (diff) | |
download | yuzu-dc94882c9062ab88d3d5de35dcb8731111baaea2.tar yuzu-dc94882c9062ab88d3d5de35dcb8731111baaea2.tar.gz yuzu-dc94882c9062ab88d3d5de35dcb8731111baaea2.tar.bz2 yuzu-dc94882c9062ab88d3d5de35dcb8731111baaea2.tar.lz yuzu-dc94882c9062ab88d3d5de35dcb8731111baaea2.tar.xz yuzu-dc94882c9062ab88d3d5de35dcb8731111baaea2.tar.zst yuzu-dc94882c9062ab88d3d5de35dcb8731111baaea2.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/hid/applet_resource.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/core/hle/service/hid/applet_resource.cpp b/src/core/hle/service/hid/applet_resource.cpp new file mode 100644 index 000000000..4814d7ad5 --- /dev/null +++ b/src/core/hle/service/hid/applet_resource.cpp @@ -0,0 +1,34 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "common/logging/log.h" +#include "core/hle/kernel/k_shared_memory.h" +#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/hid/applet_resource.h" +#include "hid_core/resource_manager.h" + +namespace Service::HID { + +IAppletResource::IAppletResource(Core::System& system_, std::shared_ptr<ResourceManager> resource, + u64 applet_resource_user_id) + : ServiceFramework{system_, "IAppletResource"}, aruid{applet_resource_user_id}, + resource_manager{resource} { + static const FunctionInfo functions[] = { + {0, C<&IAppletResource::GetSharedMemoryHandle>, "GetSharedMemoryHandle"}, + }; + RegisterHandlers(functions); +} + +IAppletResource::~IAppletResource() { + resource_manager->FreeAppletResourceId(aruid); +} + +Result IAppletResource::GetSharedMemoryHandle( + OutCopyHandle<Kernel::KSharedMemory> out_shared_memory_handle) { + const auto result = resource_manager->GetSharedMemoryHandle(out_shared_memory_handle, aruid); + + LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}, result=0x{:X}", aruid, result.raw); + R_RETURN(result); +} + +} // namespace Service::HID |