summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/event.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2014-06-02 20:38:34 -0400
committerGravatar bunnei2014-06-02 20:38:34 -0400
commitb78aff85857a3a356fdf11e1dbc4e5f52490676e (patch)
tree0cb0b9855ae2eed179fb1401e3edbcbd7d59f6f3 /src/core/hle/kernel/event.cpp
parentkernel: moved position of * for GetTypeName and GetName (diff)
downloadyuzu-b78aff85857a3a356fdf11e1dbc4e5f52490676e.tar.gz
yuzu-b78aff85857a3a356fdf11e1dbc4e5f52490676e.tar.xz
yuzu-b78aff85857a3a356fdf11e1dbc4e5f52490676e.zip
svc: added optional name field to Event and Mutex (used for debugging)
Diffstat (limited to 'src/core/hle/kernel/event.cpp')
-rw-r--r--src/core/hle/kernel/event.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/core/hle/kernel/event.cpp b/src/core/hle/kernel/event.cpp
index e84d0b49e..70e50115d 100644
--- a/src/core/hle/kernel/event.cpp
+++ b/src/core/hle/kernel/event.cpp
@@ -15,6 +15,7 @@ namespace Kernel {
15class Event : public Object { 15class Event : public Object {
16public: 16public:
17 const char* GetTypeName() { return "Event"; } 17 const char* GetTypeName() { return "Event"; }
18 const char* GetName() { return name.c_str(); }
18 19
19 static Kernel::HandleType GetStaticHandleType() { return Kernel::HandleType::Event; } 20 static Kernel::HandleType GetStaticHandleType() { return Kernel::HandleType::Event; }
20 Kernel::HandleType GetHandleType() const { return Kernel::HandleType::Event; } 21 Kernel::HandleType GetHandleType() const { return Kernel::HandleType::Event; }
@@ -24,6 +25,7 @@ public:
24 25
25 bool locked; ///< Current locked state 26 bool locked; ///< Current locked state
26 bool permanent_locked; ///< Hack - to set event permanent state (for easy passthrough) 27 bool permanent_locked; ///< Hack - to set event permanent state (for easy passthrough)
28 std::string name; ///< Name of event (optional)
27 29
28 /** 30 /**
29 * Synchronize kernel object 31 * Synchronize kernel object
@@ -98,9 +100,10 @@ Result ClearEvent(Handle handle) {
98 * Creates an event 100 * Creates an event
99 * @param handle Reference to handle for the newly created mutex 101 * @param handle Reference to handle for the newly created mutex
100 * @param reset_type ResetType describing how to create event 102 * @param reset_type ResetType describing how to create event
103 * @param name Optional name of event
101 * @return Newly created Event object 104 * @return Newly created Event object
102 */ 105 */
103Event* CreateEvent(Handle& handle, const ResetType reset_type) { 106Event* CreateEvent(Handle& handle, const ResetType reset_type, const std::string name) {
104 Event* evt = new Event; 107 Event* evt = new Event;
105 108
106 handle = Kernel::g_object_pool.Create(evt); 109 handle = Kernel::g_object_pool.Create(evt);
@@ -108,6 +111,7 @@ Event* CreateEvent(Handle& handle, const ResetType reset_type) {
108 evt->locked = true; 111 evt->locked = true;
109 evt->permanent_locked = false; 112 evt->permanent_locked = false;
110 evt->reset_type = evt->intitial_reset_type = reset_type; 113 evt->reset_type = evt->intitial_reset_type = reset_type;
114 evt->name = name;
111 115
112 return evt; 116 return evt;
113} 117}
@@ -115,11 +119,12 @@ Event* CreateEvent(Handle& handle, const ResetType reset_type) {
115/** 119/**
116 * Creates an event 120 * Creates an event
117 * @param reset_type ResetType describing how to create event 121 * @param reset_type ResetType describing how to create event
122 * @param name Optional name of event
118 * @return Handle to newly created Event object 123 * @return Handle to newly created Event object
119 */ 124 */
120Handle CreateEvent(const ResetType reset_type) { 125Handle CreateEvent(const ResetType reset_type, const std::string name) {
121 Handle handle; 126 Handle handle;
122 Event* evt = CreateEvent(handle, reset_type); 127 Event* evt = CreateEvent(handle, reset_type, name);
123 return handle; 128 return handle;
124} 129}
125 130