HLE: Updated various handle debug assertions to be more clear.

This commit is contained in:
bunnei 2014-06-06 00:19:40 -04:00
parent 780a443b08
commit d7363322c7
4 changed files with 10 additions and 10 deletions

View file

@ -122,7 +122,7 @@ bool ReleaseMutex(Mutex* mutex) {
Result ReleaseMutex(Handle handle) { Result ReleaseMutex(Handle handle) {
Mutex* mutex = Kernel::g_object_pool.GetFast<Mutex>(handle); Mutex* mutex = Kernel::g_object_pool.GetFast<Mutex>(handle);
_assert_msg_(KERNEL, mutex, "ReleaseMutex tried to release a NULL mutex!"); _assert_msg_(KERNEL, (mutex != NULL), "ReleaseMutex tried to release a NULL mutex!");
if (!ReleaseMutex(mutex)) { if (!ReleaseMutex(mutex)) {
return -1; return -1;

View file

@ -353,7 +353,7 @@ Handle CreateThread(const char* name, u32 entry_point, s32 priority, u32 arg, s3
/// Get the priority of the thread specified by handle /// Get the priority of the thread specified by handle
u32 GetThreadPriority(const Handle handle) { u32 GetThreadPriority(const Handle handle) {
Thread* thread = g_object_pool.GetFast<Thread>(handle); Thread* thread = g_object_pool.GetFast<Thread>(handle);
_assert_msg_(KERNEL, thread, "called, but thread is NULL!"); _assert_msg_(KERNEL, (thread != NULL), "called, but thread is NULL!");
return thread->current_priority; return thread->current_priority;
} }
@ -365,7 +365,7 @@ Result SetThreadPriority(Handle handle, s32 priority) {
} else { } else {
thread = g_object_pool.GetFast<Thread>(handle); thread = g_object_pool.GetFast<Thread>(handle);
} }
_assert_msg_(KERNEL, thread, "called, but thread is NULL!"); _assert_msg_(KERNEL, (thread != NULL), "called, but thread is NULL!");
// If priority is invalid, clamp to valid range // If priority is invalid, clamp to valid range
if (priority < THREADPRIO_HIGHEST || priority > THREADPRIO_LOWEST) { if (priority < THREADPRIO_HIGHEST || priority > THREADPRIO_LOWEST) {

View file

@ -104,7 +104,7 @@ void RegisterInterruptRelayQueue(Service::Interface* self) {
u32 flags = cmd_buff[1]; u32 flags = cmd_buff[1];
u32 event_handle = cmd_buff[3]; u32 event_handle = cmd_buff[3];
_assert_msg_(GSP, event_handle, "called, but event is NULL!"); _assert_msg_(GSP, (event_handle != 0), "called, but event is NULL!");
g_event_handle = event_handle; g_event_handle = event_handle;

View file

@ -81,7 +81,7 @@ Result ConnectToPort(void* _out, const char* port_name) {
Service::Interface* service = Service::g_manager->FetchFromPortName(port_name); Service::Interface* service = Service::g_manager->FetchFromPortName(port_name);
DEBUG_LOG(SVC, "called port_name=%s", port_name); DEBUG_LOG(SVC, "called port_name=%s", port_name);
_assert_msg_(KERNEL, service, "called, but service is not implemented!"); _assert_msg_(KERNEL, (service != NULL), "called, but service is not implemented!");
*out = service->GetHandle(); *out = service->GetHandle();
@ -93,7 +93,7 @@ Result SendSyncRequest(Handle handle) {
bool wait = false; bool wait = false;
Kernel::Object* object = Kernel::g_object_pool.GetFast<Kernel::Object>(handle); Kernel::Object* object = Kernel::g_object_pool.GetFast<Kernel::Object>(handle);
_assert_msg_(KERNEL, object, "called, but kernel object is NULL!"); _assert_msg_(KERNEL, (object != NULL), "called, but kernel object is NULL!");
DEBUG_LOG(SVC, "called handle=0x%08X(%s)", handle, object->GetTypeName()); DEBUG_LOG(SVC, "called handle=0x%08X(%s)", handle, object->GetTypeName());
Result res = object->SyncRequest(&wait); Result res = object->SyncRequest(&wait);
@ -122,7 +122,7 @@ Result WaitSynchronization1(Handle handle, s64 nano_seconds) {
DEBUG_LOG(SVC, "called handle=0x%08X(%s:%s), nanoseconds=%d", handle, object->GetTypeName(), DEBUG_LOG(SVC, "called handle=0x%08X(%s:%s), nanoseconds=%d", handle, object->GetTypeName(),
object->GetName(), nano_seconds); object->GetName(), nano_seconds);
_assert_msg_(KERNEL, object, "called, but kernel object is NULL!"); _assert_msg_(KERNEL, (object != NULL), "called, but kernel object is NULL!");
Result res = object->WaitSynchronization(&wait); Result res = object->WaitSynchronization(&wait);
@ -150,9 +150,9 @@ Result WaitSynchronizationN(void* _out, void* _handles, u32 handle_count, u32 wa
// Iterate through each handle, synchronize kernel object // Iterate through each handle, synchronize kernel object
for (u32 i = 0; i < handle_count; i++) { for (u32 i = 0; i < handle_count; i++) {
bool wait = false; bool wait = false;
Kernel::Object* object = Kernel::g_object_pool.GetFast<Kernel::Object>(handles[i]); // 0 handle Kernel::Object* object = Kernel::g_object_pool.GetFast<Kernel::Object>(handles[i]);
_assert_msg_(KERNEL, object, "called handle=0x%08X, but kernel object " _assert_msg_(KERNEL, (object != NULL), "called handle=0x%08X, but kernel object "
"is NULL!", handles[i]); "is NULL!", handles[i]);
DEBUG_LOG(SVC, "\thandle[%d] = 0x%08X(%s:%s)", i, handles[i], object->GetTypeName(), DEBUG_LOG(SVC, "\thandle[%d] = 0x%08X(%s:%s)", i, handles[i], object->GetTypeName(),
@ -278,7 +278,7 @@ Result CreateMutex(void* _mutex, u32 initial_locked) {
/// Release a mutex /// Release a mutex
Result ReleaseMutex(Handle handle) { Result ReleaseMutex(Handle handle) {
DEBUG_LOG(SVC, "called handle=0x%08X", handle); DEBUG_LOG(SVC, "called handle=0x%08X", handle);
_assert_msg_(KERNEL, handle, "called, but handle is NULL!"); _assert_msg_(KERNEL, (handle != 0), "called, but handle is NULL!");
Kernel::ReleaseMutex(handle); Kernel::ReleaseMutex(handle);
return 0; return 0;
} }