From d9b17d96d7bc95a768938cd8ef98f27094860232 Mon Sep 17 00:00:00 2001 From: Drew Galbraith Date: Tue, 6 Jun 2023 18:40:32 -0700 Subject: [PATCH] Cleanup Thread constructor --- zion/scheduler/process.cpp | 2 +- zion/scheduler/thread.cpp | 3 +-- zion/scheduler/thread.h | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/zion/scheduler/process.cpp b/zion/scheduler/process.cpp index f0131de..f0a8d6f 100644 --- a/zion/scheduler/process.cpp +++ b/zion/scheduler/process.cpp @@ -27,7 +27,7 @@ Process::Process() : id_(gNextId++), state_(RUNNING) { } SharedPtr Process::CreateThread() { - SharedPtr thread{new Thread(*this, next_thread_id_++, 0)}; + SharedPtr thread{new Thread(*this, next_thread_id_++)}; threads_.PushBack(thread); return thread; } diff --git a/zion/scheduler/thread.cpp b/zion/scheduler/thread.cpp index 3f5f7bc..80af108 100644 --- a/zion/scheduler/thread.cpp +++ b/zion/scheduler/thread.cpp @@ -24,8 +24,7 @@ SharedPtr Thread::RootThread(Process& root_proc) { return new Thread(root_proc); } -Thread::Thread(Process& proc, uint64_t tid, uint64_t entry) - : process_(proc), id_(tid), rip_(entry) { +Thread::Thread(Process& proc, uint64_t tid) : process_(proc), id_(tid) { uint64_t* stack_ptr = proc.vmm().AllocateKernelStack(); // 0: rip *(stack_ptr) = reinterpret_cast(thread_init); diff --git a/zion/scheduler/thread.h b/zion/scheduler/thread.h index 212c512..ab78d16 100644 --- a/zion/scheduler/thread.h +++ b/zion/scheduler/thread.h @@ -18,7 +18,7 @@ class Thread { }; static SharedPtr RootThread(Process& root_proc); - Thread(Process& proc, uint64_t tid, uint64_t entry); + Thread(Process& proc, uint64_t tid); uint64_t tid() const { return id_; }; uint64_t pid() const;