diff options
author | Subv <subv2112@gmail.com> | 2016-05-22 18:22:49 +0200 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2016-06-05 16:35:31 +0200 |
commit | 3d9fbffbabbe2125ae6208d2d0049552e9293e49 (patch) | |
tree | 3a3d81d602b210bbf38323dd4898ff5225bf8754 /src/core/hle/kernel/server_port.h | |
parent | Merge pull request #1863 from mailwl/gpu-threadid-reset (diff) | |
download | yuzu-3d9fbffbabbe2125ae6208d2d0049552e9293e49.tar yuzu-3d9fbffbabbe2125ae6208d2d0049552e9293e49.tar.gz yuzu-3d9fbffbabbe2125ae6208d2d0049552e9293e49.tar.bz2 yuzu-3d9fbffbabbe2125ae6208d2d0049552e9293e49.tar.lz yuzu-3d9fbffbabbe2125ae6208d2d0049552e9293e49.tar.xz yuzu-3d9fbffbabbe2125ae6208d2d0049552e9293e49.tar.zst yuzu-3d9fbffbabbe2125ae6208d2d0049552e9293e49.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/server_port.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/core/hle/kernel/server_port.h b/src/core/hle/kernel/server_port.h new file mode 100644 index 000000000..e41ef8ce4 --- /dev/null +++ b/src/core/hle/kernel/server_port.h @@ -0,0 +1,43 @@ +// Copyright 2016 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include <string> + +#include "common/common_types.h" + +#include "core/hle/kernel/kernel.h" + +namespace Kernel { + +class ServerPort final : public WaitObject { +public: + /** + * Creates a pair of a ServerPort and an associated ClientPort. + * @param max_sessions Maximum number of sessions to the port + * @param name Optional name of the ports + * @return The created port tuple + */ + static std::tuple<SharedPtr<ServerPort>, SharedPtr<ClientPort>> CreatePortPair(u32 max_sessions, std::string name = "UnknownPort"); + + std::string GetTypeName() const override { return "ServerPort"; } + std::string GetName() const override { return name; } + + static const HandleType HANDLE_TYPE = HandleType::ServerPort; + HandleType GetHandleType() const override { return HANDLE_TYPE; } + + std::string name; ///< Name of port (optional) + + std::vector<SharedPtr<WaitObject>> pending_sessions; ///< ServerSessions waiting to be accepted by the port + + bool ShouldWait() override; + void Acquire() override; + +private: + ServerPort(); + ~ServerPort() override; +}; + +} // namespace |