MCPcopy Create free account
hub / github.com/Simple-XX/SimpleKernel / InitTaskContext

Function InitTaskContext

src/arch/aarch64/arch_main.cpp:77–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77auto InitTaskContext(cpu_io::CalleeSavedContext* task_context,
78 void (*entry)(void*), void* arg, uint64_t stack_top)
79 -> void {
80 // 清零上下文
81 std::memset(task_context, 0, sizeof(cpu_io::CalleeSavedContext));
82
83 task_context->ReturnAddress() =
84 reinterpret_cast<uint64_t>(kernel_thread_entry);
85 task_context->EntryFunction() = reinterpret_cast<uint64_t>(entry);
86 task_context->EntryArgument() = reinterpret_cast<uint64_t>(arg);
87 task_context->StackPointer() = stack_top;
88}
89
90auto InitTaskContext(cpu_io::CalleeSavedContext* task_context,
91 cpu_io::TrapContext* trap_context_ptr, uint64_t stack_top)

Callers

nothing calls this directly

Calls 1

memsetFunction · 0.85

Tested by

no test coverage detected