summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/ldr_ro
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/ldr_ro/cro_helper.cpp9
-rw-r--r--src/core/hle/service/ldr_ro/cro_helper.h9
-rw-r--r--src/core/hle/service/ldr_ro/ldr_ro.cpp32
-rw-r--r--src/core/hle/service/ldr_ro/ldr_ro.h13
-rw-r--r--src/core/hle/service/ldr_ro/memory_synchronizer.cpp9
-rw-r--r--src/core/hle/service/ldr_ro/memory_synchronizer.h9
6 files changed, 36 insertions, 45 deletions
diff --git a/src/core/hle/service/ldr_ro/cro_helper.cpp b/src/core/hle/service/ldr_ro/cro_helper.cpp
index 4f0aa77eb..f78545f37 100644
--- a/src/core/hle/service/ldr_ro/cro_helper.cpp
+++ b/src/core/hle/service/ldr_ro/cro_helper.cpp
@@ -7,10 +7,8 @@
#include "common/scope_exit.h"
#include "core/hle/service/ldr_ro/cro_helper.h"
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// Namespace LDR_RO
-
-namespace LDR_RO {
+namespace Service {
+namespace LDR {
static const ResultCode ERROR_BUFFER_TOO_SMALL = // 0xE0E12C1F
ResultCode(static_cast<ErrorDescription>(31), ErrorModule::RO, ErrorSummary::InvalidArgument,
@@ -1493,4 +1491,5 @@ std::tuple<VAddr, u32> CROHelper::GetExecutablePages() const {
return std::make_tuple(0, 0);
}
-} // namespace
+} // namespace LDR
+} // namespace Service
diff --git a/src/core/hle/service/ldr_ro/cro_helper.h b/src/core/hle/service/ldr_ro/cro_helper.h
index 6a0d0d3bf..060d5a55f 100644
--- a/src/core/hle/service/ldr_ro/cro_helper.h
+++ b/src/core/hle/service/ldr_ro/cro_helper.h
@@ -11,10 +11,8 @@
#include "core/hle/result.h"
#include "core/memory.h"
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// Namespace LDR_RO
-
-namespace LDR_RO {
+namespace Service {
+namespace LDR {
// GCC versions < 5.0 do not implement std::is_trivially_copyable.
// Excluding MSVC because it has weird behaviour for std::is_trivially_copyable.
@@ -710,4 +708,5 @@ private:
ResultCode ApplyExitRelocations(VAddr crs_address);
};
-} // namespace
+} // namespace LDR
+} // namespace Service
diff --git a/src/core/hle/service/ldr_ro/ldr_ro.cpp b/src/core/hle/service/ldr_ro/ldr_ro.cpp
index ec183d1f5..9e5d6a318 100644
--- a/src/core/hle/service/ldr_ro/ldr_ro.cpp
+++ b/src/core/hle/service/ldr_ro/ldr_ro.cpp
@@ -12,10 +12,8 @@
#include "core/hle/service/ldr_ro/ldr_ro.h"
#include "core/hle/service/ldr_ro/memory_synchronizer.h"
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// Namespace LDR_RO
-
-namespace LDR_RO {
+namespace Service {
+namespace LDR {
static const ResultCode ERROR_ALREADY_INITIALIZED = // 0xD9612FF9
ResultCode(ErrorDescription::AlreadyInitialized, ErrorModule::RO, ErrorSummary::Internal,
@@ -71,7 +69,7 @@ static bool VerifyBufferState(VAddr buffer_ptr, u32 size) {
* 0 : Return header
* 1 : Result of function, 0 on success, otherwise error code
*/
-static void Initialize(Service::Interface* self) {
+static void Initialize(Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
VAddr crs_buffer_ptr = cmd_buff[1];
u32 crs_size = cmd_buff[2];
@@ -196,7 +194,7 @@ static void Initialize(Service::Interface* self) {
* 0 : Return header
* 1 : Result of function, 0 on success, otherwise error code
*/
-static void LoadCRR(Service::Interface* self) {
+static void LoadCRR(Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
u32 crr_buffer_ptr = cmd_buff[1];
u32 crr_size = cmd_buff[2];
@@ -229,7 +227,7 @@ static void LoadCRR(Service::Interface* self) {
* 0 : Return header
* 1 : Result of function, 0 on success, otherwise error code
*/
-static void UnloadCRR(Service::Interface* self) {
+static void UnloadCRR(Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
u32 crr_buffer_ptr = cmd_buff[1];
u32 descriptor = cmd_buff[2];
@@ -276,7 +274,7 @@ static void UnloadCRR(Service::Interface* self) {
* unified one of two, with an additional parameter link_on_load_bug_fix.
* There is a dispatcher template below.
*/
-static void LoadCRO(Service::Interface* self, bool link_on_load_bug_fix) {
+static void LoadCRO(Interface* self, bool link_on_load_bug_fix) {
u32* cmd_buff = Kernel::GetCommandBuffer();
VAddr cro_buffer_ptr = cmd_buff[1];
VAddr cro_address = cmd_buff[2];
@@ -469,7 +467,7 @@ static void LoadCRO(Service::Interface* self, bool link_on_load_bug_fix) {
}
template <bool link_on_load_bug_fix>
-static void LoadCRO(Service::Interface* self) {
+static void LoadCRO(Interface* self) {
LoadCRO(self, link_on_load_bug_fix);
}
@@ -486,7 +484,7 @@ static void LoadCRO(Service::Interface* self) {
* 0 : Return header
* 1 : Result of function, 0 on success, otherwise error code
*/
-static void UnloadCRO(Service::Interface* self) {
+static void UnloadCRO(Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
VAddr cro_address = cmd_buff[1];
u32 zero = cmd_buff[2];
@@ -580,7 +578,7 @@ static void UnloadCRO(Service::Interface* self) {
* 0 : Return header
* 1 : Result of function, 0 on success, otherwise error code
*/
-static void LinkCRO(Service::Interface* self) {
+static void LinkCRO(Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
VAddr cro_address = cmd_buff[1];
u32 descriptor = cmd_buff[2];
@@ -642,7 +640,7 @@ static void LinkCRO(Service::Interface* self) {
* 0 : Return header
* 1 : Result of function, 0 on success, otherwise error code
*/
-static void UnlinkCRO(Service::Interface* self) {
+static void UnlinkCRO(Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
VAddr cro_address = cmd_buff[1];
u32 descriptor = cmd_buff[2];
@@ -704,7 +702,7 @@ static void UnlinkCRO(Service::Interface* self) {
* 0 : Return header
* 1 : Result of function, 0 on success, otherwise error code
*/
-static void Shutdown(Service::Interface* self) {
+static void Shutdown(Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
VAddr crs_buffer_ptr = cmd_buff[1];
u32 descriptor = cmd_buff[2];
@@ -762,14 +760,12 @@ const Interface::FunctionInfo FunctionTable[] = {
// clang-format on
};
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// Interface class
-
-Interface::Interface() {
+LDR_RO::LDR_RO() {
Register(FunctionTable);
loaded_crs = 0;
memory_synchronizer.Clear();
}
-} // namespace
+} // namespace LDR
+} // namespace Service
diff --git a/src/core/hle/service/ldr_ro/ldr_ro.h b/src/core/hle/service/ldr_ro/ldr_ro.h
index 331637cde..0f6fe7b60 100644
--- a/src/core/hle/service/ldr_ro/ldr_ro.h
+++ b/src/core/hle/service/ldr_ro/ldr_ro.h
@@ -6,18 +6,17 @@
#include "core/hle/service/service.h"
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// Namespace LDR_RO
+namespace Service {
+namespace LDR {
-namespace LDR_RO {
-
-class Interface : public Service::Interface {
+class LDR_RO final : public Interface {
public:
- Interface();
+ LDR_RO();
std::string GetPortName() const override {
return "ldr:ro";
}
};
-} // namespace
+} // namespace LDR
+} // namespace Service
diff --git a/src/core/hle/service/ldr_ro/memory_synchronizer.cpp b/src/core/hle/service/ldr_ro/memory_synchronizer.cpp
index 989887264..0d44bf6bd 100644
--- a/src/core/hle/service/ldr_ro/memory_synchronizer.cpp
+++ b/src/core/hle/service/ldr_ro/memory_synchronizer.cpp
@@ -6,10 +6,8 @@
#include "common/assert.h"
#include "core/hle/service/ldr_ro/memory_synchronizer.h"
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// Namespace LDR_RO
-
-namespace LDR_RO {
+namespace Service {
+namespace LDR {
auto MemorySynchronizer::FindMemoryBlock(VAddr mapping, VAddr original) {
auto block = std::find_if(memory_blocks.begin(), memory_blocks.end(),
@@ -40,4 +38,5 @@ void MemorySynchronizer::SynchronizeOriginalMemory() {
}
}
-} // namespace
+} // namespace LDR
+} // namespace Service
diff --git a/src/core/hle/service/ldr_ro/memory_synchronizer.h b/src/core/hle/service/ldr_ro/memory_synchronizer.h
index 883ee4acf..438293a58 100644
--- a/src/core/hle/service/ldr_ro/memory_synchronizer.h
+++ b/src/core/hle/service/ldr_ro/memory_synchronizer.h
@@ -7,10 +7,8 @@
#include <vector>
#include "core/memory.h"
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// Namespace LDR_RO
-
-namespace LDR_RO {
+namespace Service {
+namespace LDR {
/**
* This is a work-around before we implement memory aliasing.
@@ -40,4 +38,5 @@ private:
auto FindMemoryBlock(VAddr mapping, VAddr original);
};
-} // namespace
+} // namespace LDR
+} // namespace Service