diff options
author | GPUCode <geoster3d@gmail.com> | 2023-11-19 10:21:53 +0100 |
---|---|---|
committer | t895 <clombardo169@gmail.com> | 2023-11-25 06:47:35 +0100 |
commit | 6de2edcca1624982e99a72741d4fa289dc9d7551 (patch) | |
tree | 8c355b39a6f71e333ccc2f929816ce96e40d3f2c /src/core/loader | |
parent | android: Add cpu bakend gui toggle (diff) | |
download | yuzu-6de2edcca1624982e99a72741d4fa289dc9d7551.tar yuzu-6de2edcca1624982e99a72741d4fa289dc9d7551.tar.gz yuzu-6de2edcca1624982e99a72741d4fa289dc9d7551.tar.bz2 yuzu-6de2edcca1624982e99a72741d4fa289dc9d7551.tar.lz yuzu-6de2edcca1624982e99a72741d4fa289dc9d7551.tar.xz yuzu-6de2edcca1624982e99a72741d4fa289dc9d7551.tar.zst yuzu-6de2edcca1624982e99a72741d4fa289dc9d7551.zip |
Diffstat (limited to 'src/core/loader')
-rw-r--r-- | src/core/loader/nro.cpp | 6 | ||||
-rw-r--r-- | src/core/loader/nso.cpp | 15 |
2 files changed, 11 insertions, 10 deletions
diff --git a/src/core/loader/nro.cpp b/src/core/loader/nro.cpp index 76ff38041..49d4d7e43 100644 --- a/src/core/loader/nro.cpp +++ b/src/core/loader/nro.cpp @@ -204,7 +204,7 @@ static bool LoadNroImpl(Core::System& system, Kernel::KProcess& process, #ifdef ARCHITECTURE_arm64 const auto& code = codeset.CodeSegment(); - // NROs are always 64-bit programs. + // NROs always have a 39-bit address space. Settings::SetNceEnabled(true); // Create NCE patcher @@ -215,12 +215,12 @@ static bool LoadNroImpl(Core::System& system, Kernel::KProcess& process, patch.PatchText(program_image, code); // We only support PostData patching for NROs. - ASSERT(patch.Mode() == Core::NCE::PatchMode::PostData); + ASSERT(patch.GetPatchMode() == Core::NCE::PatchMode::PostData); // Update patch section. auto& patch_segment = codeset.PatchSegment(); patch_segment.addr = image_size; - patch_segment.size = static_cast<u32>(patch.SectionSize()); + patch_segment.size = static_cast<u32>(patch.GetSectionSize()); // Add patch section size to the module size. image_size += patch_segment.size; diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index 34b10ef2e..1ad2e917c 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp @@ -94,8 +94,8 @@ std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::KProcess& process, Core:: // Allocate some space at the beginning if we are patching in PreText mode. const size_t module_start = [&]() -> size_t { #ifdef ARCHITECTURE_arm64 - if (patch && patch->Mode() == Core::NCE::PatchMode::PreText) { - return patch->SectionSize(); + if (patch && patch->GetPatchMode() == Core::NCE::PatchMode::PreText) { + return patch->GetSectionSize(); } #endif return 0; @@ -158,24 +158,25 @@ std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::KProcess& process, Core:: #ifdef ARCHITECTURE_arm64 // If we are computing the process code layout and using nce backend, patch. const auto& code = codeset.CodeSegment(); - if (patch && patch->Mode() == Core::NCE::PatchMode::None) { + if (patch && patch->GetPatchMode() == Core::NCE::PatchMode::None) { // Patch SVCs and MRS calls in the guest code patch->PatchText(program_image, code); // Add patch section size to the module size. - image_size += patch->SectionSize(); + image_size += patch->GetSectionSize(); } else if (patch) { // Relocate code patch and copy to the program_image. patch->RelocateAndCopy(load_base, code, program_image, &process.GetPostHandlers()); // Update patch section. auto& patch_segment = codeset.PatchSegment(); - patch_segment.addr = patch->Mode() == Core::NCE::PatchMode::PreText ? 0 : image_size; - patch_segment.size = static_cast<u32>(patch->SectionSize()); + patch_segment.addr = + patch->GetPatchMode() == Core::NCE::PatchMode::PreText ? 0 : image_size; + patch_segment.size = static_cast<u32>(patch->GetSectionSize()); // Add patch section size to the module size. In PreText mode image_size // already contains the patch segment as part of module_start. - if (patch->Mode() == Core::NCE::PatchMode::PostData) { + if (patch->GetPatchMode() == Core::NCE::PatchMode::PostData) { image_size += patch_segment.size; } } |