Rework signal handling code

This commit is contained in:
EnderIce2
2024-03-25 23:21:27 +02:00
parent 3b1bd58a36
commit 3d1ecc3db0
10 changed files with 1040 additions and 711 deletions

View File

@ -18,6 +18,7 @@
#include <task.hpp>
#include <dumper.hpp>
#include <signal.hpp>
#include <convert.h>
#include <lock.hpp>
#include <printf.h>
@ -58,7 +59,7 @@ namespace Tasking
int PCB::SendSignal(int sig)
{
return this->Signals->SendSignal(sig);
return this->Signals.SendSignal((enum Signals)sig);
}
void PCB::SetState(TaskState state)
@ -138,7 +139,8 @@ namespace Tasking
TaskExecutionMode ExecutionMode,
bool UseKernelPageTable,
uint16_t UserID, uint16_t GroupID)
: Node(ProcFS, std::to_string(ctx->NextPID), NodeType::DIRECTORY)
: Node(ProcFS, std::to_string(ctx->NextPID), NodeType::DIRECTORY),
Signals(this)
{
debug("+ %#lx", this);
@ -214,7 +216,6 @@ namespace Tasking
this->vma = new Memory::VirtualMemoryArea(this->PageTable);
this->ProgramBreak = new Memory::ProgramBreak(this->PageTable, this->vma);
this->Signals = new Signal(this);
debug("Process page table: %#lx", this->PageTable);
debug("Created %s process \"%s\"(%d). Parent \"%s\"(%d)",
@ -230,7 +231,6 @@ namespace Tasking
this->AllocatedMemory += sizeof(Memory::VirtualMemoryArea);
this->AllocatedMemory += sizeof(Memory::ProgramBreak);
this->AllocatedMemory += sizeof(SymbolResolver::Symbols);
this->AllocatedMemory += sizeof(Signal);
this->Info.SpawnTime = TimeManager->GetCounter();
@ -250,9 +250,6 @@ namespace Tasking
don't get scheduled anymore */
ctx->PopProcess(this);
debug("Freeing signals");
delete this->Signals;
debug("Freeing allocated memory");
delete this->ProgramBreak;
delete this->vma;