Kernel: Store the program id in the Process class instead of the CodeSet class.

There may be many CodeSets per Process, so it's wasteful and overcomplicated to store the program id in each of them.
This commit is contained in:
Subv 2018-02-27 10:22:15 -05:00
parent 77e64ac9b2
commit a9c51be95e
9 changed files with 25 additions and 26 deletions

View file

@ -83,7 +83,7 @@ bool AppLoader_NRO::LoadNro(const std::string& path, VAddr load_base) {
}
// Build program image
Kernel::SharedPtr<Kernel::CodeSet> codeset = Kernel::CodeSet::Create("", 0);
Kernel::SharedPtr<Kernel::CodeSet> codeset = Kernel::CodeSet::Create("");
std::vector<u8> program_image;
program_image.resize(PageAlignSize(nro_header.file_size));
file.Seek(0, SEEK_SET);
@ -125,7 +125,7 @@ ResultStatus AppLoader_NRO::Load(Kernel::SharedPtr<Kernel::Process>& process) {
return ResultStatus::Error;
}
process = Kernel::Process::Create("main");
process = Kernel::Process::Create("main", 0);
// Load NRO
static constexpr VAddr base_addr{Memory::PROCESS_IMAGE_VADDR};