summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/am/applets
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-11-27 00:34:07 +0100
committerZach Hilman <zachhilman@gmail.com>2018-11-29 14:45:41 +0100
commitff610103b58b3e0dd39fafb539a1cc0bc0fae577 (patch)
treecbd54b09f9270f6f1d92a2f45a5ccdb307569093 /src/core/hle/service/am/applets
parenthle_ipc: Use event pair for SleepClientThread (diff)
downloadyuzu-ff610103b58b3e0dd39fafb539a1cc0bc0fae577.tar
yuzu-ff610103b58b3e0dd39fafb539a1cc0bc0fae577.tar.gz
yuzu-ff610103b58b3e0dd39fafb539a1cc0bc0fae577.tar.bz2
yuzu-ff610103b58b3e0dd39fafb539a1cc0bc0fae577.tar.lz
yuzu-ff610103b58b3e0dd39fafb539a1cc0bc0fae577.tar.xz
yuzu-ff610103b58b3e0dd39fafb539a1cc0bc0fae577.tar.zst
yuzu-ff610103b58b3e0dd39fafb539a1cc0bc0fae577.zip
Diffstat (limited to 'src/core/hle/service/am/applets')
-rw-r--r--src/core/hle/service/am/applets/applets.cpp31
-rw-r--r--src/core/hle/service/am/applets/applets.h17
2 files changed, 28 insertions, 20 deletions
diff --git a/src/core/hle/service/am/applets/applets.cpp b/src/core/hle/service/am/applets/applets.cpp
index becbadd06..494205322 100644
--- a/src/core/hle/service/am/applets/applets.cpp
+++ b/src/core/hle/service/am/applets/applets.cpp
@@ -5,8 +5,9 @@
#include <cstring>
#include "common/assert.h"
#include "core/core.h"
-#include "core/hle/kernel/event.h"
+#include "core/hle/kernel/readable_event.h"
#include "core/hle/kernel/server_port.h"
+#include "core/hle/kernel/writable_event.h"
#include "core/hle/service/am/am.h"
#include "core/hle/service/am/applets/applets.h"
@@ -14,11 +15,11 @@ namespace Service::AM::Applets {
AppletDataBroker::AppletDataBroker() {
auto& kernel = Core::System::GetInstance().Kernel();
- state_changed_event = Kernel::Event::Create(kernel, Kernel::ResetType::OneShot,
- "ILibraryAppletAccessor:StateChangedEvent");
- pop_out_data_event = Kernel::Event::Create(kernel, Kernel::ResetType::OneShot,
- "ILibraryAppletAccessor:PopDataOutEvent");
- pop_interactive_out_data_event = Kernel::Event::Create(
+ state_changed_event = Kernel::WritableEvent::CreateRegisteredEventPair(
+ kernel, Kernel::ResetType::OneShot, "ILibraryAppletAccessor:StateChangedEvent");
+ pop_out_data_event = Kernel::WritableEvent::CreateRegisteredEventPair(
+ kernel, Kernel::ResetType::OneShot, "ILibraryAppletAccessor:PopDataOutEvent");
+ pop_interactive_out_data_event = Kernel::WritableEvent::CreateRegisteredEventPair(
kernel, Kernel::ResetType::OneShot, "ILibraryAppletAccessor:PopInteractiveDataOutEvent");
}
@@ -82,16 +83,22 @@ void AppletDataBroker::SignalStateChanged() const {
state_changed_event->Signal();
}
-Kernel::SharedPtr<Kernel::Event> AppletDataBroker::GetNormalDataEvent() const {
- return pop_out_data_event;
+Kernel::SharedPtr<Kernel::ReadableEvent> AppletDataBroker::GetNormalDataEvent() const {
+ const auto& event{Core::System::GetInstance().Kernel().FindNamedEvent(
+ "ILibraryAppletAccessor:PopDataOutEvent")};
+ return event->second;
}
-Kernel::SharedPtr<Kernel::Event> AppletDataBroker::GetInteractiveDataEvent() const {
- return pop_interactive_out_data_event;
+Kernel::SharedPtr<Kernel::ReadableEvent> AppletDataBroker::GetInteractiveDataEvent() const {
+ const auto& event{Core::System::GetInstance().Kernel().FindNamedEvent(
+ "ILibraryAppletAccessor:PopInteractiveDataOutEvent")};
+ return event->second;
}
-Kernel::SharedPtr<Kernel::Event> AppletDataBroker::GetStateChangedEvent() const {
- return state_changed_event;
+Kernel::SharedPtr<Kernel::ReadableEvent> AppletDataBroker::GetStateChangedEvent() const {
+ const auto& event{Core::System::GetInstance().Kernel().FindNamedEvent(
+ "ILibraryAppletAccessor:StateChangedEvent")};
+ return event->second;
}
Applet::Applet() = default;
diff --git a/src/core/hle/service/am/applets/applets.h b/src/core/hle/service/am/applets/applets.h
index f65ea119c..5cd6232cc 100644
--- a/src/core/hle/service/am/applets/applets.h
+++ b/src/core/hle/service/am/applets/applets.h
@@ -12,8 +12,9 @@
union ResultCode;
namespace Kernel {
-class Event;
-}
+class ReadableEvent;
+class WritableEvent;
+} // namespace Kernel
namespace Service::AM {
@@ -40,9 +41,9 @@ public:
void SignalStateChanged() const;
- Kernel::SharedPtr<Kernel::Event> GetNormalDataEvent() const;
- Kernel::SharedPtr<Kernel::Event> GetInteractiveDataEvent() const;
- Kernel::SharedPtr<Kernel::Event> GetStateChangedEvent() const;
+ Kernel::SharedPtr<Kernel::ReadableEvent> GetNormalDataEvent() const;
+ Kernel::SharedPtr<Kernel::ReadableEvent> GetInteractiveDataEvent() const;
+ Kernel::SharedPtr<Kernel::ReadableEvent> GetStateChangedEvent() const;
private:
// Queues are named from applet's perspective
@@ -59,13 +60,13 @@ private:
// PopInteractiveDataToGame and PushInteractiveDataFromApplet
std::queue<std::unique_ptr<IStorage>> out_interactive_channel;
- Kernel::SharedPtr<Kernel::Event> state_changed_event;
+ Kernel::SharedPtr<Kernel::WritableEvent> state_changed_event;
// Signaled on PushNormalDataFromApplet
- Kernel::SharedPtr<Kernel::Event> pop_out_data_event;
+ Kernel::SharedPtr<Kernel::WritableEvent> pop_out_data_event;
// Signaled on PushInteractiveDataFromApplet
- Kernel::SharedPtr<Kernel::Event> pop_interactive_out_data_event;
+ Kernel::SharedPtr<Kernel::WritableEvent> pop_interactive_out_data_event;
};
class Applet {