diff options
| author | 2022-03-16 12:15:33 +0100 | |
|---|---|---|
| committer | 2022-03-16 12:15:33 +0100 | |
| commit | 2db5076ec9abab880ea2cc363f4e5e93c528d801 (patch) | |
| tree | a87668b7aab0bba9dd73dabf093b9f77b1ad6937 /src/core/hle/service | |
| parent | Merge pull request #8023 from ameerj/kirby-pop-in (diff) | |
| parent | core: hle: kernel: init_slab_setup: Move CalculateSlabHeapGapSize to global n... (diff) | |
| download | yuzu-2db5076ec9abab880ea2cc363f4e5e93c528d801.tar.gz yuzu-2db5076ec9abab880ea2cc363f4e5e93c528d801.tar.xz yuzu-2db5076ec9abab880ea2cc363f4e5e93c528d801.zip | |
Merge pull request #8013 from bunnei/kernel-slab-rework-v2
Kernel Memory Updates (Part 6): Use guest memory for slab heaps & update TLS.
Diffstat (limited to 'src/core/hle/service')
| -rw-r--r-- | src/core/hle/service/am/am.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/service/kernel_helpers.cpp | 11 | ||||
| -rw-r--r-- | src/core/hle/service/sm/sm.cpp | 2 |
3 files changed, 5 insertions, 12 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 2f8e21568..420de3c54 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -980,7 +980,7 @@ private: | |||
| 980 | LOG_DEBUG(Service_AM, "called"); | 980 | LOG_DEBUG(Service_AM, "called"); |
| 981 | 981 | ||
| 982 | IPC::RequestParser rp{ctx}; | 982 | IPC::RequestParser rp{ctx}; |
| 983 | applet->GetBroker().PushNormalDataFromGame(rp.PopIpcInterface<IStorage>()); | 983 | applet->GetBroker().PushNormalDataFromGame(rp.PopIpcInterface<IStorage>().lock()); |
| 984 | 984 | ||
| 985 | IPC::ResponseBuilder rb{ctx, 2}; | 985 | IPC::ResponseBuilder rb{ctx, 2}; |
| 986 | rb.Push(ResultSuccess); | 986 | rb.Push(ResultSuccess); |
| @@ -1007,7 +1007,7 @@ private: | |||
| 1007 | LOG_DEBUG(Service_AM, "called"); | 1007 | LOG_DEBUG(Service_AM, "called"); |
| 1008 | 1008 | ||
| 1009 | IPC::RequestParser rp{ctx}; | 1009 | IPC::RequestParser rp{ctx}; |
| 1010 | applet->GetBroker().PushInteractiveDataFromGame(rp.PopIpcInterface<IStorage>()); | 1010 | applet->GetBroker().PushInteractiveDataFromGame(rp.PopIpcInterface<IStorage>().lock()); |
| 1011 | 1011 | ||
| 1012 | ASSERT(applet->IsInitialized()); | 1012 | ASSERT(applet->IsInitialized()); |
| 1013 | applet->ExecuteInteractive(); | 1013 | applet->ExecuteInteractive(); |
diff --git a/src/core/hle/service/kernel_helpers.cpp b/src/core/hle/service/kernel_helpers.cpp index b8c2c6e51..ff0bbb788 100644 --- a/src/core/hle/service/kernel_helpers.cpp +++ b/src/core/hle/service/kernel_helpers.cpp | |||
| @@ -17,21 +17,12 @@ namespace Service::KernelHelpers { | |||
| 17 | 17 | ||
| 18 | ServiceContext::ServiceContext(Core::System& system_, std::string name_) | 18 | ServiceContext::ServiceContext(Core::System& system_, std::string name_) |
| 19 | : kernel(system_.Kernel()) { | 19 | : kernel(system_.Kernel()) { |
| 20 | |||
| 21 | // Create a resource limit for the process. | ||
| 22 | const auto physical_memory_size = | ||
| 23 | kernel.MemoryManager().GetSize(Kernel::KMemoryManager::Pool::System); | ||
| 24 | auto* resource_limit = Kernel::CreateResourceLimitForProcess(system_, physical_memory_size); | ||
| 25 | |||
| 26 | // Create the process. | 20 | // Create the process. |
| 27 | process = Kernel::KProcess::Create(kernel); | 21 | process = Kernel::KProcess::Create(kernel); |
| 28 | ASSERT(Kernel::KProcess::Initialize(process, system_, std::move(name_), | 22 | ASSERT(Kernel::KProcess::Initialize(process, system_, std::move(name_), |
| 29 | Kernel::KProcess::ProcessType::KernelInternal, | 23 | Kernel::KProcess::ProcessType::KernelInternal, |
| 30 | resource_limit) | 24 | kernel.GetSystemResourceLimit()) |
| 31 | .IsSuccess()); | 25 | .IsSuccess()); |
| 32 | |||
| 33 | // Close reference to our resource limit, as the process opens one. | ||
| 34 | resource_limit->Close(); | ||
| 35 | } | 26 | } |
| 36 | 27 | ||
| 37 | ServiceContext::~ServiceContext() { | 28 | ServiceContext::~ServiceContext() { |
diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp index eaa172595..695a1faa6 100644 --- a/src/core/hle/service/sm/sm.cpp +++ b/src/core/hle/service/sm/sm.cpp | |||
| @@ -81,6 +81,8 @@ ResultVal<Kernel::KPort*> ServiceManager::GetServicePort(const std::string& name | |||
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | auto* port = Kernel::KPort::Create(kernel); | 83 | auto* port = Kernel::KPort::Create(kernel); |
| 84 | SCOPE_EXIT({ port->Close(); }); | ||
| 85 | |||
| 84 | port->Initialize(ServerSessionCountMax, false, name); | 86 | port->Initialize(ServerSessionCountMax, false, name); |
| 85 | auto handler = it->second; | 87 | auto handler = it->second; |
| 86 | port->GetServerPort().SetSessionHandler(std::move(handler)); | 88 | port->GetServerPort().SetSessionHandler(std::move(handler)); |