summaryrefslogtreecommitdiff
path: root/include/kernel/runqueue.h
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2025-12-31 18:00:55 +0800
committerRichard Qin <richard.qin.x@gmail.com>2025-12-31 18:00:55 +0800
commitdbba25aa24f86c1f8c3a0589c82985840adc1b6b (patch)
tree11d1d7ee552030d953db9f911d5af6e079291c47 /include/kernel/runqueue.h
parent7759eef8cdac79028dd5b468bd9ce0cf1c12b162 (diff)
downloadlume-dbba25aa24f86c1f8c3a0589c82985840adc1b6b.tar.gz
lume-dbba25aa24f86c1f8c3a0589c82985840adc1b6b.tar.xz
dev:Refactor Memory Management and Process Management
Diffstat (limited to 'include/kernel/runqueue.h')
-rw-r--r--include/kernel/runqueue.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/kernel/runqueue.h b/include/kernel/runqueue.h
new file mode 100644
index 0000000..ea6e4cc
--- /dev/null
+++ b/include/kernel/runqueue.h
@@ -0,0 +1,16 @@
+#pragma once
+#include "kernel/spinlock.h"
+#include "kernel/proc_def.h"
+
+struct RunQueue
+{
+ Spinlock lock;
+ struct Proc *heads[N_PRIO];
+ struct Proc *tails[N_PRIO];
+ uint64 count;
+
+ void init(const char *name);
+ void enqueue(struct Proc *p);
+ struct Proc *dequeue();
+ struct Proc *steal();
+}; \ No newline at end of file