HLE/FS: Implemented FS::GetProgramLaunchInfo.
This function is used by the DLP system module during the DLPSRVR initialization.
This commit is contained in:
parent
81fbe06915
commit
7d038b9bd8
4 changed files with 78 additions and 3 deletions
|
@ -2,6 +2,7 @@
|
|||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include "common/assert.h"
|
||||
#include "common/common_funcs.h"
|
||||
|
@ -16,6 +17,9 @@
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
// Lists all processes that exist in the current session.
|
||||
static std::vector<SharedPtr<Process>> process_list;
|
||||
|
||||
SharedPtr<CodeSet> CodeSet::Create(std::string name, u64 program_id) {
|
||||
SharedPtr<CodeSet> codeset(new CodeSet);
|
||||
|
||||
|
@ -37,6 +41,7 @@ SharedPtr<Process> Process::Create(SharedPtr<CodeSet> code_set) {
|
|||
process->flags.raw = 0;
|
||||
process->flags.memory_region.Assign(MemoryRegion::APPLICATION);
|
||||
|
||||
process_list.push_back(process);
|
||||
return process;
|
||||
}
|
||||
|
||||
|
@ -299,5 +304,20 @@ ResultCode Process::LinearFree(VAddr target, u32 size) {
|
|||
Kernel::Process::Process() {}
|
||||
Kernel::Process::~Process() {}
|
||||
|
||||
SharedPtr<Process> g_current_process;
|
||||
void ClearProcessList() {
|
||||
process_list.clear();
|
||||
}
|
||||
|
||||
SharedPtr<Process> GetProcessById(u32 process_id) {
|
||||
auto itr = std::find_if(
|
||||
process_list.begin(), process_list.end(),
|
||||
[&](const SharedPtr<Process>& process) { return process->process_id == process_id; });
|
||||
|
||||
if (itr == process_list.end())
|
||||
return nullptr;
|
||||
|
||||
return *itr;
|
||||
}
|
||||
|
||||
SharedPtr<Process> g_current_process;
|
||||
} // namespace Kernel
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue