diff options
| author | 2019-09-21 18:56:13 +1000 | |
|---|---|---|
| committer | 2019-09-22 16:30:31 +1000 | |
| commit | 482a03f8a5479cec0d61dc251fa82c5b273ed22a (patch) | |
| tree | 6e1f843fcf2c633586597b021dd05fbaf437ab9b /src | |
| parent | Deglobalize System: IRS (diff) | |
| download | yuzu-482a03f8a5479cec0d61dc251fa82c5b273ed22a.tar.gz yuzu-482a03f8a5479cec0d61dc251fa82c5b273ed22a.tar.xz yuzu-482a03f8a5479cec0d61dc251fa82c5b273ed22a.zip | |
Deglobalize System: LDR
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/ldr/ldr.cpp | 11 | ||||
| -rw-r--r-- | src/core/hle/service/ldr/ldr.h | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/core/hle/service/ldr/ldr.cpp b/src/core/hle/service/ldr/ldr.cpp index 8ddad8682..3164ca26e 100644 --- a/src/core/hle/service/ldr/ldr.cpp +++ b/src/core/hle/service/ldr/ldr.cpp | |||
| @@ -78,7 +78,7 @@ public: | |||
| 78 | 78 | ||
| 79 | class RelocatableObject final : public ServiceFramework<RelocatableObject> { | 79 | class RelocatableObject final : public ServiceFramework<RelocatableObject> { |
| 80 | public: | 80 | public: |
| 81 | explicit RelocatableObject() : ServiceFramework{"ldr:ro"} { | 81 | explicit RelocatableObject(Core::System& system) : ServiceFramework{"ldr:ro"}, system(system) { |
| 82 | // clang-format off | 82 | // clang-format off |
| 83 | static const FunctionInfo functions[] = { | 83 | static const FunctionInfo functions[] = { |
| 84 | {0, &RelocatableObject::LoadNro, "LoadNro"}, | 84 | {0, &RelocatableObject::LoadNro, "LoadNro"}, |
| @@ -364,7 +364,7 @@ public: | |||
| 364 | vm_manager.ReprotectRange(*map_address + header.rw_offset, header.rw_size, | 364 | vm_manager.ReprotectRange(*map_address + header.rw_offset, header.rw_size, |
| 365 | Kernel::VMAPermission::ReadWrite); | 365 | Kernel::VMAPermission::ReadWrite); |
| 366 | 366 | ||
| 367 | Core::System::GetInstance().InvalidateCpuInstructionCaches(); | 367 | system.InvalidateCpuInstructionCaches(); |
| 368 | 368 | ||
| 369 | nro.insert_or_assign(*map_address, | 369 | nro.insert_or_assign(*map_address, |
| 370 | NROInfo{hash, nro_address, nro_size, bss_address, bss_size}); | 370 | NROInfo{hash, nro_address, nro_size, bss_address, bss_size}); |
| @@ -430,7 +430,7 @@ public: | |||
| 430 | .IsSuccess()); | 430 | .IsSuccess()); |
| 431 | } | 431 | } |
| 432 | 432 | ||
| 433 | Core::System::GetInstance().InvalidateCpuInstructionCaches(); | 433 | system.InvalidateCpuInstructionCaches(); |
| 434 | 434 | ||
| 435 | nro.erase(iter); | 435 | nro.erase(iter); |
| 436 | IPC::ResponseBuilder rb{ctx, 2}; | 436 | IPC::ResponseBuilder rb{ctx, 2}; |
| @@ -516,13 +516,14 @@ private: | |||
| 516 | Common::Is4KBAligned(header.text_size) && Common::Is4KBAligned(header.ro_size) && | 516 | Common::Is4KBAligned(header.text_size) && Common::Is4KBAligned(header.ro_size) && |
| 517 | Common::Is4KBAligned(header.rw_size); | 517 | Common::Is4KBAligned(header.rw_size); |
| 518 | } | 518 | } |
| 519 | Core::System& system; | ||
| 519 | }; | 520 | }; |
| 520 | 521 | ||
| 521 | void InstallInterfaces(SM::ServiceManager& sm) { | 522 | void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) { |
| 522 | std::make_shared<DebugMonitor>()->InstallAsService(sm); | 523 | std::make_shared<DebugMonitor>()->InstallAsService(sm); |
| 523 | std::make_shared<ProcessManager>()->InstallAsService(sm); | 524 | std::make_shared<ProcessManager>()->InstallAsService(sm); |
| 524 | std::make_shared<Shell>()->InstallAsService(sm); | 525 | std::make_shared<Shell>()->InstallAsService(sm); |
| 525 | std::make_shared<RelocatableObject>()->InstallAsService(sm); | 526 | std::make_shared<RelocatableObject>(system)->InstallAsService(sm); |
| 526 | } | 527 | } |
| 527 | 528 | ||
| 528 | } // namespace Service::LDR | 529 | } // namespace Service::LDR |
diff --git a/src/core/hle/service/ldr/ldr.h b/src/core/hle/service/ldr/ldr.h index 412410c4f..7ac8c0b65 100644 --- a/src/core/hle/service/ldr/ldr.h +++ b/src/core/hle/service/ldr/ldr.h | |||
| @@ -11,6 +11,6 @@ class ServiceManager; | |||
| 11 | namespace Service::LDR { | 11 | namespace Service::LDR { |
| 12 | 12 | ||
| 13 | /// Registers all LDR services with the specified service manager. | 13 | /// Registers all LDR services with the specified service manager. |
| 14 | void InstallInterfaces(SM::ServiceManager& sm); | 14 | void InstallInterfaces(SM::ServiceManager& sm, Core::System& system); |
| 15 | 15 | ||
| 16 | } // namespace Service::LDR | 16 | } // namespace Service::LDR |