SimpleKernel 1.17.0
Loading...
Searching...
No Matches
kernel_config.hpp
Go to the documentation of this file.
1
5#pragma once
6
7#include <cstddef>
8
9#include "project_config.h"
10
11namespace kernel::config {
12
14inline constexpr size_t kMaxTasks = 128;
16inline constexpr size_t kMaxTasksBuckets = 256;
17
19inline constexpr size_t kMaxSleepingTasks = 64;
20
22inline constexpr size_t kMaxBlockedGroups = 32;
24inline constexpr size_t kMaxBlockedGroupsBuckets = 64;
26inline constexpr size_t kMaxBlockedPerGroup = 16;
27
29inline constexpr size_t kMaxReadyTasks = 64;
30
32inline constexpr size_t kMaxInterruptThreads = 32;
34inline constexpr size_t kMaxInterruptThreadsBuckets = 64;
35
37inline constexpr size_t kTickObservers = 8;
39inline constexpr size_t kPanicObservers = 4;
40} // namespace kernel::config
constexpr size_t kMaxBlockedGroups
阻塞队列:最大资源组数(blocked_tasks 的 map 容量)
constexpr size_t kMaxReadyTasks
调度器就绪队列容量(FIFO / RR / CFS)
constexpr size_t kPanicObservers
最大 panic 观察者数
constexpr size_t kMaxSleepingTasks
每个 CPU 的最大睡眠任务数(sleeping_tasks 容量)
constexpr size_t kMaxTasks
全局最大任务数(task_table_ 容量)
constexpr size_t kMaxInterruptThreadsBuckets
中断线程 map 桶数
constexpr size_t kTickObservers
最大 tick 观察者数
constexpr size_t kMaxInterruptThreads
最大中断线程数
constexpr size_t kMaxTasksBuckets
task_table_ 桶数(建议 = 2 × kMaxTasks)
constexpr size_t kMaxBlockedPerGroup
阻塞队列:每组最大阻塞任务数(etl::list 容量)
constexpr size_t kMaxBlockedGroupsBuckets
阻塞队列:map 桶数