Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Simple-XX/SimpleKernel
/ functions
Functions
1,141 in github.com/Simple-XX/SimpleKernel
⨍
Functions
1,141
◇
Types & classes
206
↓ 414 callers
Function
Info
src/include/kernel_log.hpp:182
↓ 277 callers
Function
Err
src/include/kernel_log.hpp:200
↓ 208 callers
Method
Enqueue
* @brief 将任务加入就绪队列 * @param task 任务控制块指针 * * 新加入的任务的 vruntime 设置为当前 min_vruntime,防止饥饿。 */
src/task/include/cfs_scheduler.hpp:58
↓ 173 callers
Method
PickNext
* @brief 选择下一个要运行的任务 * @return TaskControlBlock* 下一个任务,如果队列为空则返回 nullptr * * 选择 vruntime 最小的任务,实现完全公平调度。 */
src/task/include/cfs_scheduler.hpp:103
↓ 104 callers
Function
sys_exit
src/syscall.cpp:97
↓ 103 callers
Method
AddTask
src/task/task_manager.cpp:94
↓ 93 callers
Method
GetQueueSize
* @brief 获取就绪队列大小 * @return size_t 队列中的任务数量 */
src/task/include/cfs_scheduler.hpp:126
↓ 84 callers
Function
sys_sleep
src/syscall.cpp:112
↓ 70 callers
Method
Receive
* @brief 向 FSM 发送消息 * @param msg 要发送的消息 * @pre 调用者持有保护此 TCB 的锁(如 cpu_sched.lock) * @post cached_state_ 以 release 语义更新,跨核可见 */
src/task/include/task_fsm.hpp:170
↓ 69 callers
Function
Debug
src/include/kernel_log.hpp:173
↓ 48 callers
Method
UnLock
src/task/mutex.cpp:74
↓ 45 callers
Method
IsEmpty
* @brief 判断队列是否为空 * @return bool 队列为空返回 true */
src/task/include/cfs_scheduler.hpp:134
↓ 45 callers
Method
message
src/include/expected.hpp:352
↓ 43 callers
Method
Dequeue
* @brief 从就绪队列中移除指定任务 * @param task 要移除的任务控制块指针 */
src/task/include/cfs_scheduler.hpp:85
↓ 43 callers
Method
GetStats
* @brief 获取调度器统计信息 * @return 统计信息结构体 */
src/task/include/scheduler_base.hpp:144
↓ 43 callers
Method
size
* @brief Get an approximate size of the queue * * Note: This is an approximation and may not be accurate in concurrent * scenarios. * *
3rd/MPMCQueue/include/MPMCQueue.hpp:132
↓ 41 callers
Method
GetCurrentTask
* @brief 获取当前任务 * @return TaskControlBlock* 当前正在运行的任务 */
src/task/include/task_manager.hpp:117
↓ 41 callers
Method
Lock
src/task/mutex.cpp:11
↓ 36 callers
Function
strncpy
复制指定长度的字符串
src/libc/sk_string.c:85
↓ 35 callers
Function
memset
设置内存块
src/libc/sk_string.c:40
↓ 35 callers
Function
strcmp
比较字符串
src/libc/sk_string.c:109
↓ 34 callers
Function
GetCurrentCoreId
使用线程 ID 映射到核心 ID(用于测试多核场景)
tests/unit_test/mocks/cpu_io.h:26
↓ 34 callers
Function
GetInterruptStatus
tests/unit_test/mocks/cpu_io.h:48
↓ 33 callers
Function
Write
src/filesystem/vfs/write.cpp:13
↓ 31 callers
Function
Pause
tests/unit_test/mocks/cpu_io.h:20
↓ 29 callers
Function
Read
src/filesystem/vfs/read.cpp:13
↓ 28 callers
Method
GetStatus
src/task/task_control_block.cpp:88
↓ 25 callers
Function
Warn
src/include/kernel_log.hpp:191
↓ 23 callers
Function
GetVfsState
src/filesystem/vfs/vfs.cpp:17
↓ 23 callers
Method
Wait
src/task/wait.cpp:13
↓ 22 callers
Method
OnTick
* @brief 每个 tick 更新任务的 vruntime * @param current 当前运行的任务 * @return bool 返回 true 表示需要抢占当前任务 * * CFS 核心逻辑: * 1. 更新当前任务的 vruntime(考虑权重)
src/task/include/cfs_scheduler.hpp:147
↓ 21 callers
Function
strlen
获取字符串长度
src/libc/sk_string.c:134
↓ 20 callers
Function
RawPut
绕过队列直接输出至串口(用于 panic 路径)
src/include/kernel_log.hpp:211
↓ 19 callers
Method
GetMapping
src/memory/virtual_memory.cpp:141
↓ 18 callers
Method
DestroyPageDirectory
src/memory/virtual_memory.cpp:160
↓ 15 callers
Function
GetUserPagePermissions
获取用户页面权限
tests/unit_test/mocks/cpu_io.h:79
↓ 15 callers
Method
MapPage
src/memory/virtual_memory.cpp:74
↓ 15 callers
Method
OnPreempted
* @brief 任务被抢占时调用 * @param task 被抢占的任务 * * 被抢占的任务需要重新入队,保持其 vruntime。 */
src/task/include/cfs_scheduler.hpp:176
↓ 15 callers
Function
aligned_alloc
tests/unit_test/virtual_memory_test.cpp:65
↓ 14 callers
Method
BindThreadToCore
tests/unit_test/mocks/test_environment_state.cpp:66
↓ 14 callers
Method
SetCurrentThreadEnvironment
tests/unit_test/mocks/test_environment_state.cpp:18
↓ 14 callers
Method
push
* @brief Attempt to enqueue an item * * @param item The item to enqueue * @return true if the item was successfully enqueued * @return fal
3rd/MPMCQueue/include/MPMCQueue.hpp:65
↓ 13 callers
Method
ReadConfigU32
src/device/virtio/transport/pci.hpp:50
↓ 13 callers
Function
aligned_free
src/memory/memory.cpp:96
↓ 13 callers
Method
empty
* @brief Check if the queue is empty (approximate) * * Note: This is an approximation and may not be accurate in concurrent * scenarios. *
3rd/MPMCQueue/include/MPMCQueue.hpp:147
↓ 13 callers
Method
pop
* @brief Attempt to dequeue an item * * @param item Reference to store the dequeued item * @return true if an item was successfully dequeued
3rd/MPMCQueue/include/MPMCQueue.hpp:87
↓ 12 callers
Function
GetCurrentCore
@brief 获取当前核心的 PerCpu 数据
src/include/per_cpu.hpp:55
↓ 12 callers
Method
JoinThreadGroup
src/task/task_control_block.cpp:92
↓ 12 callers
Function
Open
src/filesystem/vfs/open.cpp:14
↓ 12 callers
Function
putchar_
tests/integration_test/opensbi_test/main.cpp:12
↓ 11 callers
Function
Close
src/filesystem/vfs/close.cpp:15
↓ 11 callers
Method
GetMemory
* @brief 获取内存信息 * @return Expected<std::pair<uint64_t, size_t>> 内存信息<地址,长度> * @pre fdt_header_ 不为空 * @post 返回第一个 reg 条目的 base 和 size */
src/include/kernel_fdt.hpp:92
↓ 11 callers
Method
GetRootInode
src/filesystem/ramfs/ramfs.cpp:165
↓ 11 callers
Function
free
src/memory/memory.cpp:69
↓ 11 callers
Function
memcmp
比较内存块
src/libc/sk_string.c:49
↓ 11 callers
Function
memcpy
复制内存块
src/libc/sk_string.c:12
↓ 10 callers
Method
Create
src/filesystem/ramfs/ramfs.cpp:188
↓ 10 callers
Function
EnableInterrupt
tests/unit_test/mocks/cpu_io.h:34
↓ 10 callers
Function
FresultToErrorCode
* @brief 将 FatFS FRESULT 映射到内核 ErrorCode * @details 区分常见错误类别,避免将所有错误笼统归入 kFsCorrupted */
src/filesystem/fatfs/fatfs.cpp:23
↓ 10 callers
Function
aligned_alloc
src/memory/memory.cpp:89
↓ 9 callers
Method
Get
src/arch/riscv64/plic/plic.cpp:80
↓ 9 callers
Function
GetMountTable
src/filesystem/vfs/mount.cpp:234
↓ 9 callers
Method
RegisterInterruptFunc
src/arch/riscv64/interrupt.cpp:65
↓ 8 callers
Method
GetCoreCount
tests/unit_test/mocks/test_environment_state.cpp:61
↓ 8 callers
Method
GetThreadGroupSize
src/task/task_control_block.cpp:106
↓ 8 callers
Function
HandleException
* @brief 通用异常处理辅助函数 * @param exception_msg 异常类型描述 * @param context 中断上下文 * @param print_regs 要打印的寄存器数量 (0, 4, 或 8) */
src/arch/aarch64/interrupt_main.cpp:25
↓ 8 callers
Method
IsValid
src/device/virtio/transport/pci.hpp:18
↓ 8 callers
Function
Lookup
src/filesystem/vfs/lookup.cpp:14
↓ 8 callers
Method
Lookup
src/filesystem/vfs/mount.cpp:158
↓ 8 callers
Method
Mount
tests/unit_test/vfs_test.cpp:57
↓ 8 callers
Function
strrchr
反向查找字符在字符串中的首次出现
src/libc/sk_string.c:163
↓ 7 callers
Method
ClearCurrentThreadEnvironment
tests/unit_test/mocks/test_environment_state.cpp:22
↓ 7 callers
Method
GetCurrentCoreEnv
tests/unit_test/mocks/test_environment_state.cpp:99
↓ 7 callers
Method
InitializeCores
tests/unit_test/mocks/test_environment_state.cpp:31
↓ 7 callers
Method
IsLockedByCurrentCore
* @brief 检查当前 core 是否获得此锁 * @return true 是 * @return false 否 */
src/include/spinlock.hpp:115
↓ 7 callers
Method
OnTimeSliceExpired
* @brief 时间片耗尽处理:当任务时间片用完时调用 * * 用于支持自定义时间片处理(如 MLFQ 的优先级降级) * * @param task 时间片耗尽的任务 * @return true 表示任务需要重新入队 * @return false 表示任务
src/task/include/scheduler_base.hpp:100
↓ 7 callers
Function
PutStr
通过 etl_putchar 输出字符串(空指针安全)
src/include/kernel_log.hpp:82
↓ 7 callers
Method
ReadConfigU8
src/device/virtio/transport/pci.hpp:44
↓ 7 callers
Method
ResetStats
* @brief 重置统计信息 */
src/task/include/scheduler_base.hpp:149
↓ 7 callers
Method
SetStatus
src/device/virtio/transport/pci.hpp:23
↓ 7 callers
Function
Wmb
tests/unit_test/mocks/cpu_io.h:58
↓ 7 callers
Function
isdigit
src/libc/sk_ctype.c:19
↓ 7 callers
Function
malloc
src/memory/memory.cpp:62
↓ 6 callers
Method
ClonePageDirectory
src/memory/virtual_memory.cpp:178
↓ 6 callers
Method
GetMinVruntime
* @brief 获取当前 min_vruntime * @return uint64_t 最小虚拟运行时间 */
src/task/include/cfs_scheduler.hpp:187
↓ 6 callers
Method
GetStatus
src/device/virtio/transport/pci.hpp:22
↓ 6 callers
Function
IsPageTableEntryValid
页表项操作函数
tests/unit_test/mocks/cpu_io.h:170
↓ 6 callers
Method
MapMMIO
src/memory/virtual_memory.cpp:56
↓ 6 callers
Method
OnScheduled
* @brief 任务开始运行时调用 (从 Ready 变为 Running) * * @param task 即将运行的任务 */
src/task/include/scheduler_base.hpp:138
↓ 6 callers
Method
Schedule
src/task/schedule.cpp:36
↓ 6 callers
Method
Unmount
tests/unit_test/vfs_test.cpp:63
↓ 6 callers
Function
strchr
查找字符在字符串中的首次出现
src/libc/sk_string.c:152
↓ 6 callers
Function
strnlen
获取指定字符串长度
src/libc/sk_string.c:143
↓ 6 callers
Function
sys_kill
src/syscall.cpp:332
↓ 6 callers
Function
sys_sched_getaffinity
src/syscall.cpp:267
↓ 6 callers
Function
sys_yield
src/syscall.cpp:107
↓ 5 callers
Method
Free
tests/unit_test/virtual_memory_test.cpp:38
↓ 5 callers
Method
GetData
* @brief 获取资源数据 * @return uint64_t 资源数据 */
src/task/include/resource_id.hpp:91
↓ 5 callers
Method
GetTypeName
* @brief 获取类型名称(用于调试) * @return const char* 资源类型名称 */
src/task/include/resource_id.hpp:99
↓ 5 callers
Function
Init
src/filesystem/vfs/vfs.cpp:80
next →
1–100 of 1,141, ranked by callers