summaryrefslogtreecommitdiff
path: root/src/core/hle/service/aoc
diff options
context:
space:
mode:
authorGravatar bunnei2021-04-04 00:56:09 -0700
committerGravatar bunnei2021-05-05 16:40:50 -0700
commitaddc0bf0379e075786048921bede6e089552a6db (patch)
tree7fa8819b52db29e1b354410441dd8f2438e2ed4a /src/core/hle/service/aoc
parenthle: kernel: Migrate KSharedMemory to KAutoObject. (diff)
downloadyuzu-addc0bf0379e075786048921bede6e089552a6db.tar.gz
yuzu-addc0bf0379e075786048921bede6e089552a6db.tar.xz
yuzu-addc0bf0379e075786048921bede6e089552a6db.zip
hle: kernel: Migrate KEvent to KAutoObject.
Diffstat (limited to 'src/core/hle/service/aoc')
-rw-r--r--src/core/hle/service/aoc/aoc_u.cpp20
-rw-r--r--src/core/hle/service/aoc/aoc_u.h3
2 files changed, 10 insertions, 13 deletions
diff --git a/src/core/hle/service/aoc/aoc_u.cpp b/src/core/hle/service/aoc/aoc_u.cpp
index 75867e349..12a025610 100644
--- a/src/core/hle/service/aoc/aoc_u.cpp
+++ b/src/core/hle/service/aoc/aoc_u.cpp
@@ -16,7 +16,6 @@
16#include "core/file_sys/patch_manager.h" 16#include "core/file_sys/patch_manager.h"
17#include "core/file_sys/registered_cache.h" 17#include "core/file_sys/registered_cache.h"
18#include "core/hle/ipc_helpers.h" 18#include "core/hle/ipc_helpers.h"
19#include "core/hle/kernel/k_event.h"
20#include "core/hle/kernel/k_readable_event.h" 19#include "core/hle/kernel/k_readable_event.h"
21#include "core/hle/kernel/kernel.h" 20#include "core/hle/kernel/kernel.h"
22#include "core/hle/kernel/process.h" 21#include "core/hle/kernel/process.h"
@@ -50,7 +49,7 @@ static std::vector<u64> AccumulateAOCTitleIDs(Core::System& system) {
50class IPurchaseEventManager final : public ServiceFramework<IPurchaseEventManager> { 49class IPurchaseEventManager final : public ServiceFramework<IPurchaseEventManager> {
51public: 50public:
52 explicit IPurchaseEventManager(Core::System& system_) 51 explicit IPurchaseEventManager(Core::System& system_)
53 : ServiceFramework{system_, "IPurchaseEventManager"} { 52 : ServiceFramework{system_, "IPurchaseEventManager"}, purchased_event{system.Kernel()} {
54 // clang-format off 53 // clang-format off
55 static const FunctionInfo functions[] = { 54 static const FunctionInfo functions[] = {
56 {0, &IPurchaseEventManager::SetDefaultDeliveryTarget, "SetDefaultDeliveryTarget"}, 55 {0, &IPurchaseEventManager::SetDefaultDeliveryTarget, "SetDefaultDeliveryTarget"},
@@ -63,9 +62,7 @@ public:
63 62
64 RegisterHandlers(functions); 63 RegisterHandlers(functions);
65 64
66 purchased_event = 65 purchased_event.Initialize("IPurchaseEventManager:PurchasedEvent");
67 Kernel::KEvent::Create(system.Kernel(), "IPurchaseEventManager:PurchasedEvent");
68 purchased_event->Initialize();
69 } 66 }
70 67
71private: 68private:
@@ -98,14 +95,15 @@ private:
98 95
99 IPC::ResponseBuilder rb{ctx, 2, 1}; 96 IPC::ResponseBuilder rb{ctx, 2, 1};
100 rb.Push(RESULT_SUCCESS); 97 rb.Push(RESULT_SUCCESS);
101 rb.PushCopyObjects(purchased_event->GetReadableEvent()); 98 rb.PushCopyObjects(purchased_event.GetReadableEvent());
102 } 99 }
103 100
104 std::shared_ptr<Kernel::KEvent> purchased_event; 101 Kernel::KEvent purchased_event;
105}; 102};
106 103
107AOC_U::AOC_U(Core::System& system_) 104AOC_U::AOC_U(Core::System& system_)
108 : ServiceFramework{system_, "aoc:u"}, add_on_content{AccumulateAOCTitleIDs(system)} { 105 : ServiceFramework{system_, "aoc:u"}, add_on_content{AccumulateAOCTitleIDs(system)},
106 aoc_change_event{system.Kernel()} {
109 // clang-format off 107 // clang-format off
110 static const FunctionInfo functions[] = { 108 static const FunctionInfo functions[] = {
111 {0, nullptr, "CountAddOnContentByApplicationId"}, 109 {0, nullptr, "CountAddOnContentByApplicationId"},
@@ -127,9 +125,7 @@ AOC_U::AOC_U(Core::System& system_)
127 125
128 RegisterHandlers(functions); 126 RegisterHandlers(functions);
129 127
130 auto& kernel = system.Kernel(); 128 aoc_change_event.Initialize("GetAddOnContentListChanged:Event");
131 aoc_change_event = Kernel::KEvent::Create(kernel, "GetAddOnContentListChanged:Event");
132 aoc_change_event->Initialize();
133} 129}
134 130
135AOC_U::~AOC_U() = default; 131AOC_U::~AOC_U() = default;
@@ -256,7 +252,7 @@ void AOC_U::GetAddOnContentListChangedEvent(Kernel::HLERequestContext& ctx) {
256 252
257 IPC::ResponseBuilder rb{ctx, 2, 1}; 253 IPC::ResponseBuilder rb{ctx, 2, 1};
258 rb.Push(RESULT_SUCCESS); 254 rb.Push(RESULT_SUCCESS);
259 rb.PushCopyObjects(aoc_change_event->GetReadableEvent()); 255 rb.PushCopyObjects(aoc_change_event.GetReadableEvent());
260} 256}
261 257
262void AOC_U::CreateEcPurchasedEventManager(Kernel::HLERequestContext& ctx) { 258void AOC_U::CreateEcPurchasedEventManager(Kernel::HLERequestContext& ctx) {
diff --git a/src/core/hle/service/aoc/aoc_u.h b/src/core/hle/service/aoc/aoc_u.h
index 1aa23529e..65095baa2 100644
--- a/src/core/hle/service/aoc/aoc_u.h
+++ b/src/core/hle/service/aoc/aoc_u.h
@@ -4,6 +4,7 @@
4 4
5#pragma once 5#pragma once
6 6
7#include "core/hle/kernel/k_event.h"
7#include "core/hle/service/service.h" 8#include "core/hle/service/service.h"
8 9
9namespace Core { 10namespace Core {
@@ -31,7 +32,7 @@ private:
31 void CreatePermanentEcPurchasedEventManager(Kernel::HLERequestContext& ctx); 32 void CreatePermanentEcPurchasedEventManager(Kernel::HLERequestContext& ctx);
32 33
33 std::vector<u64> add_on_content; 34 std::vector<u64> add_on_content;
34 std::shared_ptr<Kernel::KEvent> aoc_change_event; 35 Kernel::KEvent aoc_change_event;
35}; 36};
36 37
37/// Registers all AOC services with the specified service manager. 38/// Registers all AOC services with the specified service manager.