kernel: use list.h for scheduling run queues

This commit is contained in:
wnstngs
2026-10-07 10:24:50 +03:00
parent 3894be1a15
commit 513faa92c7
4 changed files with 41 additions and 65 deletions
+2 -5
View File
@@ -20,15 +20,12 @@
#define SCHED_SLEEP_TIME_LIMIT_CPU_US 1000
typedef struct {
struct {
thread_t *ins;
thread_t *run;
} queues[SCHED_RUN_QUEUE_SIZE];
list_t queues[SCHED_RUN_QUEUE_SIZE];
bitmap_t thread_bitmap;
} sched_run_queue_t;
typedef struct {
thread_t *queues[SCHED_RUN_QUEUE_SIZE];
list_t queues[SCHED_RUN_QUEUE_SIZE];
int ins;
int run;
size_t thread_count;
+2 -2
View File
@@ -7,6 +7,7 @@
#include <kernel/signal.h>
#include <kernel/event.h>
#include <kernel/kcov.h>
#include <list.h>
#define THREAD_FLAGS_QUEUED 1
#define THREAD_FLAGS_RUNNING 2
@@ -23,8 +24,7 @@ struct proc_t;
typedef struct thread_t {
void *kernelstacktop;
struct thread_t *next;
struct thread_t *prev;
list_node_t queue_node;
struct thread_t *sleepnext;
struct thread_t *sleepprev;
struct thread_t *procnext;