2021-04-14 02:48:37 +02:00
|
|
|
// Copyright 2021 yuzu emulator team
|
2016-06-15 01:03:30 +02:00
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2016-12-14 18:33:49 +01:00
|
|
|
#include <string>
|
2019-11-26 00:28:48 +01:00
|
|
|
|
2021-04-14 02:48:37 +02:00
|
|
|
#include "core/hle/kernel/k_auto_object.h"
|
|
|
|
#include "core/hle/kernel/slab_helpers.h"
|
2019-11-26 00:28:48 +01:00
|
|
|
#include "core/hle/result.h"
|
2019-01-01 00:09:41 +01:00
|
|
|
|
|
|
|
union ResultCode;
|
2016-06-15 01:03:30 +02:00
|
|
|
|
2020-03-31 21:10:44 +02:00
|
|
|
namespace Core::Memory {
|
2019-11-26 20:10:49 +01:00
|
|
|
class Memory;
|
|
|
|
}
|
|
|
|
|
2020-09-14 20:03:10 +02:00
|
|
|
namespace Core::Timing {
|
|
|
|
class CoreTiming;
|
|
|
|
}
|
|
|
|
|
2016-06-15 01:03:30 +02:00
|
|
|
namespace Kernel {
|
|
|
|
|
2018-08-28 18:30:33 +02:00
|
|
|
class KernelCore;
|
2021-04-14 02:48:37 +02:00
|
|
|
class KSession;
|
2020-12-31 08:01:08 +01:00
|
|
|
class KThread;
|
2016-06-15 01:03:30 +02:00
|
|
|
|
2021-04-14 02:48:37 +02:00
|
|
|
class KClientSession final
|
|
|
|
: public KAutoObjectWithSlabHeapAndContainer<KClientSession, KAutoObjectWithList> {
|
|
|
|
KERNEL_AUTOOBJECT_TRAITS(KClientSession, KAutoObject);
|
2019-11-25 02:15:51 +01:00
|
|
|
|
2021-04-14 02:48:37 +02:00
|
|
|
public:
|
2021-05-08 18:11:36 +02:00
|
|
|
explicit KClientSession(KernelCore& kernel_);
|
2021-05-29 08:49:07 +02:00
|
|
|
~KClientSession() override;
|
2016-06-15 01:03:30 +02:00
|
|
|
|
2021-06-07 00:39:11 +02:00
|
|
|
void Initialize(KSession* parent_session_, std::string&& name_) {
|
2021-04-14 02:48:37 +02:00
|
|
|
// Set member variables.
|
2021-06-07 00:39:11 +02:00
|
|
|
parent = parent_session_;
|
2021-04-14 02:48:37 +02:00
|
|
|
name = std::move(name_);
|
2016-12-01 05:28:31 +01:00
|
|
|
}
|
2016-12-05 17:02:08 +01:00
|
|
|
|
2021-05-29 08:49:07 +02:00
|
|
|
void Destroy() override;
|
2021-04-14 02:48:37 +02:00
|
|
|
static void PostDestroy([[maybe_unused]] uintptr_t arg) {}
|
|
|
|
|
2021-05-01 21:43:15 +02:00
|
|
|
KSession* GetParent() const {
|
2021-04-14 02:48:37 +02:00
|
|
|
return parent;
|
2016-12-01 05:28:31 +01:00
|
|
|
}
|
2016-06-15 01:03:30 +02:00
|
|
|
|
2021-04-14 02:48:37 +02:00
|
|
|
ResultCode SendSyncRequest(KThread* thread, Core::Memory::Memory& memory,
|
|
|
|
Core::Timing::CoreTiming& core_timing);
|
|
|
|
|
|
|
|
void OnServerClosed();
|
|
|
|
|
2019-03-06 00:24:00 +01:00
|
|
|
private:
|
2021-04-14 02:48:37 +02:00
|
|
|
KSession* parent{};
|
2016-06-15 01:03:30 +02:00
|
|
|
};
|
|
|
|
|
2018-01-20 08:48:02 +01:00
|
|
|
} // namespace Kernel
|