diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2024-02-22 18:58:52 +0100 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2024-02-24 00:49:02 +0100 |
commit | d08f201e0c0e6d36176983f9673a89550705952b (patch) | |
tree | 93229a986e75f1962d0665dd05a8d2813a8c9ce7 /src/core/hle/service/hid/applet_resource.cpp | |
parent | Merge pull request #13141 from liamwhite/swap (diff) | |
download | yuzu-d08f201e0c0e6d36176983f9673a89550705952b.tar yuzu-d08f201e0c0e6d36176983f9673a89550705952b.tar.gz yuzu-d08f201e0c0e6d36176983f9673a89550705952b.tar.bz2 yuzu-d08f201e0c0e6d36176983f9673a89550705952b.tar.lz yuzu-d08f201e0c0e6d36176983f9673a89550705952b.tar.xz yuzu-d08f201e0c0e6d36176983f9673a89550705952b.tar.zst yuzu-d08f201e0c0e6d36176983f9673a89550705952b.zip |
Diffstat (limited to 'src/core/hle/service/hid/applet_resource.cpp')
-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 |