[Zion] Add a proc/thread cleanup thread for future use.

This commit is contained in:
Drew Galbraith 2023-11-24 15:04:03 -08:00
parent 8e4cd1562f
commit cb590c96b8
9 changed files with 95 additions and 0 deletions

View file

@ -2,12 +2,14 @@
#include "capability/capability.h"
#include "debug/debug.h"
#include "scheduler/cleanup.h"
#include "scheduler/process_manager.h"
#include "scheduler/scheduler.h"
z_err_t ProcessExit(ZProcessExitReq* req) {
auto curr_thread = gScheduler->CurrentThread();
dbgln("Exit code: {}", static_cast<glcr::ErrorCode>(req->code));
gProcMan->CleanupProcess(curr_thread->pid());
curr_thread->process().Exit();
panic("Returned from thread exit");
return glcr::UNIMPLEMENTED;