summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/k_event.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-04-04 09:56:09 +0200
committerbunnei <bunneidev@gmail.com>2021-05-06 01:40:50 +0200
commitaddc0bf0379e075786048921bede6e089552a6db (patch)
tree7fa8819b52db29e1b354410441dd8f2438e2ed4a /src/core/hle/kernel/k_event.h
parenthle: kernel: Migrate KSharedMemory to KAutoObject. (diff)
downloadyuzu-addc0bf0379e075786048921bede6e089552a6db.tar
yuzu-addc0bf0379e075786048921bede6e089552a6db.tar.gz
yuzu-addc0bf0379e075786048921bede6e089552a6db.tar.bz2
yuzu-addc0bf0379e075786048921bede6e089552a6db.tar.lz
yuzu-addc0bf0379e075786048921bede6e089552a6db.tar.xz
yuzu-addc0bf0379e075786048921bede6e089552a6db.tar.zst
yuzu-addc0bf0379e075786048921bede6e089552a6db.zip
Diffstat (limited to 'src/core/hle/kernel/k_event.h')
-rw-r--r--src/core/hle/kernel/k_event.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/core/hle/kernel/k_event.h b/src/core/hle/kernel/k_event.h
index ec6894b16..97ec0ea9c 100644
--- a/src/core/hle/kernel/k_event.h
+++ b/src/core/hle/kernel/k_event.h
@@ -4,24 +4,34 @@
#pragma once
-#include "core/hle/kernel/object.h"
+#include "core/hle/kernel/slab_helpers.h"
namespace Kernel {
class KernelCore;
class KReadableEvent;
class KWritableEvent;
+class Process;
+
+class KEvent final : public KAutoObjectWithSlabHeapAndContainer<KEvent, KAutoObjectWithList> {
+ KERNEL_AUTOOBJECT_TRAITS(KEvent, KAutoObject);
-class KEvent final : public Object {
public:
- explicit KEvent(KernelCore& kernel, std::string&& name);
+ explicit KEvent(KernelCore& kernel);
~KEvent() override;
- static std::shared_ptr<KEvent> Create(KernelCore& kernel, std::string&& name);
+ void Initialize(std::string&& name);
+
+ virtual void Finalize() override;
- void Initialize();
+ virtual bool IsInitialized() const override {
+ return initialized;
+ }
+ virtual uintptr_t GetPostDestroyArgument() const override {
+ return reinterpret_cast<uintptr_t>(owner);
+ }
- void Finalize() override {}
+ static void PostDestroy(uintptr_t arg);
std::string GetTypeName() const override {
return "KEvent";
@@ -51,6 +61,7 @@ public:
private:
std::shared_ptr<KReadableEvent> readable_event;
std::shared_ptr<KWritableEvent> writable_event;
+ Process* owner{};
bool initialized{};
};