Compare commits
3 Commits
__refs_pul
...
__refs_pul
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d67c6d5d01 | ||
|
|
e6266bb49f | ||
|
|
35795a042c |
@@ -162,17 +162,17 @@ std::vector<ARM_Interface::BacktraceEntry> ARM_Interface::GetBacktraceFromContex
|
||||
}
|
||||
|
||||
std::map<std::string, Symbols> symbols;
|
||||
for (const auto& module : modules) {
|
||||
symbols.insert_or_assign(module.second, GetSymbols(module.first, memory));
|
||||
for (const auto& mod : modules) {
|
||||
symbols.insert_or_assign(mod.second, GetSymbols(mod.first, memory));
|
||||
}
|
||||
|
||||
for (auto& entry : out) {
|
||||
VAddr base = 0;
|
||||
for (auto iter = modules.rbegin(); iter != modules.rend(); ++iter) {
|
||||
const auto& module{*iter};
|
||||
if (entry.original_address >= module.first) {
|
||||
entry.module = module.second;
|
||||
base = module.first;
|
||||
const auto& mod{*iter};
|
||||
if (entry.original_address >= mod.first) {
|
||||
entry.mod = mod.second;
|
||||
base = mod.first;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -180,10 +180,10 @@ std::vector<ARM_Interface::BacktraceEntry> ARM_Interface::GetBacktraceFromContex
|
||||
entry.offset = entry.original_address - base;
|
||||
entry.address = SEGMENT_BASE + entry.offset;
|
||||
|
||||
if (entry.module.empty())
|
||||
entry.module = "unknown";
|
||||
if (entry.mod.empty())
|
||||
entry.mod = "unknown";
|
||||
|
||||
const auto symbol_set = symbols.find(entry.module);
|
||||
const auto symbol_set = symbols.find(entry.mod);
|
||||
if (symbol_set != symbols.end()) {
|
||||
const auto symbol = GetSymbolName(symbol_set->second, entry.offset);
|
||||
if (symbol.has_value()) {
|
||||
@@ -218,17 +218,17 @@ std::vector<ARM_Interface::BacktraceEntry> ARM_Interface::GetBacktrace() const {
|
||||
}
|
||||
|
||||
std::map<std::string, Symbols> symbols;
|
||||
for (const auto& module : modules) {
|
||||
symbols.insert_or_assign(module.second, GetSymbols(module.first, memory));
|
||||
for (const auto& mod : modules) {
|
||||
symbols.insert_or_assign(mod.second, GetSymbols(mod.first, memory));
|
||||
}
|
||||
|
||||
for (auto& entry : out) {
|
||||
VAddr base = 0;
|
||||
for (auto iter = modules.rbegin(); iter != modules.rend(); ++iter) {
|
||||
const auto& module{*iter};
|
||||
if (entry.original_address >= module.first) {
|
||||
entry.module = module.second;
|
||||
base = module.first;
|
||||
const auto& mod{*iter};
|
||||
if (entry.original_address >= mod.first) {
|
||||
entry.mod = mod.second;
|
||||
base = mod.first;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -236,10 +236,10 @@ std::vector<ARM_Interface::BacktraceEntry> ARM_Interface::GetBacktrace() const {
|
||||
entry.offset = entry.original_address - base;
|
||||
entry.address = SEGMENT_BASE + entry.offset;
|
||||
|
||||
if (entry.module.empty())
|
||||
entry.module = "unknown";
|
||||
if (entry.mod.empty())
|
||||
entry.mod = "unknown";
|
||||
|
||||
const auto symbol_set = symbols.find(entry.module);
|
||||
const auto symbol_set = symbols.find(entry.mod);
|
||||
if (symbol_set != symbols.end()) {
|
||||
const auto symbol = GetSymbolName(symbol_set->second, entry.offset);
|
||||
if (symbol.has_value()) {
|
||||
@@ -262,7 +262,7 @@ void ARM_Interface::LogBacktrace() const {
|
||||
|
||||
const auto backtrace = GetBacktrace();
|
||||
for (const auto& entry : backtrace) {
|
||||
LOG_ERROR(Core_ARM, "{:20}{:016X} {:016X} {:016X} {}", entry.module, entry.address,
|
||||
LOG_ERROR(Core_ARM, "{:20}{:016X} {:016X} {:016X} {}", entry.mod, entry.address,
|
||||
entry.original_address, entry.offset, entry.name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ public:
|
||||
virtual void PrepareReschedule() = 0;
|
||||
|
||||
struct BacktraceEntry {
|
||||
std::string module;
|
||||
std::string mod;
|
||||
u64 address;
|
||||
u64 original_address;
|
||||
u64 offset;
|
||||
|
||||
@@ -10,7 +10,8 @@ ErrorApplet::~ErrorApplet() = default;
|
||||
|
||||
void DefaultErrorApplet::ShowError(ResultCode error, std::function<void()> finished) const {
|
||||
LOG_CRITICAL(Service_Fatal, "Application requested error display: {:04}-{:04} (raw={:08X})",
|
||||
static_cast<u32>(error.module.Value()), error.description.Value(), error.raw);
|
||||
static_cast<u32>(error.error_module.Value()), error.description.Value(),
|
||||
error.raw);
|
||||
}
|
||||
|
||||
void DefaultErrorApplet::ShowErrorWithTimestamp(ResultCode error, std::chrono::seconds time,
|
||||
@@ -18,7 +19,8 @@ void DefaultErrorApplet::ShowErrorWithTimestamp(ResultCode error, std::chrono::s
|
||||
LOG_CRITICAL(
|
||||
Service_Fatal,
|
||||
"Application requested error display: {:04X}-{:04X} (raw={:08X}) with timestamp={:016X}",
|
||||
static_cast<u32>(error.module.Value()), error.description.Value(), error.raw, time.count());
|
||||
static_cast<u32>(error.error_module.Value()), error.description.Value(), error.raw,
|
||||
time.count());
|
||||
}
|
||||
|
||||
void DefaultErrorApplet::ShowCustomErrorText(ResultCode error, std::string main_text,
|
||||
@@ -26,7 +28,8 @@ void DefaultErrorApplet::ShowCustomErrorText(ResultCode error, std::string main_
|
||||
std::function<void()> finished) const {
|
||||
LOG_CRITICAL(Service_Fatal,
|
||||
"Application requested custom error with error_code={:04X}-{:04X} (raw={:08X})",
|
||||
static_cast<u32>(error.module.Value()), error.description.Value(), error.raw);
|
||||
static_cast<u32>(error.error_module.Value()), error.description.Value(),
|
||||
error.raw);
|
||||
LOG_CRITICAL(Service_Fatal, " Main Text: {}", main_text);
|
||||
LOG_CRITICAL(Service_Fatal, " Detail Text: {}", detail_text);
|
||||
}
|
||||
|
||||
@@ -189,16 +189,16 @@ std::vector<Module> modules;
|
||||
} // Anonymous namespace
|
||||
|
||||
void RegisterModule(std::string name, VAddr beg, VAddr end, bool add_elf_ext) {
|
||||
Module module;
|
||||
Module mod;
|
||||
if (add_elf_ext) {
|
||||
Common::SplitPath(name, nullptr, &module.name, nullptr);
|
||||
module.name += ".elf";
|
||||
Common::SplitPath(name, nullptr, &mod.name, nullptr);
|
||||
mod.name += ".elf";
|
||||
} else {
|
||||
module.name = std::move(name);
|
||||
mod.name = std::move(name);
|
||||
}
|
||||
module.beg = beg;
|
||||
module.end = end;
|
||||
modules.push_back(std::move(module));
|
||||
mod.beg = beg;
|
||||
mod.end = end;
|
||||
modules.push_back(std::move(mod));
|
||||
}
|
||||
|
||||
static Kernel::Thread* FindThreadById(s64 id) {
|
||||
@@ -671,10 +671,10 @@ static void HandleQuery() {
|
||||
std::string buffer;
|
||||
buffer += "l<?xml version=\"1.0\"?>";
|
||||
buffer += "<library-list>";
|
||||
for (const auto& module : modules) {
|
||||
for (const auto& mod : modules) {
|
||||
buffer +=
|
||||
fmt::format(R"*("<library name = "{}"><segment address = "0x{:x}"/></library>)*",
|
||||
module.name, module.beg);
|
||||
mod.name, mod.beg);
|
||||
}
|
||||
buffer += "</library-list>";
|
||||
SendReply(buffer.c_str());
|
||||
|
||||
@@ -116,13 +116,13 @@ enum class ErrorModule : u32 {
|
||||
union ResultCode {
|
||||
u32 raw;
|
||||
|
||||
BitField<0, 9, ErrorModule> module;
|
||||
BitField<0, 9, ErrorModule> error_module;
|
||||
BitField<9, 13, u32> description;
|
||||
|
||||
constexpr explicit ResultCode(u32 raw) : raw(raw) {}
|
||||
|
||||
constexpr ResultCode(ErrorModule module_, u32 description_)
|
||||
: raw(module.FormatValue(module_) | description.FormatValue(description_)) {}
|
||||
: raw(error_module.FormatValue(module_) | description.FormatValue(description_)) {}
|
||||
|
||||
constexpr bool IsSuccess() const {
|
||||
return raw == 0;
|
||||
|
||||
@@ -807,25 +807,25 @@ void Module::Interface::TrySelectUserWithoutInteraction(Kernel::HLERequestContex
|
||||
rb.PushRaw<u128>(profile_manager->GetUser(0)->uuid);
|
||||
}
|
||||
|
||||
Module::Interface::Interface(std::shared_ptr<Module> module,
|
||||
Module::Interface::Interface(std::shared_ptr<Module> interface_module,
|
||||
std::shared_ptr<ProfileManager> profile_manager, Core::System& system,
|
||||
const char* name)
|
||||
: ServiceFramework(name), module(std::move(module)),
|
||||
: ServiceFramework(name), interface_module(std::move(interface_module)),
|
||||
profile_manager(std::move(profile_manager)), system(system) {}
|
||||
|
||||
Module::Interface::~Interface() = default;
|
||||
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto module = std::make_shared<Module>();
|
||||
auto interface_module = std::make_shared<Module>();
|
||||
auto profile_manager = std::make_shared<ProfileManager>();
|
||||
|
||||
std::make_shared<ACC_AA>(module, profile_manager, system)
|
||||
std::make_shared<ACC_AA>(interface_module, profile_manager, system)
|
||||
->InstallAsService(system.ServiceManager());
|
||||
std::make_shared<ACC_SU>(module, profile_manager, system)
|
||||
std::make_shared<ACC_SU>(interface_module, profile_manager, system)
|
||||
->InstallAsService(system.ServiceManager());
|
||||
std::make_shared<ACC_U0>(module, profile_manager, system)
|
||||
std::make_shared<ACC_U0>(interface_module, profile_manager, system)
|
||||
->InstallAsService(system.ServiceManager());
|
||||
std::make_shared<ACC_U1>(module, profile_manager, system)
|
||||
std::make_shared<ACC_U1>(interface_module, profile_manager, system)
|
||||
->InstallAsService(system.ServiceManager());
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class Module final {
|
||||
public:
|
||||
class Interface : public ServiceFramework<Interface> {
|
||||
public:
|
||||
explicit Interface(std::shared_ptr<Module> module,
|
||||
explicit Interface(std::shared_ptr<Module> interface_module,
|
||||
std::shared_ptr<ProfileManager> profile_manager, Core::System& system,
|
||||
const char* name);
|
||||
~Interface() override;
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
ApplicationInfo application_info{};
|
||||
|
||||
protected:
|
||||
std::shared_ptr<Module> module;
|
||||
std::shared_ptr<Module> interface_module;
|
||||
std::shared_ptr<ProfileManager> profile_manager;
|
||||
Core::System& system;
|
||||
};
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
|
||||
namespace Service::Account {
|
||||
|
||||
ACC_AA::ACC_AA(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager,
|
||||
Core::System& system)
|
||||
: Module::Interface(std::move(module), std::move(profile_manager), system, "acc:aa") {
|
||||
ACC_AA::ACC_AA(std::shared_ptr<Module> interface_module,
|
||||
std::shared_ptr<ProfileManager> profile_manager, Core::System& system)
|
||||
: Module::Interface(std::move(interface_module), std::move(profile_manager), system, "acc:aa") {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "EnsureCacheAsync"},
|
||||
{1, nullptr, "LoadCache"},
|
||||
|
||||
@@ -10,8 +10,8 @@ namespace Service::Account {
|
||||
|
||||
class ACC_AA final : public Module::Interface {
|
||||
public:
|
||||
explicit ACC_AA(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager,
|
||||
Core::System& system);
|
||||
explicit ACC_AA(std::shared_ptr<Module> interface_module,
|
||||
std::shared_ptr<ProfileManager> profile_manager, Core::System& system);
|
||||
~ACC_AA() override;
|
||||
};
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
|
||||
namespace Service::Account {
|
||||
|
||||
ACC_SU::ACC_SU(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager,
|
||||
Core::System& system)
|
||||
: Module::Interface(std::move(module), std::move(profile_manager), system, "acc:su") {
|
||||
ACC_SU::ACC_SU(std::shared_ptr<Module> interface_module,
|
||||
std::shared_ptr<ProfileManager> profile_manager, Core::System& system)
|
||||
: Module::Interface(std::move(interface_module), std::move(profile_manager), system, "acc:su") {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &ACC_SU::GetUserCount, "GetUserCount"},
|
||||
|
||||
@@ -10,8 +10,8 @@ namespace Service::Account {
|
||||
|
||||
class ACC_SU final : public Module::Interface {
|
||||
public:
|
||||
explicit ACC_SU(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager,
|
||||
Core::System& system);
|
||||
explicit ACC_SU(std::shared_ptr<Module> interface_module,
|
||||
std::shared_ptr<ProfileManager> profile_manager, Core::System& system);
|
||||
~ACC_SU() override;
|
||||
};
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
|
||||
namespace Service::Account {
|
||||
|
||||
ACC_U0::ACC_U0(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager,
|
||||
Core::System& system)
|
||||
: Module::Interface(std::move(module), std::move(profile_manager), system, "acc:u0") {
|
||||
ACC_U0::ACC_U0(std::shared_ptr<Module> interface_module,
|
||||
std::shared_ptr<ProfileManager> profile_manager, Core::System& system)
|
||||
: Module::Interface(std::move(interface_module), std::move(profile_manager), system, "acc:u0") {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &ACC_U0::GetUserCount, "GetUserCount"},
|
||||
|
||||
@@ -10,8 +10,8 @@ namespace Service::Account {
|
||||
|
||||
class ACC_U0 final : public Module::Interface {
|
||||
public:
|
||||
explicit ACC_U0(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager,
|
||||
Core::System& system);
|
||||
explicit ACC_U0(std::shared_ptr<Module> interface_module,
|
||||
std::shared_ptr<ProfileManager> profile_manager, Core::System& system);
|
||||
~ACC_U0() override;
|
||||
};
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
|
||||
namespace Service::Account {
|
||||
|
||||
ACC_U1::ACC_U1(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager,
|
||||
Core::System& system)
|
||||
: Module::Interface(std::move(module), std::move(profile_manager), system, "acc:u1") {
|
||||
ACC_U1::ACC_U1(std::shared_ptr<Module> interface_module,
|
||||
std::shared_ptr<ProfileManager> profile_manager, Core::System& system)
|
||||
: Module::Interface(std::move(interface_module), std::move(profile_manager), system, "acc:u1") {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &ACC_U1::GetUserCount, "GetUserCount"},
|
||||
|
||||
@@ -10,8 +10,8 @@ namespace Service::Account {
|
||||
|
||||
class ACC_U1 final : public Module::Interface {
|
||||
public:
|
||||
explicit ACC_U1(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager,
|
||||
Core::System& system);
|
||||
explicit ACC_U1(std::shared_ptr<Module> interface_module,
|
||||
std::shared_ptr<ProfileManager> profile_manager, Core::System& system);
|
||||
~ACC_U1() override;
|
||||
};
|
||||
|
||||
|
||||
@@ -77,11 +77,11 @@ void CopyArgumentData(const std::vector<u8>& data, T& variable) {
|
||||
|
||||
ResultCode Decode64BitError(u64 error) {
|
||||
const auto description = (error >> 32) & 0x1FFF;
|
||||
auto module = error & 0x3FF;
|
||||
if (module >= 2000)
|
||||
module -= 2000;
|
||||
module &= 0x1FF;
|
||||
return {static_cast<ErrorModule>(module), static_cast<u32>(description)};
|
||||
auto error_module = error & 0x3FF;
|
||||
if (error_module >= 2000)
|
||||
error_module -= 2000;
|
||||
error_module &= 0x1FF;
|
||||
return {static_cast<ErrorModule>(error_module), static_cast<u32>(description)};
|
||||
}
|
||||
|
||||
} // Anonymous namespace
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
|
||||
namespace Service::BCAT {
|
||||
|
||||
BCAT::BCAT(Core::System& system, std::shared_ptr<Module> module,
|
||||
BCAT::BCAT(Core::System& system, std::shared_ptr<Module> interface_module,
|
||||
FileSystem::FileSystemController& fsc, const char* name)
|
||||
: Interface(system, std::move(module), fsc, name) {
|
||||
: Interface(system, std::move(interface_module), fsc, name) {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &BCAT::CreateBcatService, "CreateBcatService"},
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Service::BCAT {
|
||||
|
||||
class BCAT final : public Module::Interface {
|
||||
public:
|
||||
explicit BCAT(Core::System& system, std::shared_ptr<Module> module,
|
||||
explicit BCAT(Core::System& system, std::shared_ptr<Module> interface_module,
|
||||
FileSystem::FileSystemController& fsc, const char* name);
|
||||
~BCAT() override;
|
||||
};
|
||||
|
||||
@@ -579,9 +579,9 @@ std::unique_ptr<Backend> CreateBackendFromSettings([[maybe_unused]] Core::System
|
||||
return std::make_unique<NullBackend>(std::move(getter));
|
||||
}
|
||||
|
||||
Module::Interface::Interface(Core::System& system_, std::shared_ptr<Module> module_,
|
||||
Module::Interface::Interface(Core::System& system_, std::shared_ptr<Module> interface_module,
|
||||
FileSystem::FileSystemController& fsc_, const char* name)
|
||||
: ServiceFramework(name), fsc{fsc_}, module{std::move(module_)},
|
||||
: ServiceFramework(name), fsc{fsc_}, interface_module{std::move(interface_module)},
|
||||
backend{CreateBackendFromSettings(system_,
|
||||
[&fsc_](u64 tid) { return fsc_.GetBCATDirectory(tid); })},
|
||||
system{system_} {}
|
||||
@@ -589,14 +589,14 @@ Module::Interface::Interface(Core::System& system_, std::shared_ptr<Module> modu
|
||||
Module::Interface::~Interface() = default;
|
||||
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto module = std::make_shared<Module>();
|
||||
std::make_shared<BCAT>(system, module, system.GetFileSystemController(), "bcat:a")
|
||||
auto interface_module = std::make_shared<Module>();
|
||||
std::make_shared<BCAT>(system, interface_module, system.GetFileSystemController(), "bcat:a")
|
||||
->InstallAsService(system.ServiceManager());
|
||||
std::make_shared<BCAT>(system, module, system.GetFileSystemController(), "bcat:m")
|
||||
std::make_shared<BCAT>(system, interface_module, system.GetFileSystemController(), "bcat:m")
|
||||
->InstallAsService(system.ServiceManager());
|
||||
std::make_shared<BCAT>(system, module, system.GetFileSystemController(), "bcat:u")
|
||||
std::make_shared<BCAT>(system, interface_module, system.GetFileSystemController(), "bcat:u")
|
||||
->InstallAsService(system.ServiceManager());
|
||||
std::make_shared<BCAT>(system, module, system.GetFileSystemController(), "bcat:s")
|
||||
std::make_shared<BCAT>(system, interface_module, system.GetFileSystemController(), "bcat:s")
|
||||
->InstallAsService(system.ServiceManager());
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class Module final {
|
||||
public:
|
||||
class Interface : public ServiceFramework<Interface> {
|
||||
public:
|
||||
explicit Interface(Core::System& system_, std::shared_ptr<Module> module_,
|
||||
explicit Interface(Core::System& system_, std::shared_ptr<Module> interface_module,
|
||||
FileSystem::FileSystemController& fsc_, const char* name);
|
||||
~Interface() override;
|
||||
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
protected:
|
||||
FileSystem::FileSystemController& fsc;
|
||||
|
||||
std::shared_ptr<Module> module;
|
||||
std::shared_ptr<Module> interface_module;
|
||||
std::unique_ptr<Backend> backend;
|
||||
|
||||
private:
|
||||
|
||||
@@ -20,8 +20,9 @@
|
||||
|
||||
namespace Service::Fatal {
|
||||
|
||||
Module::Interface::Interface(std::shared_ptr<Module> module, Core::System& system, const char* name)
|
||||
: ServiceFramework(name), module(std::move(module)), system(system) {}
|
||||
Module::Interface::Interface(std::shared_ptr<Module> interface_module, Core::System& system,
|
||||
const char* name)
|
||||
: ServiceFramework(name), interface_module(std::move(interface_module)), system(system) {}
|
||||
|
||||
Module::Interface::~Interface() = default;
|
||||
|
||||
@@ -75,7 +76,7 @@ static void GenerateErrorReport(Core::System& system, ResultCode error_code,
|
||||
"Program entry point: 0x{:16X}\n"
|
||||
"\n",
|
||||
Common::g_scm_branch, Common::g_scm_desc, title_id, error_code.raw,
|
||||
2000 + static_cast<u32>(error_code.module.Value()),
|
||||
2000 + static_cast<u32>(error_code.error_module.Value()),
|
||||
static_cast<u32>(error_code.description.Value()), info.set_flags, info.program_entry_point);
|
||||
if (info.backtrace_size != 0x0) {
|
||||
crash_report += "Registers:\n";
|
||||
@@ -166,9 +167,9 @@ void Module::Interface::ThrowFatalWithCpuContext(Kernel::HLERequestContext& ctx)
|
||||
}
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) {
|
||||
auto module = std::make_shared<Module>();
|
||||
std::make_shared<Fatal_P>(module, system)->InstallAsService(service_manager);
|
||||
std::make_shared<Fatal_U>(module, system)->InstallAsService(service_manager);
|
||||
auto interface_module = std::make_shared<Module>();
|
||||
std::make_shared<Fatal_P>(interface_module, system)->InstallAsService(service_manager);
|
||||
std::make_shared<Fatal_U>(interface_module, system)->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
} // namespace Service::Fatal
|
||||
|
||||
@@ -16,7 +16,8 @@ class Module final {
|
||||
public:
|
||||
class Interface : public ServiceFramework<Interface> {
|
||||
public:
|
||||
explicit Interface(std::shared_ptr<Module> module, Core::System& system, const char* name);
|
||||
explicit Interface(std::shared_ptr<Module> interface_module, Core::System& system,
|
||||
const char* name);
|
||||
~Interface() override;
|
||||
|
||||
void ThrowFatal(Kernel::HLERequestContext& ctx);
|
||||
@@ -24,7 +25,7 @@ public:
|
||||
void ThrowFatalWithCpuContext(Kernel::HLERequestContext& ctx);
|
||||
|
||||
protected:
|
||||
std::shared_ptr<Module> module;
|
||||
std::shared_ptr<Module> interface_module;
|
||||
Core::System& system;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
namespace Service::Fatal {
|
||||
|
||||
Fatal_P::Fatal_P(std::shared_ptr<Module> module, Core::System& system)
|
||||
: Module::Interface(std::move(module), system, "fatal:p") {}
|
||||
Fatal_P::Fatal_P(std::shared_ptr<Module> interface_module, Core::System& system)
|
||||
: Module::Interface(std::move(interface_module), system, "fatal:p") {}
|
||||
|
||||
Fatal_P::~Fatal_P() = default;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Service::Fatal {
|
||||
|
||||
class Fatal_P final : public Module::Interface {
|
||||
public:
|
||||
explicit Fatal_P(std::shared_ptr<Module> module, Core::System& system);
|
||||
explicit Fatal_P(std::shared_ptr<Module> interface_module, Core::System& system);
|
||||
~Fatal_P() override;
|
||||
};
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
namespace Service::Fatal {
|
||||
|
||||
Fatal_U::Fatal_U(std::shared_ptr<Module> module, Core::System& system)
|
||||
: Module::Interface(std::move(module), system, "fatal:u") {
|
||||
Fatal_U::Fatal_U(std::shared_ptr<Module> interface_module, Core::System& system)
|
||||
: Module::Interface(std::move(interface_module), system, "fatal:u") {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &Fatal_U::ThrowFatal, "ThrowFatal"},
|
||||
{1, &Fatal_U::ThrowFatalWithPolicy, "ThrowFatalWithPolicy"},
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Service::Fatal {
|
||||
|
||||
class Fatal_U final : public Module::Interface {
|
||||
public:
|
||||
explicit Fatal_U(std::shared_ptr<Module> module, Core::System& system);
|
||||
explicit Fatal_U(std::shared_ptr<Module> interface_module, Core::System& system);
|
||||
~Fatal_U() override;
|
||||
};
|
||||
|
||||
|
||||
@@ -281,18 +281,24 @@ void Module::Interface::CreateNotificationService(Kernel::HLERequestContext& ctx
|
||||
rb.PushIpcInterface<INotificationService>(uuid, system);
|
||||
}
|
||||
|
||||
Module::Interface::Interface(std::shared_ptr<Module> module, Core::System& system, const char* name)
|
||||
: ServiceFramework(name), module(std::move(module)), system(system) {}
|
||||
Module::Interface::Interface(std::shared_ptr<Module> interface_module, Core::System& system,
|
||||
const char* name)
|
||||
: ServiceFramework(name), interface_module(std::move(interface_module)), system(system) {}
|
||||
|
||||
Module::Interface::~Interface() = default;
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) {
|
||||
auto module = std::make_shared<Module>();
|
||||
std::make_shared<Friend>(module, system, "friend:a")->InstallAsService(service_manager);
|
||||
std::make_shared<Friend>(module, system, "friend:m")->InstallAsService(service_manager);
|
||||
std::make_shared<Friend>(module, system, "friend:s")->InstallAsService(service_manager);
|
||||
std::make_shared<Friend>(module, system, "friend:u")->InstallAsService(service_manager);
|
||||
std::make_shared<Friend>(module, system, "friend:v")->InstallAsService(service_manager);
|
||||
auto interface_module = std::make_shared<Module>();
|
||||
std::make_shared<Friend>(interface_module, system, "friend:a")
|
||||
->InstallAsService(service_manager);
|
||||
std::make_shared<Friend>(interface_module, system, "friend:m")
|
||||
->InstallAsService(service_manager);
|
||||
std::make_shared<Friend>(interface_module, system, "friend:s")
|
||||
->InstallAsService(service_manager);
|
||||
std::make_shared<Friend>(interface_module, system, "friend:u")
|
||||
->InstallAsService(service_manager);
|
||||
std::make_shared<Friend>(interface_module, system, "friend:v")
|
||||
->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
} // namespace Service::Friend
|
||||
|
||||
@@ -16,14 +16,15 @@ class Module final {
|
||||
public:
|
||||
class Interface : public ServiceFramework<Interface> {
|
||||
public:
|
||||
explicit Interface(std::shared_ptr<Module> module, Core::System& system, const char* name);
|
||||
explicit Interface(std::shared_ptr<Module> interface_module, Core::System& system,
|
||||
const char* name);
|
||||
~Interface() override;
|
||||
|
||||
void CreateFriendService(Kernel::HLERequestContext& ctx);
|
||||
void CreateNotificationService(Kernel::HLERequestContext& ctx);
|
||||
|
||||
protected:
|
||||
std::shared_ptr<Module> module;
|
||||
std::shared_ptr<Module> interface_module;
|
||||
Core::System& system;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
namespace Service::Friend {
|
||||
|
||||
Friend::Friend(std::shared_ptr<Module> module, Core::System& system, const char* name)
|
||||
: Interface(std::move(module), system, name) {
|
||||
Friend::Friend(std::shared_ptr<Module> interface_module, Core::System& system, const char* name)
|
||||
: Interface(std::move(interface_module), system, name) {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &Friend::CreateFriendService, "CreateFriendService"},
|
||||
{1, &Friend::CreateNotificationService, "CreateNotificationService"},
|
||||
|
||||
@@ -10,7 +10,8 @@ namespace Service::Friend {
|
||||
|
||||
class Friend final : public Module::Interface {
|
||||
public:
|
||||
explicit Friend(std::shared_ptr<Module> module, Core::System& system, const char* name);
|
||||
explicit Friend(std::shared_ptr<Module> interface_module, Core::System& system,
|
||||
const char* name);
|
||||
~Friend() override;
|
||||
};
|
||||
|
||||
|
||||
@@ -21,8 +21,9 @@ namespace ErrCodes {
|
||||
constexpr ResultCode ERR_NO_APPLICATION_AREA(ErrorModule::NFP, 152);
|
||||
} // namespace ErrCodes
|
||||
|
||||
Module::Interface::Interface(std::shared_ptr<Module> module, Core::System& system, const char* name)
|
||||
: ServiceFramework(name), module(std::move(module)), system(system) {
|
||||
Module::Interface::Interface(std::shared_ptr<Module> interface_module, Core::System& system,
|
||||
const char* name)
|
||||
: ServiceFramework(name), interface_module(std::move(interface_module)), system(system) {
|
||||
auto& kernel = system.Kernel();
|
||||
nfc_tag_load = Kernel::WritableEvent::CreateEventPair(kernel, "IUser:NFCTagDetected");
|
||||
}
|
||||
@@ -354,8 +355,8 @@ const Module::Interface::AmiiboFile& Module::Interface::GetAmiiboBuffer() const
|
||||
}
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) {
|
||||
auto module = std::make_shared<Module>();
|
||||
std::make_shared<NFP_User>(module, system)->InstallAsService(service_manager);
|
||||
auto interface_module = std::make_shared<Module>();
|
||||
std::make_shared<NFP_User>(interface_module, system)->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
} // namespace Service::NFP
|
||||
|
||||
@@ -16,7 +16,8 @@ class Module final {
|
||||
public:
|
||||
class Interface : public ServiceFramework<Interface> {
|
||||
public:
|
||||
explicit Interface(std::shared_ptr<Module> module, Core::System& system, const char* name);
|
||||
explicit Interface(std::shared_ptr<Module> interface_module, Core::System& system,
|
||||
const char* name);
|
||||
~Interface() override;
|
||||
|
||||
struct ModelInfo {
|
||||
@@ -42,7 +43,7 @@ public:
|
||||
AmiiboFile amiibo{};
|
||||
|
||||
protected:
|
||||
std::shared_ptr<Module> module;
|
||||
std::shared_ptr<Module> interface_module;
|
||||
Core::System& system;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
namespace Service::NFP {
|
||||
|
||||
NFP_User::NFP_User(std::shared_ptr<Module> module, Core::System& system)
|
||||
: Module::Interface(std::move(module), system, "nfp:user") {
|
||||
NFP_User::NFP_User(std::shared_ptr<Module> interface_module, Core::System& system)
|
||||
: Module::Interface(std::move(interface_module), system, "nfp:user") {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &NFP_User::CreateUserInterface, "CreateUserInterface"},
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Service::NFP {
|
||||
|
||||
class NFP_User final : public Module::Interface {
|
||||
public:
|
||||
explicit NFP_User(std::shared_ptr<Module> module, Core::System& system);
|
||||
explicit NFP_User(std::shared_ptr<Module> interface_module, Core::System& system);
|
||||
~NFP_User() override;
|
||||
};
|
||||
|
||||
|
||||
@@ -148,17 +148,17 @@ void Module::Interface::CreateServiceWithoutInitialize(Kernel::HLERequestContext
|
||||
rb.PushIpcInterface<IParentalControlService>();
|
||||
}
|
||||
|
||||
Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)
|
||||
: ServiceFramework(name), module(std::move(module)) {}
|
||||
Module::Interface::Interface(std::shared_ptr<Module> interface_module, const char* name)
|
||||
: ServiceFramework(name), interface_module(std::move(interface_module)) {}
|
||||
|
||||
Module::Interface::~Interface() = default;
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
auto module = std::make_shared<Module>();
|
||||
std::make_shared<PCTL>(module, "pctl")->InstallAsService(service_manager);
|
||||
std::make_shared<PCTL>(module, "pctl:a")->InstallAsService(service_manager);
|
||||
std::make_shared<PCTL>(module, "pctl:r")->InstallAsService(service_manager);
|
||||
std::make_shared<PCTL>(module, "pctl:s")->InstallAsService(service_manager);
|
||||
auto interface_module = std::make_shared<Module>();
|
||||
std::make_shared<PCTL>(interface_module, "pctl")->InstallAsService(service_manager);
|
||||
std::make_shared<PCTL>(interface_module, "pctl:a")->InstallAsService(service_manager);
|
||||
std::make_shared<PCTL>(interface_module, "pctl:r")->InstallAsService(service_manager);
|
||||
std::make_shared<PCTL>(interface_module, "pctl:s")->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
} // namespace Service::PCTL
|
||||
|
||||
@@ -12,14 +12,14 @@ class Module final {
|
||||
public:
|
||||
class Interface : public ServiceFramework<Interface> {
|
||||
public:
|
||||
explicit Interface(std::shared_ptr<Module> module, const char* name);
|
||||
explicit Interface(std::shared_ptr<Module> interface_module, const char* name);
|
||||
~Interface() override;
|
||||
|
||||
void CreateService(Kernel::HLERequestContext& ctx);
|
||||
void CreateServiceWithoutInitialize(Kernel::HLERequestContext& ctx);
|
||||
|
||||
protected:
|
||||
std::shared_ptr<Module> module;
|
||||
std::shared_ptr<Module> interface_module;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
namespace Service::PCTL {
|
||||
|
||||
PCTL::PCTL(std::shared_ptr<Module> module, const char* name)
|
||||
: Module::Interface(std::move(module), name) {
|
||||
PCTL::PCTL(std::shared_ptr<Module> interface_module, const char* name)
|
||||
: Module::Interface(std::move(interface_module), name) {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &PCTL::CreateService, "CreateService"},
|
||||
{1, &PCTL::CreateServiceWithoutInitialize, "CreateServiceWithoutInitialize"},
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Service::PCTL {
|
||||
|
||||
class PCTL final : public Module::Interface {
|
||||
public:
|
||||
explicit PCTL(std::shared_ptr<Module> module, const char* name);
|
||||
explicit PCTL(std::shared_ptr<Module> interface_module, const char* name);
|
||||
~PCTL() override;
|
||||
};
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
|
||||
namespace Service::SPL {
|
||||
|
||||
CSRNG::CSRNG(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "csrng") {
|
||||
CSRNG::CSRNG(std::shared_ptr<Module> interface_module)
|
||||
: Module::Interface(std::move(interface_module), "csrng") {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &CSRNG::GetRandomBytes, "GetRandomBytes"},
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Service::SPL {
|
||||
|
||||
class CSRNG final : public Module::Interface {
|
||||
public:
|
||||
explicit CSRNG(std::shared_ptr<Module> module);
|
||||
explicit CSRNG(std::shared_ptr<Module> interface_module);
|
||||
~CSRNG() override;
|
||||
};
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
namespace Service::SPL {
|
||||
|
||||
Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)
|
||||
: ServiceFramework(name), module(std::move(module)),
|
||||
Module::Interface::Interface(std::shared_ptr<Module> interface_module, const char* name)
|
||||
: ServiceFramework(name), interface_module(std::move(interface_module)),
|
||||
rng(Settings::values.rng_seed.GetValue().value_or(std::time(nullptr))) {}
|
||||
|
||||
Module::Interface::~Interface() = default;
|
||||
@@ -39,9 +39,9 @@ void Module::Interface::GetRandomBytes(Kernel::HLERequestContext& ctx) {
|
||||
}
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
auto module = std::make_shared<Module>();
|
||||
std::make_shared<CSRNG>(module)->InstallAsService(service_manager);
|
||||
std::make_shared<SPL>(module)->InstallAsService(service_manager);
|
||||
auto interface_module = std::make_shared<Module>();
|
||||
std::make_shared<CSRNG>(interface_module)->InstallAsService(service_manager);
|
||||
std::make_shared<SPL>(interface_module)->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
} // namespace Service::SPL
|
||||
|
||||
@@ -13,13 +13,13 @@ class Module final {
|
||||
public:
|
||||
class Interface : public ServiceFramework<Interface> {
|
||||
public:
|
||||
explicit Interface(std::shared_ptr<Module> module, const char* name);
|
||||
explicit Interface(std::shared_ptr<Module> interface_module, const char* name);
|
||||
~Interface() override;
|
||||
|
||||
void GetRandomBytes(Kernel::HLERequestContext& ctx);
|
||||
|
||||
protected:
|
||||
std::shared_ptr<Module> module;
|
||||
std::shared_ptr<Module> interface_module;
|
||||
|
||||
private:
|
||||
std::mt19937 rng;
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
|
||||
namespace Service::SPL {
|
||||
|
||||
SPL::SPL(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "spl:") {
|
||||
SPL::SPL(std::shared_ptr<Module> interface_module)
|
||||
: Module::Interface(std::move(interface_module), "spl:") {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "GetConfig"},
|
||||
{1, nullptr, "ModularExponentiate"},
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
namespace Service::Time {
|
||||
|
||||
Time::Time(std::shared_ptr<Module> module, Core::System& system, const char* name)
|
||||
: Module::Interface(std::move(module), system, name) {
|
||||
Time::Time(std::shared_ptr<Module> interface_module, Core::System& system, const char* name)
|
||||
: Module::Interface(std::move(interface_module), system, name) {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &Time::GetStandardUserSystemClock, "GetStandardUserSystemClock"},
|
||||
|
||||
@@ -125,7 +125,7 @@ ResultCode Module::Interface::GetClockSnapshotFromSystemClockContextInternal(
|
||||
Kernel::Thread* thread, Clock::SystemClockContext user_context,
|
||||
Clock::SystemClockContext network_context, u8 type, Clock::ClockSnapshot& clock_snapshot) {
|
||||
|
||||
auto& time_manager{module->GetTimeManager()};
|
||||
auto& time_manager{interface_module->GetTimeManager()};
|
||||
|
||||
clock_snapshot.is_automatic_correction_enabled =
|
||||
time_manager.GetStandardUserSystemClockCore().IsAutomaticCorrectionEnabled();
|
||||
@@ -182,45 +182,46 @@ void Module::Interface::GetStandardUserSystemClock(Kernel::HLERequestContext& ct
|
||||
LOG_DEBUG(Service_Time, "called");
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<ISystemClock>(module->GetTimeManager().GetStandardUserSystemClockCore(),
|
||||
system);
|
||||
rb.PushIpcInterface<ISystemClock>(
|
||||
interface_module->GetTimeManager().GetStandardUserSystemClockCore(), system);
|
||||
}
|
||||
|
||||
void Module::Interface::GetStandardNetworkSystemClock(Kernel::HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Time, "called");
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<ISystemClock>(module->GetTimeManager().GetStandardNetworkSystemClockCore(),
|
||||
system);
|
||||
rb.PushIpcInterface<ISystemClock>(
|
||||
interface_module->GetTimeManager().GetStandardNetworkSystemClockCore(), system);
|
||||
}
|
||||
|
||||
void Module::Interface::GetStandardSteadyClock(Kernel::HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Time, "called");
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<ISteadyClock>(module->GetTimeManager().GetStandardSteadyClockCore(),
|
||||
system);
|
||||
rb.PushIpcInterface<ISteadyClock>(
|
||||
interface_module->GetTimeManager().GetStandardSteadyClockCore(), system);
|
||||
}
|
||||
|
||||
void Module::Interface::GetTimeZoneService(Kernel::HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Time, "called");
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<ITimeZoneService>(module->GetTimeManager().GetTimeZoneContentManager());
|
||||
rb.PushIpcInterface<ITimeZoneService>(
|
||||
interface_module->GetTimeManager().GetTimeZoneContentManager());
|
||||
}
|
||||
|
||||
void Module::Interface::GetStandardLocalSystemClock(Kernel::HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Time, "called");
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<ISystemClock>(module->GetTimeManager().GetStandardLocalSystemClockCore(),
|
||||
system);
|
||||
rb.PushIpcInterface<ISystemClock>(
|
||||
interface_module->GetTimeManager().GetStandardLocalSystemClockCore(), system);
|
||||
}
|
||||
|
||||
void Module::Interface::IsStandardNetworkSystemClockAccuracySufficient(
|
||||
Kernel::HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Time, "called");
|
||||
auto& clock_core{module->GetTimeManager().GetStandardNetworkSystemClockCore()};
|
||||
auto& clock_core{interface_module->GetTimeManager().GetStandardNetworkSystemClockCore()};
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push<u32>(clock_core.IsStandardNetworkSystemClockAccuracySufficient(system));
|
||||
@@ -229,7 +230,7 @@ void Module::Interface::IsStandardNetworkSystemClockAccuracySufficient(
|
||||
void Module::Interface::CalculateMonotonicSystemClockBaseTimePoint(Kernel::HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Time, "called");
|
||||
|
||||
auto& steady_clock_core{module->GetTimeManager().GetStandardSteadyClockCore()};
|
||||
auto& steady_clock_core{interface_module->GetTimeManager().GetStandardSteadyClockCore()};
|
||||
if (!steady_clock_core.IsInitialized()) {
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ERROR_UNINITIALIZED_CLOCK);
|
||||
@@ -262,7 +263,7 @@ void Module::Interface::GetClockSnapshot(Kernel::HLERequestContext& ctx) {
|
||||
|
||||
Clock::SystemClockContext user_context{};
|
||||
if (const ResultCode result{
|
||||
module->GetTimeManager().GetStandardUserSystemClockCore().GetClockContext(
|
||||
interface_module->GetTimeManager().GetStandardUserSystemClockCore().GetClockContext(
|
||||
system, user_context)};
|
||||
result.IsError()) {
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
@@ -271,7 +272,7 @@ void Module::Interface::GetClockSnapshot(Kernel::HLERequestContext& ctx) {
|
||||
}
|
||||
Clock::SystemClockContext network_context{};
|
||||
if (const ResultCode result{
|
||||
module->GetTimeManager().GetStandardNetworkSystemClockCore().GetClockContext(
|
||||
interface_module->GetTimeManager().GetStandardNetworkSystemClockCore().GetClockContext(
|
||||
system, network_context)};
|
||||
result.IsError()) {
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
@@ -372,19 +373,24 @@ void Module::Interface::GetSharedMemoryNativeHandle(Kernel::HLERequestContext& c
|
||||
LOG_DEBUG(Service_Time, "called");
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushCopyObjects(module->GetTimeManager().GetSharedMemory().GetSharedMemoryHolder());
|
||||
rb.PushCopyObjects(
|
||||
interface_module->GetTimeManager().GetSharedMemory().GetSharedMemoryHolder());
|
||||
}
|
||||
|
||||
Module::Interface::Interface(std::shared_ptr<Module> module, Core::System& system, const char* name)
|
||||
: ServiceFramework(name), module{std::move(module)}, system{system} {}
|
||||
Module::Interface::Interface(std::shared_ptr<Module> interface_module, Core::System& system,
|
||||
const char* name)
|
||||
: ServiceFramework(name), interface_module{std::move(interface_module)}, system{system} {}
|
||||
|
||||
Module::Interface::~Interface() = default;
|
||||
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto module{std::make_shared<Module>(system)};
|
||||
std::make_shared<Time>(module, system, "time:a")->InstallAsService(system.ServiceManager());
|
||||
std::make_shared<Time>(module, system, "time:s")->InstallAsService(system.ServiceManager());
|
||||
std::make_shared<Time>(module, system, "time:u")->InstallAsService(system.ServiceManager());
|
||||
auto interface_module{std::make_shared<Module>(system)};
|
||||
std::make_shared<Time>(interface_module, system, "time:a")
|
||||
->InstallAsService(system.ServiceManager());
|
||||
std::make_shared<Time>(interface_module, system, "time:s")
|
||||
->InstallAsService(system.ServiceManager());
|
||||
std::make_shared<Time>(interface_module, system, "time:u")
|
||||
->InstallAsService(system.ServiceManager());
|
||||
}
|
||||
|
||||
} // namespace Service::Time
|
||||
|
||||
@@ -20,7 +20,8 @@ public:
|
||||
|
||||
class Interface : public ServiceFramework<Interface> {
|
||||
public:
|
||||
explicit Interface(std::shared_ptr<Module> module, Core::System& system, const char* name);
|
||||
explicit Interface(std::shared_ptr<Module> interface_module, Core::System& system,
|
||||
const char* name);
|
||||
~Interface() override;
|
||||
|
||||
void GetStandardUserSystemClock(Kernel::HLERequestContext& ctx);
|
||||
@@ -43,7 +44,7 @@ public:
|
||||
Clock::ClockSnapshot& cloc_snapshot);
|
||||
|
||||
protected:
|
||||
std::shared_ptr<Module> module;
|
||||
std::shared_ptr<Module> interface_module;
|
||||
Core::System& system;
|
||||
};
|
||||
|
||||
|
||||
@@ -135,13 +135,13 @@ AppLoader_DeconstructedRomDirectory::LoadResult AppLoader_DeconstructedRomDirect
|
||||
|
||||
// Use the NSO module loader to figure out the code layout
|
||||
std::size_t code_size{};
|
||||
for (const auto& module : static_modules) {
|
||||
const FileSys::VirtualFile module_file{dir->GetFile(module)};
|
||||
for (const auto& mod : static_modules) {
|
||||
const FileSys::VirtualFile module_file{dir->GetFile(mod)};
|
||||
if (!module_file) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const bool should_pass_arguments = std::strcmp(module, "rtld") == 0;
|
||||
const bool should_pass_arguments = std::strcmp(mod, "rtld") == 0;
|
||||
const auto tentative_next_load_addr = AppLoader_NSO::LoadModule(
|
||||
process, system, *module_file, code_size, should_pass_arguments, false);
|
||||
if (!tentative_next_load_addr) {
|
||||
@@ -161,14 +161,14 @@ AppLoader_DeconstructedRomDirectory::LoadResult AppLoader_DeconstructedRomDirect
|
||||
const VAddr base_address{process.PageTable().GetCodeRegionStart()};
|
||||
VAddr next_load_addr{base_address};
|
||||
const FileSys::PatchManager pm{metadata.GetTitleID()};
|
||||
for (const auto& module : static_modules) {
|
||||
const FileSys::VirtualFile module_file{dir->GetFile(module)};
|
||||
for (const auto& mod : static_modules) {
|
||||
const FileSys::VirtualFile module_file{dir->GetFile(mod)};
|
||||
if (!module_file) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const VAddr load_addr{next_load_addr};
|
||||
const bool should_pass_arguments = std::strcmp(module, "rtld") == 0;
|
||||
const bool should_pass_arguments = std::strcmp(mod, "rtld") == 0;
|
||||
const auto tentative_next_load_addr = AppLoader_NSO::LoadModule(
|
||||
process, system, *module_file, load_addr, should_pass_arguments, true, pm);
|
||||
if (!tentative_next_load_addr) {
|
||||
@@ -176,10 +176,10 @@ AppLoader_DeconstructedRomDirectory::LoadResult AppLoader_DeconstructedRomDirect
|
||||
}
|
||||
|
||||
next_load_addr = *tentative_next_load_addr;
|
||||
modules.insert_or_assign(load_addr, module);
|
||||
LOG_DEBUG(Loader, "loaded module {} @ 0x{:X}", module, load_addr);
|
||||
modules.insert_or_assign(load_addr, mod);
|
||||
LOG_DEBUG(Loader, "loaded module {} @ 0x{:X}", mod, load_addr);
|
||||
// Register module with GDBStub
|
||||
GDBStub::RegisterModule(module, load_addr, next_load_addr - 1, false);
|
||||
GDBStub::RegisterModule(mod, load_addr, next_load_addr - 1, false);
|
||||
}
|
||||
|
||||
// Find the RomFS by searching for a ".romfs" file in this directory
|
||||
|
||||
@@ -69,7 +69,7 @@ json GetReportCommonData(u64 title_id, ResultCode result, const std::string& tim
|
||||
auto out = json{
|
||||
{"title_id", fmt::format("{:016X}", title_id)},
|
||||
{"result_raw", fmt::format("{:08X}", result.raw)},
|
||||
{"result_module", fmt::format("{:08X}", static_cast<u32>(result.module.Value()))},
|
||||
{"result_module", fmt::format("{:08X}", static_cast<u32>(result.error_module.Value()))},
|
||||
{"result_description", fmt::format("{:08X}", result.description.Value())},
|
||||
{"timestamp", timestamp},
|
||||
};
|
||||
@@ -127,7 +127,7 @@ json GetBacktraceData(Core::System& system) {
|
||||
const auto& backtrace{system.CurrentArmInterface().GetBacktrace()};
|
||||
for (const auto& entry : backtrace) {
|
||||
out.push_back({
|
||||
{"module", entry.module},
|
||||
{"module", entry.mod},
|
||||
{"address", fmt::format("{:016X}", entry.address)},
|
||||
{"original_address", fmt::format("{:016X}", entry.original_address)},
|
||||
{"offset", fmt::format("{:016X}", entry.offset)},
|
||||
|
||||
@@ -529,7 +529,7 @@ void VKBlitScreen::CreateGraphicsPipeline() {
|
||||
.pNext = nullptr,
|
||||
.flags = 0,
|
||||
.stage = VK_SHADER_STAGE_VERTEX_BIT,
|
||||
.module = *vertex_shader,
|
||||
.vkModule = *vertex_shader,
|
||||
.pName = "main",
|
||||
.pSpecializationInfo = nullptr,
|
||||
},
|
||||
@@ -538,7 +538,7 @@ void VKBlitScreen::CreateGraphicsPipeline() {
|
||||
.pNext = nullptr,
|
||||
.flags = 0,
|
||||
.stage = VK_SHADER_STAGE_FRAGMENT_BIT,
|
||||
.module = *fragment_shader,
|
||||
.vkModule = *fragment_shader,
|
||||
.pName = "main",
|
||||
.pSpecializationInfo = nullptr,
|
||||
},
|
||||
|
||||
@@ -418,7 +418,7 @@ VKComputePass::VKComputePass(const VKDevice& device, VKDescriptorPool& descripto
|
||||
auto code_copy = std::make_unique<u32[]>(code_size / sizeof(u32) + 1);
|
||||
std::memcpy(code_copy.get(), code, code_size);
|
||||
|
||||
module = device.GetLogical().CreateShaderModule({
|
||||
shader_module = device.GetLogical().CreateShaderModule({
|
||||
.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO,
|
||||
.pNext = nullptr,
|
||||
.flags = 0,
|
||||
@@ -436,7 +436,7 @@ VKComputePass::VKComputePass(const VKDevice& device, VKDescriptorPool& descripto
|
||||
.pNext = nullptr,
|
||||
.flags = 0,
|
||||
.stage = VK_SHADER_STAGE_COMPUTE_BIT,
|
||||
.module = *module,
|
||||
.vkModule = *shader_module,
|
||||
.pName = "main",
|
||||
.pSpecializationInfo = nullptr,
|
||||
},
|
||||
|
||||
@@ -40,7 +40,7 @@ protected:
|
||||
private:
|
||||
vk::DescriptorSetLayout descriptor_set_layout;
|
||||
std::optional<DescriptorAllocator> descriptor_allocator;
|
||||
vk::ShaderModule module;
|
||||
vk::ShaderModule shader_module;
|
||||
};
|
||||
|
||||
class QuadArrayPass final : public VKComputePass {
|
||||
|
||||
@@ -128,7 +128,7 @@ vk::Pipeline VKComputePipeline::CreatePipeline() const {
|
||||
.pNext = nullptr,
|
||||
.flags = 0,
|
||||
.stage = VK_SHADER_STAGE_COMPUTE_BIT,
|
||||
.module = *shader_module,
|
||||
.vkModule = *shader_module,
|
||||
.pName = "main",
|
||||
.pSpecializationInfo = nullptr,
|
||||
},
|
||||
|
||||
@@ -14,7 +14,12 @@
|
||||
#include <vector>
|
||||
|
||||
#define VK_NO_PROTOTYPES
|
||||
// As "module" is defined in various structs as members in the vulkan library, this would be a
|
||||
// specification breaking change. To combat this, we rename the use of "module" to vkModule since
|
||||
// we're targeting C++20
|
||||
#define module vkModule
|
||||
#include <vulkan/vulkan.h>
|
||||
#undef module
|
||||
|
||||
#include "common/common_types.h"
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ void QtErrorDisplay::ShowError(ResultCode error, std::function<void()> finished)
|
||||
emit MainWindowDisplayError(
|
||||
tr("An error has occured.\nPlease try again or contact the developer of the "
|
||||
"software.\n\nError Code: %1-%2 (0x%3)")
|
||||
.arg(static_cast<u32>(error.module.Value()) + 2000, 4, 10, QChar::fromLatin1('0'))
|
||||
.arg(static_cast<u32>(error.error_module.Value()) + 2000, 4, 10, QChar::fromLatin1('0'))
|
||||
.arg(error.description, 4, 10, QChar::fromLatin1('0'))
|
||||
.arg(error.raw, 8, 16, QChar::fromLatin1('0')));
|
||||
}
|
||||
@@ -36,7 +36,7 @@ void QtErrorDisplay::ShowErrorWithTimestamp(ResultCode error, std::chrono::secon
|
||||
"developer of the software.\n\nError Code: %3-%4 (0x%5)")
|
||||
.arg(date_time.toString(QStringLiteral("dddd, MMMM d, yyyy")))
|
||||
.arg(date_time.toString(QStringLiteral("h:mm:ss A")))
|
||||
.arg(static_cast<u32>(error.module.Value()) + 2000, 4, 10, QChar::fromLatin1('0'))
|
||||
.arg(static_cast<u32>(error.error_module.Value()) + 2000, 4, 10, QChar::fromLatin1('0'))
|
||||
.arg(error.description, 4, 10, QChar::fromLatin1('0'))
|
||||
.arg(error.raw, 8, 16, QChar::fromLatin1('0')));
|
||||
}
|
||||
@@ -47,7 +47,7 @@ void QtErrorDisplay::ShowCustomErrorText(ResultCode error, std::string dialog_te
|
||||
this->callback = std::move(finished);
|
||||
emit MainWindowDisplayError(
|
||||
tr("An error has occured.\nError Code: %1-%2 (0x%3)\n\n%4\n\n%5")
|
||||
.arg(static_cast<u32>(error.module.Value()) + 2000, 4, 10, QChar::fromLatin1('0'))
|
||||
.arg(static_cast<u32>(error.error_module.Value()) + 2000, 4, 10, QChar::fromLatin1('0'))
|
||||
.arg(error.description, 4, 10, QChar::fromLatin1('0'))
|
||||
.arg(error.raw, 8, 16, QChar::fromLatin1('0'))
|
||||
.arg(QString::fromStdString(dialog_text))
|
||||
|
||||
@@ -162,7 +162,7 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeCallstack::GetChildren() cons
|
||||
thread.GetContext64());
|
||||
|
||||
for (auto& entry : backtrace) {
|
||||
std::string s = fmt::format("{:20}{:016X} {:016X} {:016X} {}", entry.module, entry.address,
|
||||
std::string s = fmt::format("{:20}{:016X} {:016X} {:016X} {}", entry.mod, entry.address,
|
||||
entry.original_address, entry.offset, entry.name);
|
||||
list.push_back(std::make_unique<WaitTreeText>(QString::fromStdString(s)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user