uefi_async/no_alloc/
config.rs

1use crate::no_alloc::lifo::Worker;
2
3pub trait ExecutorConfig {
4    const CORE_SIZE: usize;
5    const QUEUE_SIZE: usize;
6}
7
8// 4核特化配置
9pub struct SmallConfig;
10impl ExecutorConfig for SmallConfig {
11    const CORE_SIZE: usize = 4;
12    const QUEUE_SIZE: usize = 256;
13}
14
15// 16核特化配置
16pub struct LargeConfig;
17impl ExecutorConfig for LargeConfig {
18    const CORE_SIZE: usize = 16;
19    const QUEUE_SIZE: usize = 128; // 核心多时可以适当减小单核队列
20}
21
22macro_rules! register_config {
23    ($config_type:ty) => {};
24}
25
26// TODO: 注册特化
27register_config!(SmallConfig);
28register_config!(LargeConfig);