summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/process.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-10-12 17:36:31 +0200
committerLioncash <mathew1800@gmail.com>2018-10-12 18:07:32 +0200
commit1abed2f4c42c7a389cb0e019f183d3ec94971af1 (patch)
treec8459ae8d497e7a148365f93e971b817a0adf0f6 /src/core/hle/kernel/process.cpp
parentMerge pull request #1474 from ogniK5377/hwopus-decodeinterleavedwithperformance (diff)
downloadyuzu-1abed2f4c42c7a389cb0e019f183d3ec94971af1.tar
yuzu-1abed2f4c42c7a389cb0e019f183d3ec94971af1.tar.gz
yuzu-1abed2f4c42c7a389cb0e019f183d3ec94971af1.tar.bz2
yuzu-1abed2f4c42c7a389cb0e019f183d3ec94971af1.tar.lz
yuzu-1abed2f4c42c7a389cb0e019f183d3ec94971af1.tar.xz
yuzu-1abed2f4c42c7a389cb0e019f183d3ec94971af1.tar.zst
yuzu-1abed2f4c42c7a389cb0e019f183d3ec94971af1.zip
Diffstat (limited to 'src/core/hle/kernel/process.cpp')
-rw-r--r--src/core/hle/kernel/process.cpp24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp
index fb0027a71..c80b2c507 100644
--- a/src/core/hle/kernel/process.cpp
+++ b/src/core/hle/kernel/process.cpp
@@ -20,13 +20,7 @@
namespace Kernel {
-SharedPtr<CodeSet> CodeSet::Create(KernelCore& kernel, std::string name) {
- SharedPtr<CodeSet> codeset(new CodeSet(kernel));
- codeset->name = std::move(name);
- return codeset;
-}
-
-CodeSet::CodeSet(KernelCore& kernel) : Object{kernel} {}
+CodeSet::CodeSet() = default;
CodeSet::~CodeSet() = default;
SharedPtr<Process> Process::Create(KernelCore& kernel, std::string&& name) {
@@ -224,20 +218,20 @@ void Process::FreeTLSSlot(VAddr tls_address) {
tls_slots[tls_page].reset(tls_slot);
}
-void Process::LoadModule(SharedPtr<CodeSet> module_, VAddr base_addr) {
+void Process::LoadModule(CodeSet module_, VAddr base_addr) {
const auto MapSegment = [&](CodeSet::Segment& segment, VMAPermission permissions,
MemoryState memory_state) {
- auto vma = vm_manager
- .MapMemoryBlock(segment.addr + base_addr, module_->memory, segment.offset,
- segment.size, memory_state)
- .Unwrap();
+ const auto vma = vm_manager
+ .MapMemoryBlock(segment.addr + base_addr, module_.memory,
+ segment.offset, segment.size, memory_state)
+ .Unwrap();
vm_manager.Reprotect(vma, permissions);
};
// Map CodeSet segments
- MapSegment(module_->CodeSegment(), VMAPermission::ReadExecute, MemoryState::CodeStatic);
- MapSegment(module_->RODataSegment(), VMAPermission::Read, MemoryState::CodeMutable);
- MapSegment(module_->DataSegment(), VMAPermission::ReadWrite, MemoryState::CodeMutable);
+ MapSegment(module_.CodeSegment(), VMAPermission::ReadExecute, MemoryState::CodeStatic);
+ MapSegment(module_.RODataSegment(), VMAPermission::Read, MemoryState::CodeMutable);
+ MapSegment(module_.DataSegment(), VMAPermission::ReadWrite, MemoryState::CodeMutable);
}
ResultVal<VAddr> Process::HeapAllocate(VAddr target, u64 size, VMAPermission perms) {