summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2020-11-03 08:52:40 -0800
committerGravatar GitHub2020-11-03 08:52:40 -0800
commit448e4d5c2a84fcb438fbd85599553daa80228d78 (patch)
treec96515670925606b61a33aee9888dd6499d3cfae /src
parentMerge pull request #4865 from ameerj/async-threadcount (diff)
parenthle: service: ldr: Implement UnloadNrr. (diff)
downloadyuzu-448e4d5c2a84fcb438fbd85599553daa80228d78.tar.gz
yuzu-448e4d5c2a84fcb438fbd85599553daa80228d78.tar.xz
yuzu-448e4d5c2a84fcb438fbd85599553daa80228d78.zip
Merge pull request #4878 from bunnei/unload-nrr
hle: service: ldr: Implement UnloadNrr.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/ldr/ldr.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/core/hle/service/ldr/ldr.cpp b/src/core/hle/service/ldr/ldr.cpp
index 9ad5bbf0d..eeaca44b6 100644
--- a/src/core/hle/service/ldr/ldr.cpp
+++ b/src/core/hle/service/ldr/ldr.cpp
@@ -166,7 +166,7 @@ public:
166 {0, &RelocatableObject::LoadNro, "LoadNro"}, 166 {0, &RelocatableObject::LoadNro, "LoadNro"},
167 {1, &RelocatableObject::UnloadNro, "UnloadNro"}, 167 {1, &RelocatableObject::UnloadNro, "UnloadNro"},
168 {2, &RelocatableObject::LoadNrr, "LoadNrr"}, 168 {2, &RelocatableObject::LoadNrr, "LoadNrr"},
169 {3, nullptr, "UnloadNrr"}, 169 {3, &RelocatableObject::UnloadNrr, "UnloadNrr"},
170 {4, &RelocatableObject::Initialize, "Initialize"}, 170 {4, &RelocatableObject::Initialize, "Initialize"},
171 {10, nullptr, "LoadNrrEx"}, 171 {10, nullptr, "LoadNrrEx"},
172 }; 172 };
@@ -272,6 +272,20 @@ public:
272 rb.Push(RESULT_SUCCESS); 272 rb.Push(RESULT_SUCCESS);
273 } 273 }
274 274
275 void UnloadNrr(Kernel::HLERequestContext& ctx) {
276 IPC::RequestParser rp{ctx};
277 const auto pid = rp.Pop<u64>();
278 const auto nrr_address = rp.Pop<VAddr>();
279
280 LOG_DEBUG(Service_LDR, "called with pid={}, nrr_address={:016X}", pid, nrr_address);
281
282 nrr.erase(nrr_address);
283
284 IPC::ResponseBuilder rb{ctx, 2};
285
286 rb.Push(RESULT_SUCCESS);
287 }
288
275 bool ValidateRegionForMap(Kernel::Memory::PageTable& page_table, VAddr start, 289 bool ValidateRegionForMap(Kernel::Memory::PageTable& page_table, VAddr start,
276 std::size_t size) const { 290 std::size_t size) const {
277 constexpr std::size_t padding_size{4 * Kernel::Memory::PageSize}; 291 constexpr std::size_t padding_size{4 * Kernel::Memory::PageSize};