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

Function InitTaskContext

tests/unit_test/mocks/arch.cpp:50–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48} // extern "C"
49
50void InitTaskContext(cpu_io::CalleeSavedContext* task_context,
51 void (*entry)(void*), void* arg, uint64_t stack_top) {
52 // 清零上下文
53 std::memset(task_context, 0, sizeof(cpu_io::CalleeSavedContext));
54
55 task_context->ReturnAddress() =
56 reinterpret_cast<uint64_t>(kernel_thread_entry);
57 task_context->EntryFunction() = reinterpret_cast<uint64_t>(entry);
58 task_context->EntryArgument() = reinterpret_cast<uint64_t>(arg);
59 task_context->StackPointer() = stack_top;
60}
61
62void InitTaskContext(cpu_io::CalleeSavedContext* task_context,
63 cpu_io::TrapContext* trap_context_ptr,

Callers

nothing calls this directly

Calls 1

memsetFunction · 0.85

Tested by

no test coverage detected