mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-16 08:04:23 -04:00
kern: implement KPriorityQueue
This commit is contained in:
parent
e1adbb6dba
commit
d262ff92cc
4 changed files with 457 additions and 0 deletions
|
@ -34,6 +34,29 @@ namespace ams::kern {
|
|||
void *context; /* TODO: KThreadContext * */
|
||||
};
|
||||
static_assert(alignof(StackParameters) == 0x10);
|
||||
|
||||
struct QueueEntry {
|
||||
private:
|
||||
KThread *prev;
|
||||
KThread *next;
|
||||
public:
|
||||
constexpr ALWAYS_INLINE QueueEntry() : prev(nullptr), next(nullptr) { /* ... */ }
|
||||
|
||||
constexpr ALWAYS_INLINE KThread *GetPrev() const { return this->prev; }
|
||||
constexpr ALWAYS_INLINE KThread *GetNext() const { return this->next; }
|
||||
constexpr ALWAYS_INLINE void SetPrev(KThread *t) { this->prev = t; }
|
||||
constexpr ALWAYS_INLINE void SetNext(KThread *t) { this->next = t; }
|
||||
};
|
||||
private:
|
||||
/* TODO: Other members. These are placeholder to get KScheduler to compile. */
|
||||
KAffinityMask affinity_mask;
|
||||
public:
|
||||
constexpr KThread() : KAutoObjectWithSlabHeapAndContainer<KThread, KSynchronizationObject>(), affinity_mask() { /* ... */ }
|
||||
|
||||
constexpr ALWAYS_INLINE const KAffinityMask &GetAffinityMask() const { return this->affinity_mask; }
|
||||
public:
|
||||
static void PostDestroy(uintptr_t arg);
|
||||
|
||||
/* TODO: This is a placeholder definition. */
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue