summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2018-08-15 06:50:22 -0400
committerGravatar Lioncash2018-08-15 06:50:50 -0400
commitaac5792a2b02200a55efdf13090ae57005ff3346 (patch)
tree6e7f3e623669f326bb9dc9eb1c305674bd5d125d /src
parentMerge pull request #1067 from lioncash/init (diff)
downloadyuzu-aac5792a2b02200a55efdf13090ae57005ff3346.tar.gz
yuzu-aac5792a2b02200a55efdf13090ae57005ff3346.tar.xz
yuzu-aac5792a2b02200a55efdf13090ae57005ff3346.zip
kernel/server_session: Add IsSession() member function
Allows querying the inverse of IsDomain() to make things more readable. This will likely also be usable in the event of implementing ConvertDomainToSession().
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/server_session.cpp2
-rw-r--r--src/core/hle/kernel/server_session.h7
-rw-r--r--src/core/hle/service/sm/controller.cpp2
3 files changed, 8 insertions, 3 deletions
diff --git a/src/core/hle/kernel/server_session.cpp b/src/core/hle/kernel/server_session.cpp
index d09ca5992..51a1ec160 100644
--- a/src/core/hle/kernel/server_session.cpp
+++ b/src/core/hle/kernel/server_session.cpp
@@ -152,7 +152,7 @@ ResultCode ServerSession::HandleSyncRequest(SharedPtr<Thread> thread) {
152 // Handle scenario when ConvertToDomain command was issued, as we must do the conversion at the 152 // Handle scenario when ConvertToDomain command was issued, as we must do the conversion at the
153 // end of the command such that only commands following this one are handled as domains 153 // end of the command such that only commands following this one are handled as domains
154 if (convert_to_domain) { 154 if (convert_to_domain) {
155 ASSERT_MSG(domain_request_handlers.empty(), "already a domain"); 155 ASSERT_MSG(IsSession(), "ServerSession is already a domain instance.");
156 domain_request_handlers = {hle_handler}; 156 domain_request_handlers = {hle_handler};
157 convert_to_domain = false; 157 convert_to_domain = false;
158 } 158 }
diff --git a/src/core/hle/kernel/server_session.h b/src/core/hle/kernel/server_session.h
index 2bce54fee..1a88e66b9 100644
--- a/src/core/hle/kernel/server_session.h
+++ b/src/core/hle/kernel/server_session.h
@@ -97,7 +97,12 @@ public:
97 97
98 /// Returns true if the session has been converted to a domain, otherwise False 98 /// Returns true if the session has been converted to a domain, otherwise False
99 bool IsDomain() const { 99 bool IsDomain() const {
100 return !domain_request_handlers.empty(); 100 return !IsSession();
101 }
102
103 /// Returns true if this session has not been converted to a domain, otherwise false.
104 bool IsSession() const {
105 return domain_request_handlers.empty();
101 } 106 }
102 107
103 /// Converts the session to a domain at the end of the current command 108 /// Converts the session to a domain at the end of the current command
diff --git a/src/core/hle/service/sm/controller.cpp b/src/core/hle/service/sm/controller.cpp
index 518a0cc46..ae8cd9eeb 100644
--- a/src/core/hle/service/sm/controller.cpp
+++ b/src/core/hle/service/sm/controller.cpp
@@ -10,7 +10,7 @@
10namespace Service::SM { 10namespace Service::SM {
11 11
12void Controller::ConvertSessionToDomain(Kernel::HLERequestContext& ctx) { 12void Controller::ConvertSessionToDomain(Kernel::HLERequestContext& ctx) {
13 ASSERT_MSG(!ctx.Session()->IsDomain(), "session is alread a domain"); 13 ASSERT_MSG(ctx.Session()->IsSession(), "Session is already a domain");
14 ctx.Session()->ConvertToDomain(); 14 ctx.Session()->ConvertToDomain();
15 15
16 IPC::ResponseBuilder rb{ctx, 3}; 16 IPC::ResponseBuilder rb{ctx, 3};