summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-11-29 15:14:12 +0100
committerZach Hilman <zachhilman@gmail.com>2018-11-29 15:14:20 +0100
commit170d7078507745fee4c8952aa5888108b2b76b91 (patch)
tree6bc3c4cbbe36518a7e9b8e62a6b4042cb420861e
parentkernel/event: Reference ReadableEvent from WritableEvent (diff)
downloadyuzu-170d7078507745fee4c8952aa5888108b2b76b91.tar
yuzu-170d7078507745fee4c8952aa5888108b2b76b91.tar.gz
yuzu-170d7078507745fee4c8952aa5888108b2b76b91.tar.bz2
yuzu-170d7078507745fee4c8952aa5888108b2b76b91.tar.lz
yuzu-170d7078507745fee4c8952aa5888108b2b76b91.tar.xz
yuzu-170d7078507745fee4c8952aa5888108b2b76b91.tar.zst
yuzu-170d7078507745fee4c8952aa5888108b2b76b91.zip
-rw-r--r--src/core/hle/kernel/hle_ipc.cpp6
-rw-r--r--src/core/hle/kernel/hle_ipc.h4
-rw-r--r--src/core/hle/kernel/kernel.cpp2
-rw-r--r--src/core/hle/kernel/writable_event.cpp4
-rw-r--r--src/core/hle/kernel/writable_event.h2
-rw-r--r--src/core/hle/service/am/am.cpp1
-rw-r--r--src/core/hle/service/am/applets/applets.h6
-rw-r--r--src/core/hle/service/nfp/nfp.h1
-rw-r--r--src/core/hle/service/vi/vi.cpp2
9 files changed, 14 insertions, 14 deletions
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp
index 21fda42d6..61ce7d7e4 100644
--- a/src/core/hle/kernel/hle_ipc.cpp
+++ b/src/core/hle/kernel/hle_ipc.cpp
@@ -39,7 +39,7 @@ void SessionRequestHandler::ClientDisconnected(const SharedPtr<ServerSession>& s
SharedPtr<WritableEvent> HLERequestContext::SleepClientThread(
SharedPtr<Thread> thread, const std::string& reason, u64 timeout, WakeupCallback&& callback,
- SharedPtr<WritableEvent> writable_event, SharedPtr<ReadableEvent> readable_event) {
+ SharedPtr<WritableEvent> writable_event) {
// Put the client thread to sleep until the wait event is signaled or the timeout expires.
thread->SetWakeupCallback([context = *this, callback](
ThreadWakeupReason reason, SharedPtr<Thread> thread,
@@ -51,14 +51,14 @@ SharedPtr<WritableEvent> HLERequestContext::SleepClientThread(
});
auto& kernel = Core::System::GetInstance().Kernel();
- if (!writable_event || !readable_event) {
+ if (!writable_event) {
// Create event if not provided
const auto pair = WritableEvent::CreateEventPair(kernel, Kernel::ResetType::OneShot,
"HLE Pause Event: " + reason);
writable_event = pair.writable;
- readable_event = pair.readable;
}
+ const auto readable_event{writable_event->GetReadableEvent()};
writable_event->Clear();
thread->SetStatus(ThreadStatus::WaitHLEEvent);
thread->SetWaitObjects({readable_event});
diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h
index 557940f11..e5c0610cd 100644
--- a/src/core/hle/kernel/hle_ipc.h
+++ b/src/core/hle/kernel/hle_ipc.h
@@ -122,13 +122,11 @@ public:
* was called.
* @param writable_event Event to use to wake up the thread. If unspecified, an event will be
* created.
- * @param readable_event Event to be bound to the thread to wake up upon.
* @returns Event that when signaled will resume the thread and call the callback function.
*/
SharedPtr<WritableEvent> SleepClientThread(SharedPtr<Thread> thread, const std::string& reason,
u64 timeout, WakeupCallback&& callback,
- SharedPtr<WritableEvent> writable_event = nullptr,
- SharedPtr<ReadableEvent> readable_event = nullptr);
+ SharedPtr<WritableEvent> writable_event = nullptr);
/// Populates this context with data from the requesting process/thread.
ResultCode PopulateFromIncomingCommandBuffer(const HandleTable& handle_table,
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 21d7f3483..e441c5bc6 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -17,11 +17,9 @@
#include "core/hle/kernel/handle_table.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/kernel/process.h"
-#include "core/hle/kernel/readable_event.h"
#include "core/hle/kernel/resource_limit.h"
#include "core/hle/kernel/thread.h"
#include "core/hle/kernel/timer.h"
-#include "core/hle/kernel/writable_event.h"
#include "core/hle/lock.h"
#include "core/hle/result.h"
diff --git a/src/core/hle/kernel/writable_event.cpp b/src/core/hle/kernel/writable_event.cpp
index 27d7ff734..a58ea6ec8 100644
--- a/src/core/hle/kernel/writable_event.cpp
+++ b/src/core/hle/kernel/writable_event.cpp
@@ -29,6 +29,10 @@ EventPair WritableEvent::CreateEventPair(KernelCore& kernel, ResetType reset_typ
return {std::move(readable_event), std::move(writable_event)};
}
+SharedPtr<ReadableEvent> WritableEvent::GetReadableEvent() const {
+ return readable;
+}
+
ResetType WritableEvent::GetResetType() const {
return readable->reset_type;
}
diff --git a/src/core/hle/kernel/writable_event.h b/src/core/hle/kernel/writable_event.h
index 4357d1b9f..fc57d18d7 100644
--- a/src/core/hle/kernel/writable_event.h
+++ b/src/core/hle/kernel/writable_event.h
@@ -44,6 +44,8 @@ public:
return HANDLE_TYPE;
}
+ SharedPtr<ReadableEvent> GetReadableEvent() const;
+
ResetType GetResetType() const;
void Signal();
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index a3e0df9bf..3a7b6da84 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -302,6 +302,7 @@ void ISelfController::GetLibraryAppletLaunchableEvent(Kernel::HLERequestContext&
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(RESULT_SUCCESS);
rb.PushCopyObjects(launchable_event.readable);
+}
void ISelfController::SetScreenShotImageOrientation(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_AM, "(STUBBED) called");
diff --git a/src/core/hle/service/am/applets/applets.h b/src/core/hle/service/am/applets/applets.h
index 3eff471eb..b0a8913c3 100644
--- a/src/core/hle/service/am/applets/applets.h
+++ b/src/core/hle/service/am/applets/applets.h
@@ -8,14 +8,10 @@
#include <queue>
#include "common/swap.h"
#include "core/hle/kernel/kernel.h"
+#include "core/hle/kernel/writable_event.h"
union ResultCode;
-namespace Kernel {
-class ReadableEvent;
-class WritableEvent;
-} // namespace Kernel
-
namespace Service::AM {
class IStorage;
diff --git a/src/core/hle/service/nfp/nfp.h b/src/core/hle/service/nfp/nfp.h
index 437c10aad..a1817e991 100644
--- a/src/core/hle/service/nfp/nfp.h
+++ b/src/core/hle/service/nfp/nfp.h
@@ -6,6 +6,7 @@
#include <array>
#include <vector>
+#include "core/hle/kernel/readable_event.h"
#include "core/hle/kernel/writable_event.h"
#include "core/hle/service/service.h"
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp
index 47beaf8f6..717eae36a 100644
--- a/src/core/hle/service/vi/vi.cpp
+++ b/src/core/hle/service/vi/vi.cpp
@@ -548,7 +548,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
},
- buffer_queue->GetWritableBufferWaitEvent(), buffer_queue->GetBufferWaitEvent());
+ buffer_queue->GetWritableBufferWaitEvent());
}
} else if (transaction == TransactionId::RequestBuffer) {
IGBPRequestBufferRequestParcel request{ctx.ReadBuffer()};