#include <cpu_io.h>
#include <etl/singleton.h>
#include <unistd.h>
#include <array>
#include <atomic>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
Go to the source code of this file.
◆ operator=() [1/2]
| auto __attribute__::operator= |
( |
const PerCpu & |
| ) |
-> PerCpu &=default |
|
default |
◆ operator=() [2/2]
| auto __attribute__::operator= |
( |
PerCpu && |
| ) |
-> PerCpu &=default |
|
default |
◆ PerCpu() [1/4]
| __attribute__::PerCpu |
( |
| ) |
|
|
default |
◆ PerCpu() [2/4]
| __attribute__::PerCpu |
( |
const PerCpu & |
| ) |
|
|
default |
◆ PerCpu() [3/4]
| __attribute__::PerCpu |
( |
PerCpu && |
| ) |
|
|
default |
◆ PerCpu() [4/4]
| __attribute__::PerCpu |
( |
size_t |
id | ) |
|
|
explicit |
Definition at line 12 of file per_cpu.hpp.
20{
21
26
33
37
46
47static_assert(
sizeof(
PerCpu) <= SIMPLEKERNEL_PER_CPU_ALIGN_SIZE,
48 "PerCpu size should not exceed cache line size");
49
52 etl::singleton<std::array<PerCpu, SIMPLEKERNEL_MAX_CORE_COUNT>>;
53
57}
58
59}
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 数据
CpuSchedData * sched_data
调度数据 (RunQueue) 指针
TaskControlBlock * idle_task
空闲任务
TaskControlBlock * running_task
当前运行的任务
auto operator=(const PerCpu &) -> PerCpu &=default
◆ ~PerCpu()
| __attribute__::~PerCpu |
( |
| ) |
|
|
default |
◆ core_id
◆ idle_task
◆ running_task
◆ sched_data
调度数据 (RunQueue) 指针
Definition at line 8 of file per_cpu.hpp.