- renamed NewHandle to CreateHandle
- updated CreateHandle/DeleteHandle to use KernelObject's
This commit is contained in:
parent
16d55842c5
commit
112904b832
|
@ -101,9 +101,7 @@ void RegisterInterruptRelayQueue(Service::Interface* self) {
|
||||||
u32* cmd_buff = Service::GetCommandBuffer();
|
u32* cmd_buff = Service::GetCommandBuffer();
|
||||||
u32 flags = cmd_buff[1];
|
u32 flags = cmd_buff[1];
|
||||||
u32 event_handle = cmd_buff[3]; // TODO(bunnei): Implement event handling
|
u32 event_handle = cmd_buff[3]; // TODO(bunnei): Implement event handling
|
||||||
|
|
||||||
cmd_buff[2] = g_thread_id; // ThreadID
|
cmd_buff[2] = g_thread_id; // ThreadID
|
||||||
cmd_buff[4] = self->NewHandle();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This triggers handling of the GX command written to the command buffer in shared memory.
|
/// This triggers handling of the GX command written to the command buffer in shared memory.
|
||||||
|
|
|
@ -63,14 +63,16 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Allocates a new handle for the service
|
/// Allocates a new handle for the service
|
||||||
Handle NewHandle() {
|
Handle CreateHandle(KernelObject *obj) {
|
||||||
Handle handle = (m_handles.size() << 16) | 0;//m_handle;
|
Handle handle = g_kernel_objects.Create(obj);
|
||||||
m_handles.push_back(handle);
|
m_handles.push_back(handle);
|
||||||
return handle;
|
return handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Frees a handle from the service
|
/// Frees a handle from the service
|
||||||
void DeleteHandle(Handle handle) {
|
template <class T>
|
||||||
|
void DeleteHandle(const Handle handle) {
|
||||||
|
g_kernel_objects.Destroy<T>(handle);
|
||||||
m_handles.erase(std::remove(m_handles.begin(), m_handles.end(), handle), m_handles.end());
|
m_handles.erase(std::remove(m_handles.begin(), m_handles.end(), handle), m_handles.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue