7a2aec4e12
Signed-off-by: Chloe M <chloe@mensia.org>
34 lines
758 B
C
34 lines
758 B
C
/*
|
|
* 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_ */
|