diff options
Diffstat (limited to 'dev/kernel/src')
| -rw-r--r-- | dev/kernel/src/UserProcessScheduler.cc | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/dev/kernel/src/UserProcessScheduler.cc b/dev/kernel/src/UserProcessScheduler.cc index 7e14fa62..45957c7b 100644 --- a/dev/kernel/src/UserProcessScheduler.cc +++ b/dev/kernel/src/UserProcessScheduler.cc @@ -122,20 +122,9 @@ ErrorOr<VoidPtr> USER_PROCESS::New(SizeT sz, SizeT pad_amount) { hal_write_cr3(vm_register); #else - auto ptr = mm_alloc_ptr(sz, Yes, Yes, pad_amount); + auto ptr = mm_alloc_ptr(sz, Yes, Yes, pad_amount); #endif - if (!this->FileTree) { - this->FileTree = new PROCESS_FILE_TREE<VoidPtr>(); - - if (!this->FileTree) { - this->Crash(); - return ErrorOr<VoidPtr>(-kErrorHeapOutOfMemory); - } - - /// @todo File Tree allocation and dispose methods (amlal) - } - if (!this->HeapTree) { this->HeapTree = new PROCESS_HEAP_TREE<VoidPtr>(); @@ -335,7 +324,7 @@ Void USER_PROCESS::Exit(const Int32& exit_code) { /// @brief Add dylib to the process object. /***********************************************************************************/ -Bool USER_PROCESS::SpawnDylib() { +Bool USER_PROCESS::InitDylib() { // React according to the process's kind. switch (this->Kind) { case USER_PROCESS::kExecutableDylibKind: { @@ -437,6 +426,17 @@ ProcessID UserProcessScheduler::Spawn(const Char* name, VoidPtr code, VoidPtr im process.PTime = 0; process.RTime = 0; + if (!process.FileTree) { + process.FileTree = new PROCESS_FILE_TREE<VoidPtr>(); + + if (!process.FileTree) { + process.Crash(); + return ErrorOr<VoidPtr>(-kErrorHeapOutOfMemory); + } + + /// @todo File Tree allocation and dispose methods (amlal) + } + (Void)(kout << "PID: " << number(process.ProcessId) << kendl); (Void)(kout << "Name: " << process.Name << kendl); |
