diff options
| author | 2014-05-18 22:09:08 -0400 | |
|---|---|---|
| committer | 2014-05-18 22:09:08 -0400 | |
| commit | 112904b832210d7b8d165988643acae2f68793e7 (patch) | |
| tree | 6b459048cc4ac2262296dc6489cfea744c80b7ae /src | |
| parent | fix warning (diff) | |
| download | yuzu-112904b832210d7b8d165988643acae2f68793e7.tar.gz yuzu-112904b832210d7b8d165988643acae2f68793e7.tar.xz yuzu-112904b832210d7b8d165988643acae2f68793e7.zip | |
- renamed NewHandle to CreateHandle
- updated CreateHandle/DeleteHandle to use KernelObject's
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/gsp.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/service/service.h | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/core/hle/service/gsp.cpp b/src/core/hle/service/gsp.cpp index 12c7dabcd..50cee2c41 100644 --- a/src/core/hle/service/gsp.cpp +++ b/src/core/hle/service/gsp.cpp | |||
| @@ -27,7 +27,7 @@ union GX_CmdBufferHeader { | |||
| 27 | // <=15 when writing a command to shared memory. This is incremented by the application when | 27 | // <=15 when writing a command to shared memory. This is incremented by the application when |
| 28 | // writing a command to shared memory, after increasing this value TriggerCmdReqQueue is only | 28 | // writing a command to shared memory, after increasing this value TriggerCmdReqQueue is only |
| 29 | // used if this field is value 1. | 29 | // used if this field is value 1. |
| 30 | BitField<8,8,u32> number_commands; | 30 | BitField<8,8,u32> number_commands; |
| 31 | 31 | ||
| 32 | }; | 32 | }; |
| 33 | 33 | ||
| @@ -101,9 +101,7 @@ void RegisterInterruptRelayQueue(Service::Interface* self) { | |||
| 101 | u32* cmd_buff = Service::GetCommandBuffer(); | 101 | u32* cmd_buff = Service::GetCommandBuffer(); |
| 102 | u32 flags = cmd_buff[1]; | 102 | u32 flags = cmd_buff[1]; |
| 103 | u32 event_handle = cmd_buff[3]; // TODO(bunnei): Implement event handling | 103 | u32 event_handle = cmd_buff[3]; // TODO(bunnei): Implement event handling |
| 104 | |||
| 105 | cmd_buff[2] = g_thread_id; // ThreadID | 104 | cmd_buff[2] = g_thread_id; // ThreadID |
| 106 | cmd_buff[4] = self->NewHandle(); | ||
| 107 | } | 105 | } |
| 108 | 106 | ||
| 109 | /// This triggers handling of the GX command written to the command buffer in shared memory. | 107 | /// This triggers handling of the GX command written to the command buffer in shared memory. |
diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index 35735a00b..450a439fe 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h | |||
| @@ -63,14 +63,16 @@ public: | |||
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | /// Allocates a new handle for the service | 65 | /// Allocates a new handle for the service |
| 66 | Handle NewHandle() { | 66 | Handle CreateHandle(KernelObject *obj) { |
| 67 | Handle handle = (m_handles.size() << 16) | 0;//m_handle; | 67 | Handle handle = g_kernel_objects.Create(obj); |
| 68 | m_handles.push_back(handle); | 68 | m_handles.push_back(handle); |
| 69 | return handle; | 69 | return handle; |
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | /// Frees a handle from the service | 72 | /// Frees a handle from the service |
| 73 | void DeleteHandle(Handle handle) { | 73 | template <class T> |
| 74 | void DeleteHandle(const Handle handle) { | ||
| 75 | g_kernel_objects.Destroy<T>(handle); | ||
| 74 | m_handles.erase(std::remove(m_handles.begin(), m_handles.end(), handle), m_handles.end()); | 76 | m_handles.erase(std::remove(m_handles.begin(), m_handles.end(), handle), m_handles.end()); |
| 75 | } | 77 | } |
| 76 | 78 | ||
| @@ -111,8 +113,8 @@ protected: | |||
| 111 | 113 | ||
| 112 | private: | 114 | private: |
| 113 | 115 | ||
| 114 | std::vector<Handle> m_handles; | 116 | std::vector<Handle> m_handles; |
| 115 | std::map<u32, FunctionInfo> m_functions; | 117 | std::map<u32, FunctionInfo> m_functions; |
| 116 | 118 | ||
| 117 | }; | 119 | }; |
| 118 | 120 | ||