diff options
| author | 2014-12-15 18:45:53 -0500 | |
|---|---|---|
| committer | 2014-12-15 18:45:53 -0500 | |
| commit | d0ce9d58f6607fd0d7cc1ed685d01cc1f55b0839 (patch) | |
| tree | 5d458d4768cd95942154f1b2c9298fac04882700 /src/core/hle/svc.cpp | |
| parent | Merge pull request #276 from lioncash/decrappify (diff) | |
| parent | Remove SyncRequest from K::Object and create a new K::Session type (diff) | |
| download | yuzu-d0ce9d58f6607fd0d7cc1ed685d01cc1f55b0839.tar.gz yuzu-d0ce9d58f6607fd0d7cc1ed685d01cc1f55b0839.tar.xz yuzu-d0ce9d58f6607fd0d7cc1ed685d01cc1f55b0839.zip | |
Merge pull request #279 from yuriks/session
Remove SyncRequest from K::Object and create a new K::Session type
Diffstat (limited to 'src/core/hle/svc.cpp')
| -rw-r--r-- | src/core/hle/svc.cpp | 11 |
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 |
| 90 | static Result SendSyncRequest(Handle handle) { | 90 | static 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 | } |