mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-11-01 12:57:52 +00:00
Merge pull request #4878 from bunnei/unload-nrr
hle: service: ldr: Implement UnloadNrr.
This commit is contained in:
commit
448e4d5c2a
1 changed files with 15 additions and 1 deletions
|
@ -166,7 +166,7 @@ public:
|
||||||
{0, &RelocatableObject::LoadNro, "LoadNro"},
|
{0, &RelocatableObject::LoadNro, "LoadNro"},
|
||||||
{1, &RelocatableObject::UnloadNro, "UnloadNro"},
|
{1, &RelocatableObject::UnloadNro, "UnloadNro"},
|
||||||
{2, &RelocatableObject::LoadNrr, "LoadNrr"},
|
{2, &RelocatableObject::LoadNrr, "LoadNrr"},
|
||||||
{3, nullptr, "UnloadNrr"},
|
{3, &RelocatableObject::UnloadNrr, "UnloadNrr"},
|
||||||
{4, &RelocatableObject::Initialize, "Initialize"},
|
{4, &RelocatableObject::Initialize, "Initialize"},
|
||||||
{10, nullptr, "LoadNrrEx"},
|
{10, nullptr, "LoadNrrEx"},
|
||||||
};
|
};
|
||||||
|
@ -272,6 +272,20 @@ public:
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UnloadNrr(Kernel::HLERequestContext& ctx) {
|
||||||
|
IPC::RequestParser rp{ctx};
|
||||||
|
const auto pid = rp.Pop<u64>();
|
||||||
|
const auto nrr_address = rp.Pop<VAddr>();
|
||||||
|
|
||||||
|
LOG_DEBUG(Service_LDR, "called with pid={}, nrr_address={:016X}", pid, nrr_address);
|
||||||
|
|
||||||
|
nrr.erase(nrr_address);
|
||||||
|
|
||||||
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
|
|
||||||
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
bool ValidateRegionForMap(Kernel::Memory::PageTable& page_table, VAddr start,
|
bool ValidateRegionForMap(Kernel::Memory::PageTable& page_table, VAddr start,
|
||||||
std::size_t size) const {
|
std::size_t size) const {
|
||||||
constexpr std::size_t padding_size{4 * Kernel::Memory::PageSize};
|
constexpr std::size_t padding_size{4 * Kernel::Memory::PageSize};
|
||||||
|
|
Loading…
Reference in a new issue