8#include <etl/singleton.h>
47static_assert(
sizeof(
PerCpu) <= SIMPLEKERNEL_PER_CPU_ALIGN_SIZE,
48 "PerCpu size should not exceed cache line size");
52 etl::singleton<std::array<PerCpu, SIMPLEKERNEL_MAX_CORE_COUNT>>;
auto GetCurrentCoreId() -> size_t
etl::singleton< std::array< PerCpu, SIMPLEKERNEL_MAX_CORE_COUNT > > PerCpuArraySingleton
PerCpu 数组单例类型
struct per_cpu::PerCpu __attribute__((aligned(SIMPLEKERNEL_PER_CPU_ALIGN_SIZE)))
static __always_inline auto GetCurrentCore() -> PerCpu &
获取当前核心的 PerCpu 数据
PerCpu(PerCpu &&)=default
TaskControlBlock * running_task
当前运行的任务
CpuSchedData * sched_data
调度数据 (RunQueue) 指针
auto operator=(PerCpu &&) -> PerCpu &=default
TaskControlBlock * idle_task
空闲任务
auto operator=(const PerCpu &) -> PerCpu &=default
PerCpu(const PerCpu &)=default