mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-09-09 15:59:08 +01:00
kernel: remove general boost lists
This commit is contained in:
parent
2afaa7aed7
commit
b143ce8134
7 changed files with 26 additions and 19 deletions
|
@ -5,14 +5,15 @@
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
|
|
||||||
#include <boost/intrusive/list.hpp>
|
#include "common/intrusive_list.h"
|
||||||
|
|
||||||
#include "core/hle/kernel/slab_helpers.h"
|
#include "core/hle/kernel/slab_helpers.h"
|
||||||
#include "core/hle/kernel/svc_types.h"
|
#include "core/hle/kernel/svc_types.h"
|
||||||
|
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
|
|
||||||
class KEventInfo : public KSlabAllocated<KEventInfo>, public boost::intrusive::list_base_hook<> {
|
class KEventInfo : public KSlabAllocated<KEventInfo>,
|
||||||
|
public Common::IntrusiveListBaseNode<KEventInfo> {
|
||||||
public:
|
public:
|
||||||
struct InfoCreateThread {
|
struct InfoCreateThread {
|
||||||
u32 thread_id{};
|
u32 thread_id{};
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <boost/intrusive/list.hpp>
|
|
||||||
|
#include "common/intrusive_list.h"
|
||||||
|
|
||||||
#include "core/hle/kernel/k_light_lock.h"
|
#include "core/hle/kernel/k_light_lock.h"
|
||||||
#include "core/hle/kernel/slab_helpers.h"
|
#include "core/hle/kernel/slab_helpers.h"
|
||||||
|
@ -15,13 +16,14 @@ namespace Kernel {
|
||||||
|
|
||||||
class KObjectNameGlobalData;
|
class KObjectNameGlobalData;
|
||||||
|
|
||||||
class KObjectName : public KSlabAllocated<KObjectName>, public boost::intrusive::list_base_hook<> {
|
class KObjectName : public KSlabAllocated<KObjectName>,
|
||||||
|
public Common::IntrusiveListBaseNode<KObjectName> {
|
||||||
public:
|
public:
|
||||||
explicit KObjectName(KernelCore&) {}
|
explicit KObjectName(KernelCore&) {}
|
||||||
virtual ~KObjectName() = default;
|
virtual ~KObjectName() = default;
|
||||||
|
|
||||||
static constexpr size_t NameLengthMax = 12;
|
static constexpr size_t NameLengthMax = 12;
|
||||||
using List = boost::intrusive::list<KObjectName>;
|
using List = Common::IntrusiveListBaseTraits<KObjectName>::ListType;
|
||||||
|
|
||||||
static Result NewFromName(KernelCore& kernel, KAutoObject* obj, const char* name);
|
static Result NewFromName(KernelCore& kernel, KAutoObject* obj, const char* name);
|
||||||
static Result Delete(KernelCore& kernel, KAutoObject* obj, const char* name);
|
static Result Delete(KernelCore& kernel, KAutoObject* obj, const char* name);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include <boost/intrusive/list.hpp>
|
#include "common/intrusive_list.h"
|
||||||
|
|
||||||
#include "core/hle/kernel/k_server_session.h"
|
#include "core/hle/kernel/k_server_session.h"
|
||||||
#include "core/hle/kernel/k_synchronization_object.h"
|
#include "core/hle/kernel/k_synchronization_object.h"
|
||||||
|
@ -42,7 +42,7 @@ public:
|
||||||
bool IsSignaled() const override;
|
bool IsSignaled() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
using SessionList = boost::intrusive::list<KServerSession>;
|
using SessionList = Common::IntrusiveListBaseTraits<KServerSession>::ListType;
|
||||||
|
|
||||||
void CleanupSessions();
|
void CleanupSessions();
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include <boost/intrusive/list.hpp>
|
#include "common/intrusive_list.h"
|
||||||
|
|
||||||
#include "core/hle/kernel/k_light_lock.h"
|
#include "core/hle/kernel/k_light_lock.h"
|
||||||
#include "core/hle/kernel/k_session_request.h"
|
#include "core/hle/kernel/k_session_request.h"
|
||||||
|
@ -27,7 +27,7 @@ class KSession;
|
||||||
class KThread;
|
class KThread;
|
||||||
|
|
||||||
class KServerSession final : public KSynchronizationObject,
|
class KServerSession final : public KSynchronizationObject,
|
||||||
public boost::intrusive::list_base_hook<> {
|
public Common::IntrusiveListBaseNode<KServerSession> {
|
||||||
KERNEL_AUTOOBJECT_TRAITS(KServerSession, KSynchronizationObject);
|
KERNEL_AUTOOBJECT_TRAITS(KServerSession, KSynchronizationObject);
|
||||||
|
|
||||||
friend class ServiceThread;
|
friend class ServiceThread;
|
||||||
|
@ -67,7 +67,8 @@ private:
|
||||||
KSession* m_parent{};
|
KSession* m_parent{};
|
||||||
|
|
||||||
/// List of threads which are pending a reply.
|
/// List of threads which are pending a reply.
|
||||||
boost::intrusive::list<KSessionRequest> m_request_list{};
|
using RequestList = Common::IntrusiveListBaseTraits<KSessionRequest>::ListType;
|
||||||
|
RequestList m_request_list{};
|
||||||
KSessionRequest* m_current_request{};
|
KSessionRequest* m_current_request{};
|
||||||
|
|
||||||
KLightLock m_lock;
|
KLightLock m_lock;
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
|
|
||||||
|
#include "common/intrusive_list.h"
|
||||||
|
|
||||||
#include "core/hle/kernel/k_auto_object.h"
|
#include "core/hle/kernel/k_auto_object.h"
|
||||||
#include "core/hle/kernel/k_event.h"
|
#include "core/hle/kernel/k_event.h"
|
||||||
#include "core/hle/kernel/k_memory_block.h"
|
#include "core/hle/kernel/k_memory_block.h"
|
||||||
|
@ -16,7 +18,7 @@ namespace Kernel {
|
||||||
|
|
||||||
class KSessionRequest final : public KSlabAllocated<KSessionRequest>,
|
class KSessionRequest final : public KSlabAllocated<KSessionRequest>,
|
||||||
public KAutoObject,
|
public KAutoObject,
|
||||||
public boost::intrusive::list_base_hook<> {
|
public Common::IntrusiveListBaseNode<KSessionRequest> {
|
||||||
KERNEL_AUTOOBJECT_TRAITS(KSessionRequest, KAutoObject);
|
KERNEL_AUTOOBJECT_TRAITS(KSessionRequest, KAutoObject);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <boost/intrusive/list.hpp>
|
#include "common/intrusive_list.h"
|
||||||
|
|
||||||
#include "core/hle/kernel/slab_helpers.h"
|
#include "core/hle/kernel/slab_helpers.h"
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ namespace Kernel {
|
||||||
class KSharedMemory;
|
class KSharedMemory;
|
||||||
|
|
||||||
class KSharedMemoryInfo final : public KSlabAllocated<KSharedMemoryInfo>,
|
class KSharedMemoryInfo final : public KSlabAllocated<KSharedMemoryInfo>,
|
||||||
public boost::intrusive::list_base_hook<> {
|
public Common::IntrusiveListBaseNode<KSharedMemoryInfo> {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit KSharedMemoryInfo(KernelCore&) {}
|
explicit KSharedMemoryInfo(KernelCore&) {}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <boost/intrusive/list.hpp>
|
#include "common/intrusive_list.h"
|
||||||
|
|
||||||
#include "common/intrusive_red_black_tree.h"
|
#include "common/intrusive_red_black_tree.h"
|
||||||
#include "common/spin_lock.h"
|
#include "common/spin_lock.h"
|
||||||
|
@ -119,7 +119,7 @@ s32 GetCurrentCoreId(KernelCore& kernel);
|
||||||
Core::Memory::Memory& GetCurrentMemory(KernelCore& kernel);
|
Core::Memory::Memory& GetCurrentMemory(KernelCore& kernel);
|
||||||
|
|
||||||
class KThread final : public KAutoObjectWithSlabHeapAndContainer<KThread, KWorkerTask>,
|
class KThread final : public KAutoObjectWithSlabHeapAndContainer<KThread, KWorkerTask>,
|
||||||
public boost::intrusive::list_base_hook<>,
|
public Common::IntrusiveListBaseNode<KThread>,
|
||||||
public KTimerTask {
|
public KTimerTask {
|
||||||
KERNEL_AUTOOBJECT_TRAITS(KThread, KSynchronizationObject);
|
KERNEL_AUTOOBJECT_TRAITS(KThread, KSynchronizationObject);
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ public:
|
||||||
public:
|
public:
|
||||||
using ThreadContext32 = Core::ARM_Interface::ThreadContext32;
|
using ThreadContext32 = Core::ARM_Interface::ThreadContext32;
|
||||||
using ThreadContext64 = Core::ARM_Interface::ThreadContext64;
|
using ThreadContext64 = Core::ARM_Interface::ThreadContext64;
|
||||||
using WaiterList = boost::intrusive::list<KThread>;
|
using WaiterList = Common::IntrusiveListBaseTraits<KThread>::ListType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the thread's current priority
|
* Gets the thread's current priority
|
||||||
|
@ -750,8 +750,9 @@ private:
|
||||||
ConditionVariableThreadTreeTraits::TreeType<LockWithPriorityInheritanceComparator>;
|
ConditionVariableThreadTreeTraits::TreeType<LockWithPriorityInheritanceComparator>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
class LockWithPriorityInheritanceInfo : public KSlabAllocated<LockWithPriorityInheritanceInfo>,
|
class LockWithPriorityInheritanceInfo
|
||||||
public boost::intrusive::list_base_hook<> {
|
: public KSlabAllocated<LockWithPriorityInheritanceInfo>,
|
||||||
|
public Common::IntrusiveListBaseNode<LockWithPriorityInheritanceInfo> {
|
||||||
public:
|
public:
|
||||||
explicit LockWithPriorityInheritanceInfo(KernelCore&) {}
|
explicit LockWithPriorityInheritanceInfo(KernelCore&) {}
|
||||||
|
|
||||||
|
@ -839,7 +840,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
using LockWithPriorityInheritanceInfoList =
|
using LockWithPriorityInheritanceInfoList =
|
||||||
boost::intrusive::list<LockWithPriorityInheritanceInfo>;
|
Common::IntrusiveListBaseTraits<LockWithPriorityInheritanceInfo>::ListType;
|
||||||
|
|
||||||
ConditionVariableThreadTree* m_condvar_tree{};
|
ConditionVariableThreadTree* m_condvar_tree{};
|
||||||
u64 m_condvar_key{};
|
u64 m_condvar_key{};
|
||||||
|
|
Loading…
Reference in a new issue