diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/ipc_helpers.h | 4 | ||||
-rw-r--r-- | src/core/hle/kernel/client_port.cpp | 10 | ||||
-rw-r--r-- | src/core/hle/kernel/server_port.cpp | 7 | ||||
-rw-r--r-- | src/core/hle/kernel/server_port.h | 7 | ||||
-rw-r--r-- | src/core/hle/kernel/server_session.cpp | 2 | ||||
-rw-r--r-- | src/core/hle/kernel/server_session.h | 3 | ||||
-rw-r--r-- | src/core/memory.h | 10 |
7 files changed, 15 insertions, 28 deletions
diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h index 68406eb63..ac0e1d796 100644 --- a/src/core/hle/ipc_helpers.h +++ b/src/core/hle/ipc_helpers.h @@ -139,10 +139,8 @@ public: context->AddDomainObject(std::move(iface)); } else { auto& kernel = Core::System::GetInstance().Kernel(); - auto sessions = + auto [server, client] = Kernel::ServerSession::CreateSessionPair(kernel, iface->GetServiceName()); - auto server = std::get<Kernel::SharedPtr<Kernel::ServerSession>>(sessions); - auto client = std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions); iface->ClientConnected(server); context->AddMoveObject(std::move(client)); } diff --git a/src/core/hle/kernel/client_port.cpp b/src/core/hle/kernel/client_port.cpp index aa432658e..744b1697d 100644 --- a/src/core/hle/kernel/client_port.cpp +++ b/src/core/hle/kernel/client_port.cpp @@ -2,8 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include <tuple> - #include "core/hle/kernel/client_port.h" #include "core/hle/kernel/client_session.h" #include "core/hle/kernel/errors.h" @@ -31,18 +29,18 @@ ResultVal<SharedPtr<ClientSession>> ClientPort::Connect() { active_sessions++; // Create a new session pair, let the created sessions inherit the parent port's HLE handler. - auto sessions = ServerSession::CreateSessionPair(kernel, server_port->GetName(), this); + auto [server, client] = ServerSession::CreateSessionPair(kernel, server_port->GetName(), this); if (server_port->HasHLEHandler()) { - server_port->GetHLEHandler()->ClientConnected(std::get<SharedPtr<ServerSession>>(sessions)); + server_port->GetHLEHandler()->ClientConnected(server); } else { - server_port->AppendPendingSession(std::get<SharedPtr<ServerSession>>(sessions)); + server_port->AppendPendingSession(server); } // Wake the threads waiting on the ServerPort server_port->WakeupAllWaitingThreads(); - return MakeResult(std::get<SharedPtr<ClientSession>>(sessions)); + return MakeResult(client); } void ClientPort::ConnectionClosed() { diff --git a/src/core/hle/kernel/server_port.cpp b/src/core/hle/kernel/server_port.cpp index 708fdf9e1..02e7c60e6 100644 --- a/src/core/hle/kernel/server_port.cpp +++ b/src/core/hle/kernel/server_port.cpp @@ -39,9 +39,8 @@ void ServerPort::Acquire(Thread* thread) { ASSERT_MSG(!ShouldWait(thread), "object unavailable!"); } -std::tuple<SharedPtr<ServerPort>, SharedPtr<ClientPort>> ServerPort::CreatePortPair( - KernelCore& kernel, u32 max_sessions, std::string name) { - +ServerPort::PortPair ServerPort::CreatePortPair(KernelCore& kernel, u32 max_sessions, + std::string name) { SharedPtr<ServerPort> server_port(new ServerPort(kernel)); SharedPtr<ClientPort> client_port(new ClientPort(kernel)); @@ -51,7 +50,7 @@ std::tuple<SharedPtr<ServerPort>, SharedPtr<ClientPort>> ServerPort::CreatePortP client_port->max_sessions = max_sessions; client_port->active_sessions = 0; - return std::make_tuple(std::move(server_port), std::move(client_port)); + return std::make_pair(std::move(server_port), std::move(client_port)); } } // namespace Kernel diff --git a/src/core/hle/kernel/server_port.h b/src/core/hle/kernel/server_port.h index 76293cb8b..fef573b71 100644 --- a/src/core/hle/kernel/server_port.h +++ b/src/core/hle/kernel/server_port.h @@ -6,7 +6,7 @@ #include <memory> #include <string> -#include <tuple> +#include <utility> #include <vector> #include "common/common_types.h" #include "core/hle/kernel/object.h" @@ -23,6 +23,7 @@ class SessionRequestHandler; class ServerPort final : public WaitObject { public: using HLEHandler = std::shared_ptr<SessionRequestHandler>; + using PortPair = std::pair<SharedPtr<ServerPort>, SharedPtr<ClientPort>>; /** * Creates a pair of ServerPort and an associated ClientPort. @@ -32,8 +33,8 @@ public: * @param name Optional name of the ports * @return The created port tuple */ - static std::tuple<SharedPtr<ServerPort>, SharedPtr<ClientPort>> CreatePortPair( - KernelCore& kernel, u32 max_sessions, std::string name = "UnknownPort"); + static PortPair CreatePortPair(KernelCore& kernel, u32 max_sessions, + std::string name = "UnknownPort"); std::string GetTypeName() const override { return "ServerPort"; diff --git a/src/core/hle/kernel/server_session.cpp b/src/core/hle/kernel/server_session.cpp index 40cec143e..a6b2cf06a 100644 --- a/src/core/hle/kernel/server_session.cpp +++ b/src/core/hle/kernel/server_session.cpp @@ -204,6 +204,6 @@ ServerSession::SessionPair ServerSession::CreateSessionPair(KernelCore& kernel, client_session->parent = parent; server_session->parent = parent; - return std::make_tuple(std::move(server_session), std::move(client_session)); + return std::make_pair(std::move(server_session), std::move(client_session)); } } // namespace Kernel diff --git a/src/core/hle/kernel/server_session.h b/src/core/hle/kernel/server_session.h index 3429a326f..09b835ff8 100644 --- a/src/core/hle/kernel/server_session.h +++ b/src/core/hle/kernel/server_session.h @@ -6,6 +6,7 @@ #include <memory> #include <string> +#include <utility> #include <vector> #include "core/hle/kernel/object.h" @@ -58,7 +59,7 @@ public: return parent.get(); } - using SessionPair = std::tuple<SharedPtr<ServerSession>, SharedPtr<ClientSession>>; + using SessionPair = std::pair<SharedPtr<ServerSession>, SharedPtr<ClientSession>>; /** * Creates a pair of ServerSession and an associated ClientSession. diff --git a/src/core/memory.h b/src/core/memory.h index a72d10a0a..6845f5fe1 100644 --- a/src/core/memory.h +++ b/src/core/memory.h @@ -28,16 +28,6 @@ constexpr u64 PAGE_MASK = PAGE_SIZE - 1; /// Virtual user-space memory regions enum : VAddr { - /// Read-only page containing kernel and system configuration values. - CONFIG_MEMORY_VADDR = 0x1FF80000, - CONFIG_MEMORY_SIZE = 0x00001000, - CONFIG_MEMORY_VADDR_END = CONFIG_MEMORY_VADDR + CONFIG_MEMORY_SIZE, - - /// Usually read-only page containing mostly values read from hardware. - SHARED_PAGE_VADDR = 0x1FF81000, - SHARED_PAGE_SIZE = 0x00001000, - SHARED_PAGE_VADDR_END = SHARED_PAGE_VADDR + SHARED_PAGE_SIZE, - /// TLS (Thread-Local Storage) related. TLS_ENTRY_SIZE = 0x200, |