Add all services to the Service namespace

Previously there was a split where some of the services were in the
Service namespace and others were not.
This commit is contained in:
Lioncash
2016-12-10 07:51:50 -05:00
committed by linkmauve
parent a2d474386c
commit 963aedd8cc
50 changed files with 408 additions and 499 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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