diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2024-02-16 19:11:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-16 19:11:02 +0100 |
commit | 6e2678a42cb4a0ad02a7c8959621b0c98353c572 (patch) | |
tree | e1d71c4545dacdc7940c2a8b67ea534c6e52d58a /src/core/hle/service/vi/hos_binder_driver.cpp | |
parent | Merge pull request #12996 from german77/settings-ipc (diff) | |
parent | vi: rewrite IApplicationDisplayService (diff) | |
download | yuzu-6e2678a42cb4a0ad02a7c8959621b0c98353c572.tar yuzu-6e2678a42cb4a0ad02a7c8959621b0c98353c572.tar.gz yuzu-6e2678a42cb4a0ad02a7c8959621b0c98353c572.tar.bz2 yuzu-6e2678a42cb4a0ad02a7c8959621b0c98353c572.tar.lz yuzu-6e2678a42cb4a0ad02a7c8959621b0c98353c572.tar.xz yuzu-6e2678a42cb4a0ad02a7c8959621b0c98353c572.tar.zst yuzu-6e2678a42cb4a0ad02a7c8959621b0c98353c572.zip |
Diffstat (limited to 'src/core/hle/service/vi/hos_binder_driver.cpp')
-rw-r--r-- | src/core/hle/service/vi/hos_binder_driver.cpp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/core/hle/service/vi/hos_binder_driver.cpp b/src/core/hle/service/vi/hos_binder_driver.cpp new file mode 100644 index 000000000..ba0317245 --- /dev/null +++ b/src/core/hle/service/vi/hos_binder_driver.cpp @@ -0,0 +1,53 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/nvnflinger/binder.h" +#include "core/hle/service/nvnflinger/hos_binder_driver_server.h" +#include "core/hle/service/vi/hos_binder_driver.h" + +namespace Service::VI { + +IHOSBinderDriver::IHOSBinderDriver(Core::System& system_, Nvnflinger::HosBinderDriverServer& server) + : ServiceFramework{system_, "IHOSBinderDriver"}, m_server(server) { + static const FunctionInfo functions[] = { + {0, C<&IHOSBinderDriver::TransactParcel>, "TransactParcel"}, + {1, C<&IHOSBinderDriver::AdjustRefcount>, "AdjustRefcount"}, + {2, C<&IHOSBinderDriver::GetNativeHandle>, "GetNativeHandle"}, + {3, C<&IHOSBinderDriver::TransactParcelAuto>, "TransactParcelAuto"}, + }; + RegisterHandlers(functions); +} + +IHOSBinderDriver::~IHOSBinderDriver() = default; + +Result IHOSBinderDriver::TransactParcel(s32 binder_id, android::TransactionId transaction_id, + InBuffer<BufferAttr_HipcMapAlias> parcel_data, + OutBuffer<BufferAttr_HipcMapAlias> parcel_reply, + u32 flags) { + LOG_DEBUG(Service_VI, "called. id={} transaction={}, flags={}", binder_id, transaction_id, + flags); + m_server.TryGetProducer(binder_id)->Transact(transaction_id, flags, parcel_data, parcel_reply); + R_SUCCEED(); +} + +Result IHOSBinderDriver::AdjustRefcount(s32 binder_id, s32 addval, s32 type) { + LOG_WARNING(Service_VI, "(STUBBED) called id={}, addval={}, type={}", binder_id, addval, type); + R_SUCCEED(); +} + +Result IHOSBinderDriver::GetNativeHandle(s32 binder_id, u32 type_id, + OutCopyHandle<Kernel::KReadableEvent> out_handle) { + LOG_WARNING(Service_VI, "(STUBBED) called id={}, type_id={}", binder_id, type_id); + *out_handle = &m_server.TryGetProducer(binder_id)->GetNativeHandle(); + R_SUCCEED(); +} + +Result IHOSBinderDriver::TransactParcelAuto(s32 binder_id, android::TransactionId transaction_id, + InBuffer<BufferAttr_HipcAutoSelect> parcel_data, + OutBuffer<BufferAttr_HipcAutoSelect> parcel_reply, + u32 flags) { + R_RETURN(this->TransactParcel(binder_id, transaction_id, parcel_data, parcel_reply, flags)); +} + +} // namespace Service::VI |