Core: pass down Core::System reference to all services (#4272)

* Core: pass down Core::System reference to all services

This has to be done at once due to unified interface used by HLE/LLE switcher

* apt: eliminate Core::System::GetInstance

* gpu_gsp: eliminate Core::System::GetInstance in service

* hid: eliminate Core::System::GetInstance

* nwm: eliminate Core::System::GetInstance

* err_f: eliminate Core::System::GetInstance
This commit is contained in:
Weiyi Wang
2018-10-05 10:59:43 -04:00
committed by GitHub
parent 008242c5f3
commit b163502744
77 changed files with 329 additions and 111 deletions
+4 -4
View File
@@ -154,7 +154,7 @@ void ERR_F::ThrowFatalError(Kernel::HLERequestContext& ctx) {
LOG_CRITICAL(Service_ERR, "Fatal error");
const ErrInfo errinfo = rp.PopRaw<ErrInfo>();
LOG_CRITICAL(Service_ERR, "Fatal error type: {}", GetErrType(errinfo.errinfo_common.specifier));
Core::System::GetInstance().SetStatus(Core::System::ResultStatus::ErrorUnknown);
system.SetStatus(Core::System::ResultStatus::ErrorUnknown);
// Generic Info
LogGenericInfo(errinfo.errinfo_common);
@@ -232,7 +232,7 @@ void ERR_F::ThrowFatalError(Kernel::HLERequestContext& ctx) {
rb.Push(RESULT_SUCCESS);
}
ERR_F::ERR_F() : ServiceFramework("err:f", 1) {
ERR_F::ERR_F(Core::System& system) : ServiceFramework("err:f", 1), system(system) {
static const FunctionInfo functions[] = {
{0x00010800, &ERR_F::ThrowFatalError, "ThrowFatalError"},
{0x00020042, nullptr, "SetUserString"},
@@ -242,8 +242,8 @@ ERR_F::ERR_F() : ServiceFramework("err:f", 1) {
ERR_F::~ERR_F() = default;
void InstallInterfaces() {
auto errf = std::make_shared<ERR_F>();
void InstallInterfaces(Core::System& system) {
auto errf = std::make_shared<ERR_F>(system);
errf->InstallAsNamedPort();
}