summaryrefslogtreecommitdiff
path: root/na/kernel/sched_class_o1.cc
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-07-10 11:24:56 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-07-10 11:24:56 +0800
commit1767d390fbf3d0c65389de46caf0b6d43ef3b6ad (patch)
tree0f5e01cd7c7a05abb6b1c7472d7f00f49caf02cc /na/kernel/sched_class_o1.cc
parent63dc025705f6533b91fb1a7d26e6ed864efd9900 (diff)
downloadlume-1767d390fbf3d0c65389de46caf0b6d43ef3b6ad.tar.gz
lume-1767d390fbf3d0c65389de46caf0b6d43ef3b6ad.tar.xz
feat: establish bootable new architecture checkpoint
Replace the compressed boot path with a relocatable higher-half RISC-V entry, expand memory and SMP support, and add the driver, TTY, VFS, exec, signal, syscall, initramfs, and self-test infrastructure needed for a bootable kernel checkpoint.
Diffstat (limited to 'na/kernel/sched_class_o1.cc')
-rw-r--r--na/kernel/sched_class_o1.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/na/kernel/sched_class_o1.cc b/na/kernel/sched_class_o1.cc
index a8ba5df..28c693c 100644
--- a/na/kernel/sched_class_o1.cc
+++ b/na/kernel/sched_class_o1.cc
@@ -44,8 +44,13 @@ int32 priority_to_timeslice(uint8 priority)
static void o1_task_tick(RunQueue* rq, TaskControlBlock* curr)
{
- if (curr == rq->idle())
+ if (curr == rq->idle()) {
+ /* Idle task: if anything is runnable, yield immediately */
+ if (rq->nr_running() > 0) {
+ rq->set_need_resched(true);
+ }
return;
+ }
curr->time_slice--;
if (curr->time_slice <= 0) {