From 96b21055249ade8a36f8117e4e22ea2a8a10707b Mon Sep 17 00:00:00 2001 From: bunnei Date: Mon, 26 May 2014 21:55:55 -0400 Subject: srv: added a real mutex for GetProcSemaphore (instead of stubbed) --- src/core/hle/service/srv.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/core/hle/service/srv.cpp') diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp index ff6da8f1c..7bbc03bf6 100644 --- a/src/core/hle/service/srv.cpp +++ b/src/core/hle/service/srv.cpp @@ -5,21 +5,28 @@ #include "core/hle/hle.h" #include "core/hle/service/srv.h" #include "core/hle/service/service.h" - +#include "core/hle/kernel/mutex.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // Namespace SRV namespace SRV { +Handle g_mutex = 0; + void Initialize(Service::Interface* self) { - NOTICE_LOG(OSHLE, "SRV::Sync - Initialize"); + DEBUG_LOG(OSHLE, "SRV::Initialize called"); + if (!g_mutex) { + g_mutex = Kernel::CreateMutex(false); + } } void GetProcSemaphore(Service::Interface* self) { + DEBUG_LOG(OSHLE, "SRV::GetProcSemaphore called"); // Get process semaphore? u32* cmd_buff = Service::GetCommandBuffer(); - cmd_buff[3] = 0xDEADBEEF; // Return something... 0 == NULL, raises an exception + cmd_buff[1] = 0; // No error + cmd_buff[3] = g_mutex; // Return something... 0 == NULL, raises an exception } void GetServiceHandle(Service::Interface* self) { -- cgit v1.2.3 From b08b3c154fd5c2cdb12ab88597863f736c156123 Mon Sep 17 00:00:00 2001 From: bunnei Date: Thu, 29 May 2014 18:53:45 -0400 Subject: srv: changed a NOTICE_LOG to DEBUG_LOG --- src/core/hle/service/srv.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/hle/service/srv.cpp') diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp index 7bbc03bf6..97e7fc8fa 100644 --- a/src/core/hle/service/srv.cpp +++ b/src/core/hle/service/srv.cpp @@ -36,7 +36,7 @@ void GetServiceHandle(Service::Interface* self) { std::string port_name = std::string((const char*)&cmd_buff[1], 0, Service::kMaxPortSize); Service::Interface* service = Service::g_manager->FetchFromPortName(port_name); - NOTICE_LOG(OSHLE, "SRV::Sync - GetHandle - port: %s, handle: 0x%08X", port_name.c_str(), + DEBUG_LOG(OSHLE, "SRV::Sync - GetHandle - port: %s, handle: 0x%08X", port_name.c_str(), service->GetHandle()); if (NULL != service) { -- cgit v1.2.3 From c404d22036e16d20d91fca0cf29d56785656c0f5 Mon Sep 17 00:00:00 2001 From: bunnei Date: Thu, 29 May 2014 23:26:58 -0400 Subject: hle: cleaned up log messages --- src/core/hle/service/srv.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/hle/service/srv.cpp') diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp index 97e7fc8fa..ac8f398fc 100644 --- a/src/core/hle/service/srv.cpp +++ b/src/core/hle/service/srv.cpp @@ -15,14 +15,14 @@ namespace SRV { Handle g_mutex = 0; void Initialize(Service::Interface* self) { - DEBUG_LOG(OSHLE, "SRV::Initialize called"); + DEBUG_LOG(OSHLE, "called"); if (!g_mutex) { g_mutex = Kernel::CreateMutex(false); } } void GetProcSemaphore(Service::Interface* self) { - DEBUG_LOG(OSHLE, "SRV::GetProcSemaphore called"); + DEBUG_LOG(OSHLE, "called"); // Get process semaphore? u32* cmd_buff = Service::GetCommandBuffer(); cmd_buff[1] = 0; // No error @@ -36,7 +36,7 @@ void GetServiceHandle(Service::Interface* self) { std::string port_name = std::string((const char*)&cmd_buff[1], 0, Service::kMaxPortSize); Service::Interface* service = Service::g_manager->FetchFromPortName(port_name); - DEBUG_LOG(OSHLE, "SRV::Sync - GetHandle - port: %s, handle: 0x%08X", port_name.c_str(), + DEBUG_LOG(OSHLE, "called port=%s, handle=0x%08X", port_name.c_str(), service->GetHandle()); if (NULL != service) { -- cgit v1.2.3 From 007b7edada86bf97e1499625c3c8fda25132bbac Mon Sep 17 00:00:00 2001 From: bunnei Date: Thu, 29 May 2014 23:54:09 -0400 Subject: srv: fix to log unimplemented service (instead of crash) --- src/core/hle/service/srv.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/core/hle/service/srv.cpp') diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp index ac8f398fc..f1940e6f5 100644 --- a/src/core/hle/service/srv.cpp +++ b/src/core/hle/service/srv.cpp @@ -36,18 +36,14 @@ void GetServiceHandle(Service::Interface* self) { std::string port_name = std::string((const char*)&cmd_buff[1], 0, Service::kMaxPortSize); Service::Interface* service = Service::g_manager->FetchFromPortName(port_name); - DEBUG_LOG(OSHLE, "called port=%s, handle=0x%08X", port_name.c_str(), - service->GetHandle()); - if (NULL != service) { cmd_buff[3] = service->GetHandle(); + DEBUG_LOG(OSHLE, "called port=%s, handle=0x%08X", port_name.c_str(), cmd_buff[3]); } else { - ERROR_LOG(OSHLE, "Service %s does not exist", port_name.c_str()); + ERROR_LOG(OSHLE, "(UNIMPLEMENTED) called port=%s", port_name.c_str()); res = -1; } cmd_buff[1] = res; - - //return res; } const Interface::FunctionInfo FunctionTable[] = { -- cgit v1.2.3 From b78aff85857a3a356fdf11e1dbc4e5f52490676e Mon Sep 17 00:00:00 2001 From: bunnei Date: Mon, 2 Jun 2014 20:38:34 -0400 Subject: svc: added optional name field to Event and Mutex (used for debugging) --- src/core/hle/service/srv.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/hle/service/srv.cpp') diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp index f1940e6f5..07e2009a0 100644 --- a/src/core/hle/service/srv.cpp +++ b/src/core/hle/service/srv.cpp @@ -17,7 +17,7 @@ Handle g_mutex = 0; void Initialize(Service::Interface* self) { DEBUG_LOG(OSHLE, "called"); if (!g_mutex) { - g_mutex = Kernel::CreateMutex(false); + g_mutex = Kernel::CreateMutex(true, "SRV:Lock"); } } -- cgit v1.2.3 From c95972275e276abe3afcac79d956ea29a0879c8e Mon Sep 17 00:00:00 2001 From: bunnei Date: Fri, 6 Jun 2014 00:35:49 -0400 Subject: HLE: Updated all uses of NULL to nullptr (to be C++11 compliant) --- src/core/hle/service/srv.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/core/hle/service/srv.cpp') diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp index 07e2009a0..f45c0efc2 100644 --- a/src/core/hle/service/srv.cpp +++ b/src/core/hle/service/srv.cpp @@ -26,7 +26,7 @@ void GetProcSemaphore(Service::Interface* self) { // Get process semaphore? u32* cmd_buff = Service::GetCommandBuffer(); cmd_buff[1] = 0; // No error - cmd_buff[3] = g_mutex; // Return something... 0 == NULL, raises an exception + cmd_buff[3] = g_mutex; // Return something... 0 == nullptr, raises an exception } void GetServiceHandle(Service::Interface* self) { @@ -36,7 +36,7 @@ void GetServiceHandle(Service::Interface* self) { std::string port_name = std::string((const char*)&cmd_buff[1], 0, Service::kMaxPortSize); Service::Interface* service = Service::g_manager->FetchFromPortName(port_name); - if (NULL != service) { + if (nullptr != service) { cmd_buff[3] = service->GetHandle(); DEBUG_LOG(OSHLE, "called port=%s, handle=0x%08X", port_name.c_str(), cmd_buff[3]); } else { @@ -49,8 +49,8 @@ void GetServiceHandle(Service::Interface* self) { const Interface::FunctionInfo FunctionTable[] = { {0x00010002, Initialize, "Initialize"}, {0x00020000, GetProcSemaphore, "GetProcSemaphore"}, - {0x00030100, NULL, "RegisterService"}, - {0x000400C0, NULL, "UnregisterService"}, + {0x00030100, nullptr, "RegisterService"}, + {0x000400C0, nullptr, "UnregisterService"}, {0x00050100, GetServiceHandle, "GetServiceHandle"}, }; -- cgit v1.2.3