summaryrefslogtreecommitdiff
path: root/src/core/hle/svc.cpp
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2014-12-14 03:30:11 -0200
committerGravatar Yuri Kunde Schlesner2014-12-15 18:26:17 -0200
commite321decf98a6b0041e4d6b30ca79f24308bbb82c (patch)
tree5d458d4768cd95942154f1b2c9298fac04882700 /src/core/hle/svc.cpp
parentMerge pull request #276 from lioncash/decrappify (diff)
downloadyuzu-e321decf98a6b0041e4d6b30ca79f24308bbb82c.tar.gz
yuzu-e321decf98a6b0041e4d6b30ca79f24308bbb82c.tar.xz
yuzu-e321decf98a6b0041e4d6b30ca79f24308bbb82c.zip
Remove SyncRequest from K::Object and create a new K::Session type
This is a first step at fixing the conceptual insanity that is our handling of service and IPC calls. For now, interfaces still directly derived from Session because we don't have the infrastructure to do it properly. (That is, Processes and scheduling them.)
Diffstat (limited to 'src/core/hle/svc.cpp')
-rw-r--r--src/core/hle/svc.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index f3595096e..15cc240f4 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -88,17 +88,14 @@ static Result ConnectToPort(Handle* out, const char* port_name) {
88 88
89/// Synchronize to an OS service 89/// Synchronize to an OS service
90static Result SendSyncRequest(Handle handle) { 90static Result SendSyncRequest(Handle handle) {
91 // TODO(yuriks): ObjectPool::Get tries to check the Object type, which fails since this is a generic base Object, 91 Kernel::Session* session = Kernel::g_object_pool.Get<Kernel::Session>(handle);
92 // so we are forced to use GetFast and manually verify the handle. 92 if (session == nullptr) {
93 if (!Kernel::g_object_pool.IsValid(handle)) {
94 return InvalidHandle(ErrorModule::Kernel).raw; 93 return InvalidHandle(ErrorModule::Kernel).raw;
95 } 94 }
96 Kernel::Object* object = Kernel::g_object_pool.GetFast<Kernel::Object>(handle);
97 95
98 _assert_msg_(KERNEL, (object != nullptr), "called, but kernel object is nullptr!"); 96 LOG_TRACE(Kernel_SVC, "called handle=0x%08X(%s)", handle, session->GetName().c_str());
99 LOG_TRACE(Kernel_SVC, "called handle=0x%08X(%s)", handle, object->GetTypeName().c_str());
100 97
101 ResultVal<bool> wait = object->SyncRequest(); 98 ResultVal<bool> wait = session->SyncRequest();
102 if (wait.Succeeded() && *wait) { 99 if (wait.Succeeded() && *wait) {
103 Kernel::WaitCurrentThread(WAITTYPE_SYNCH); // TODO(bunnei): Is this correct? 100 Kernel::WaitCurrentThread(WAITTYPE_SYNCH); // TODO(bunnei): Is this correct?
104 } 101 }