Add dynamically-allocated CPU-local objects

This commit is contained in:
Wang Siyuan
2025-06-03 14:00:47 +00:00
committed by Ruihan Li
parent f24bc718fa
commit dfd3042276
12 changed files with 698 additions and 240 deletions

View File

@ -8,7 +8,7 @@ use core::{
};
use intrusive_collections::{intrusive_adapter, LinkedList, LinkedListAtomicLink};
use ostd::{cpu::local::CpuLocal, cpu_local, trap};
use ostd::{cpu::local::StaticCpuLocal, cpu_local, trap};
use super::{
softirq_id::{TASKLESS_SOFTIRQ_ID, TASKLESS_URGENT_SOFTIRQ_ID},
@ -123,7 +123,7 @@ impl Taskless {
fn do_schedule(
taskless: &Arc<Taskless>,
taskless_list: &'static CpuLocal<RefCell<LinkedList<TasklessAdapter>>>,
taskless_list: &'static StaticCpuLocal<RefCell<LinkedList<TasklessAdapter>>>,
) {
if taskless.is_disabled.load(Ordering::Acquire) {
return;
@ -158,7 +158,7 @@ pub(super) fn init() {
/// If the `Taskless` is ready to be executed, it will be set to not scheduled
/// and can be scheduled again.
fn taskless_softirq_handler(
taskless_list: &'static CpuLocal<RefCell<LinkedList<TasklessAdapter>>>,
taskless_list: &'static StaticCpuLocal<RefCell<LinkedList<TasklessAdapter>>>,
softirq_id: u8,
) {
let mut processing_list = {