ptos: ke: Add per-processor scheduler queue + PBI packer

Signed-off-by: Chloe M <chloe@mensia.org>
This commit is contained in:
2026-07-14 00:48:11 -04:00
committed by Chloe M.
parent cf0e104b12
commit 7a2aec4e12
9 changed files with 447 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
/*
* Copyright (c) 2026, Chloe M.
* Provided under the BSD-3 clause.
*
* Description: Scheduler management
* Author: Chloe M.
*/
#ifndef _KE_SCHED_H_
#define _KE_SCHED_H_ 1
#include <ps/thread.h>
#include <ptdef.h>
#include <queue.h>
/*
* Represents a scheduler queue that threads can be pulled
* from and added to.
*
* @ThreadQueue: Represents the actual queue that holds threads
* @QueueEntries: Represents the number of entries in the queue
*/
typedef struct {
TAILQ_HEAD(, _THREAD) ThreadQueue;
USIZE QueueEntries;
} SCHED_QUEUE;
/* Macro used to initialize the scheduler queue */
#define SCHED_QUEUE_INIT(SQ_P) \
TAILQ_INIT(&(SQ_P)->ThreadQueue); \
(SQ_P)->QueueEntries = 0;
#endif /* !_KE_SCHED_H_ */