service: refactor server architecture

Converts services to have their own processes
This commit is contained in:
Liam 2023-02-18 16:26:48 -05:00
parent 23151ff498
commit a936972614
140 changed files with 1388 additions and 1138 deletions

View file

@ -15,17 +15,24 @@ namespace Service::KernelHelpers {
ServiceContext::ServiceContext(Core::System& system_, std::string name_)
: kernel(system_.Kernel()) {
if (process = Kernel::GetCurrentProcessPointer(kernel); process != nullptr) {
return;
}
// Create the process.
process = Kernel::KProcess::Create(kernel);
ASSERT(Kernel::KProcess::Initialize(process, system_, std::move(name_),
Kernel::KProcess::ProcessType::KernelInternal,
kernel.GetSystemResourceLimit())
.IsSuccess());
process_created = true;
}
ServiceContext::~ServiceContext() {
process->Close();
process = nullptr;
if (process_created) {
process->Close();
process = nullptr;
}
}
Kernel::KEvent* ServiceContext::CreateEvent(std::string&& name) {