blob: cbca87fa0ed15c8e715281371e2d6cf25e13c4ab (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2021 yuzu Emulator Project
#pragma once
#include <memory>
#include <mutex>
#include <unordered_map>
#include "common/common_types.h"
#include "core/hle/service/kernel_helpers.h"
#include "core/hle/service/nvflinger/binder.h"
namespace Core {
class System;
}
namespace Service::NVFlinger {
class HosBinderDriverServer final {
public:
explicit HosBinderDriverServer(Core::System& system_);
~HosBinderDriverServer();
u64 RegisterProducer(std::unique_ptr<android::IBinder>&& binder);
android::IBinder* TryGetProducer(u64 id);
private:
KernelHelpers::ServiceContext service_context;
std::unordered_map<u64, std::unique_ptr<android::IBinder>> producers;
std::mutex lock;
u64 last_id{};
};
} // namespace Service::NVFlinger
|