fork return value

This commit is contained in:
2026-02-25 14:44:18 +01:00
parent 8b271e2470
commit b958e9461e
5 changed files with 18 additions and 8 deletions

View File

@@ -16,13 +16,12 @@ extern pagetable_t identity_table;
void Thread::kickoff(uintptr_t param1, uintptr_t param2, uintptr_t param3) {
Thread *thread = reinterpret_cast<Thread *>(param1);
assert(thread != nullptr && "Kickoff got nullptr pointer to Thread");
(void)param2; // will be used later
(void)param3; // will be used later
// The core must have entered level 1/2 to cause a thread to be scheduled.
Guard::leave();
if(!thread->isKernel)
Core::Ring::switchToUsermode(thread->StackPointer.user, thread->start, 0);
Core::Ring::switchToUsermode(thread->StackPointer.user, thread->start, (void*)param2);
else
if(thread->start == nullptr)
thread->action();

View File

@@ -75,11 +75,11 @@ class Thread {
* \param param3 Third parameter (will be used later)
*
*/
static void kickoff(uintptr_t param1, uintptr_t param2, uintptr_t param3);
static void kickoffUsermode (Thread *object);
void map_app(void* code_paddr, uint16_t code_page_num, void* stack_vaddr, uint16_t stack_page_num);
public:
static void kickoff(uintptr_t param1, uintptr_t param2, uintptr_t param3);
struct{
void* user;
void* isr;