chore: make yuzu REUSE compliant
[REUSE] is a specification that aims at making file copyright
information consistent, so that it can be both human and machine
readable. It basically requires that all files have a header containing
copyright and licensing information. When this isn't possible, like
when dealing with binary assets, generated files or embedded third-party
dependencies, it is permitted to insert copyright information in the
`.reuse/dep5` file.
Oh, and it also requires that all the licenses used in the project are
present in the `LICENSES` folder, that's why the diff is so huge.
This can be done automatically with `reuse download --all`.
The `reuse` tool also contains a handy subcommand that analyzes the
project and tells whether or not the project is (still) compliant,
`reuse lint`.
Following REUSE has a few advantages over the current approach:
- Copyright information is easy to access for users / downstream
- Files like `dist/license.md` do not need to exist anymore, as
`.reuse/dep5` is used instead
- `reuse lint` makes it easy to ensure that copyright information of
files like binary assets / images is always accurate and up to date
To add copyright information of files that didn't have it I looked up
who committed what and when, for each file. As yuzu contributors do not
have to sign a CLA or similar I couldn't assume that copyright ownership
was of the "yuzu Emulator Project", so I used the name and/or email of
the commit author instead.
[REUSE]: https://reuse.software
Follow-up to 01cf05bc75b1e47beb08937439f3ed9339e7b254
2022-05-15 02:06:02 +02:00
|
|
|
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2016-05-22 18:22:49 +02:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2019-12-08 04:09:20 +01:00
|
|
|
#include <memory>
|
|
|
|
|
2016-05-22 18:22:49 +02:00
|
|
|
#include "common/common_types.h"
|
2021-04-22 06:43:25 +02:00
|
|
|
#include "core/hle/kernel/k_synchronization_object.h"
|
2017-05-30 01:45:42 +02:00
|
|
|
#include "core/hle/result.h"
|
2016-05-22 18:22:49 +02:00
|
|
|
|
|
|
|
namespace Kernel {
|
|
|
|
|
2021-04-14 02:48:37 +02:00
|
|
|
class KClientSession;
|
2018-08-28 18:30:33 +02:00
|
|
|
class KernelCore;
|
2021-04-24 02:00:15 +02:00
|
|
|
class KPort;
|
2016-05-22 19:30:13 +02:00
|
|
|
|
2021-04-22 06:43:25 +02:00
|
|
|
class KClientPort final : public KSynchronizationObject {
|
|
|
|
KERNEL_AUTOOBJECT_TRAITS(KClientPort, KSynchronizationObject);
|
|
|
|
|
2016-05-22 18:22:49 +02:00
|
|
|
public:
|
2023-03-07 02:34:25 +01:00
|
|
|
explicit KClientPort(KernelCore& kernel);
|
2021-05-29 08:49:07 +02:00
|
|
|
~KClientPort() override;
|
2019-11-25 02:15:51 +01:00
|
|
|
|
2023-03-07 02:34:25 +01:00
|
|
|
void Initialize(KPort* parent, s32 max_sessions);
|
2021-04-24 02:00:15 +02:00
|
|
|
void OnSessionFinalized();
|
|
|
|
void OnServerClosed();
|
2016-12-01 05:28:31 +01:00
|
|
|
|
2021-05-01 21:43:00 +02:00
|
|
|
const KPort* GetParent() const {
|
2023-03-07 02:34:25 +01:00
|
|
|
return m_parent;
|
2021-04-24 02:00:15 +02:00
|
|
|
}
|
2021-05-16 08:49:03 +02:00
|
|
|
KPort* GetParent() {
|
2023-03-07 02:34:25 +01:00
|
|
|
return m_parent;
|
2021-05-16 08:49:03 +02:00
|
|
|
}
|
2018-10-06 08:49:01 +02:00
|
|
|
|
2021-04-24 02:00:15 +02:00
|
|
|
s32 GetNumSessions() const {
|
2023-03-07 02:34:25 +01:00
|
|
|
return m_num_sessions;
|
2021-04-24 02:00:15 +02:00
|
|
|
}
|
|
|
|
s32 GetPeakSessions() const {
|
2023-03-07 02:34:25 +01:00
|
|
|
return m_peak_sessions;
|
2021-04-24 02:00:15 +02:00
|
|
|
}
|
|
|
|
s32 GetMaxSessions() const {
|
2023-03-07 02:34:25 +01:00
|
|
|
return m_max_sessions;
|
2021-04-24 02:00:15 +02:00
|
|
|
}
|
2016-06-15 01:03:30 +02:00
|
|
|
|
2021-04-24 02:00:15 +02:00
|
|
|
bool IsLight() const;
|
|
|
|
bool IsServerClosed() const;
|
2016-12-05 17:02:08 +01:00
|
|
|
|
2021-04-22 06:43:25 +02:00
|
|
|
// Overridden virtual functions.
|
2021-05-29 08:49:07 +02:00
|
|
|
void Destroy() override;
|
|
|
|
bool IsSignaled() const override;
|
2021-04-22 06:43:25 +02:00
|
|
|
|
2022-10-16 07:53:56 +02:00
|
|
|
Result CreateSession(KClientSession** out);
|
2021-04-24 02:00:15 +02:00
|
|
|
|
2016-06-18 00:09:43 +02:00
|
|
|
private:
|
2023-03-07 02:34:25 +01:00
|
|
|
std::atomic<s32> m_num_sessions{};
|
|
|
|
std::atomic<s32> m_peak_sessions{};
|
|
|
|
s32 m_max_sessions{};
|
|
|
|
KPort* m_parent{};
|
2016-05-22 18:22:49 +02:00
|
|
|
};
|
|
|
|
|
2018-01-20 08:48:02 +01:00
|
|
|
} // namespace Kernel
|