diff options
author | Liam <byteslice@airmail.cc> | 2023-07-15 02:16:39 +0200 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-08-08 17:09:37 +0200 |
commit | 84cb20bc72031947ac9e625b4a2b5e0059dda441 (patch) | |
tree | 94e816691b3800153f7955b03ae63cc36dfdb9dc /src/core/hle/service/spl | |
parent | Merge pull request #11216 from lat9nq/no-mesa-astc (diff) | |
download | yuzu-84cb20bc72031947ac9e625b4a2b5e0059dda441.tar yuzu-84cb20bc72031947ac9e625b4a2b5e0059dda441.tar.gz yuzu-84cb20bc72031947ac9e625b4a2b5e0059dda441.tar.bz2 yuzu-84cb20bc72031947ac9e625b4a2b5e0059dda441.tar.lz yuzu-84cb20bc72031947ac9e625b4a2b5e0059dda441.tar.xz yuzu-84cb20bc72031947ac9e625b4a2b5e0059dda441.tar.zst yuzu-84cb20bc72031947ac9e625b4a2b5e0059dda441.zip |
Diffstat (limited to 'src/core/hle/service/spl')
-rw-r--r-- | src/core/hle/service/spl/spl_module.cpp | 48 | ||||
-rw-r--r-- | src/core/hle/service/spl/spl_module.h | 2 |
2 files changed, 30 insertions, 20 deletions
diff --git a/src/core/hle/service/spl/spl_module.cpp b/src/core/hle/service/spl/spl_module.cpp index cd631b2ea..549e6f4fa 100644 --- a/src/core/hle/service/spl/spl_module.cpp +++ b/src/core/hle/service/spl/spl_module.cpp @@ -30,10 +30,10 @@ void Module::Interface::GetConfig(HLERequestContext& ctx) { // This should call svcCallSecureMonitor with the appropriate args. // Since we do not have it implemented yet, we will use this for now. - const auto smc_result = GetConfigImpl(config_item); - const auto result_code = smc_result.Code(); + u64 smc_result{}; + const auto result_code = GetConfigImpl(&smc_result, config_item); - if (smc_result.Failed()) { + if (result_code != ResultSuccess) { LOG_ERROR(Service_SPL, "called, config_item={}, result_code={}", config_item, result_code.raw); @@ -42,11 +42,11 @@ void Module::Interface::GetConfig(HLERequestContext& ctx) { } LOG_DEBUG(Service_SPL, "called, config_item={}, result_code={}, smc_result={}", config_item, - result_code.raw, *smc_result); + result_code.raw, smc_result); IPC::ResponseBuilder rb{ctx, 4}; rb.Push(result_code); - rb.Push(*smc_result); + rb.Push(smc_result); } void Module::Interface::ModularExponentiate(HLERequestContext& ctx) { @@ -99,7 +99,7 @@ void Module::Interface::GetBootReason(HLERequestContext& ctx) { rb.Push(ResultSecureMonitorNotImplemented); } -ResultVal<u64> Module::Interface::GetConfigImpl(ConfigItem config_item) const { +Result Module::Interface::GetConfigImpl(u64* out_config, ConfigItem config_item) const { switch (config_item) { case ConfigItem::DisableProgramVerification: case ConfigItem::DramId: @@ -121,40 +121,50 @@ ResultVal<u64> Module::Interface::GetConfigImpl(ConfigItem config_item) const { return ResultSecureMonitorNotImplemented; case ConfigItem::ExosphereApiVersion: // Get information about the current exosphere version. - return (u64{HLE::ApiVersion::ATMOSPHERE_RELEASE_VERSION_MAJOR} << 56) | - (u64{HLE::ApiVersion::ATMOSPHERE_RELEASE_VERSION_MINOR} << 48) | - (u64{HLE::ApiVersion::ATMOSPHERE_RELEASE_VERSION_MICRO} << 40) | - (static_cast<u64>(HLE::ApiVersion::GetTargetFirmware())); + *out_config = (u64{HLE::ApiVersion::ATMOSPHERE_RELEASE_VERSION_MAJOR} << 56) | + (u64{HLE::ApiVersion::ATMOSPHERE_RELEASE_VERSION_MINOR} << 48) | + (u64{HLE::ApiVersion::ATMOSPHERE_RELEASE_VERSION_MICRO} << 40) | + (static_cast<u64>(HLE::ApiVersion::GetTargetFirmware())); + return ResultSuccess; case ConfigItem::ExosphereNeedsReboot: // We are executing, so we aren't in the process of rebooting. - return u64{0}; + *out_config = u64{0}; + return ResultSuccess; case ConfigItem::ExosphereNeedsShutdown: // We are executing, so we aren't in the process of shutting down. - return u64{0}; + *out_config = u64{0}; + return ResultSuccess; case ConfigItem::ExosphereGitCommitHash: // Get information about the current exosphere git commit hash. - return u64{0}; + *out_config = u64{0}; + return ResultSuccess; case ConfigItem::ExosphereHasRcmBugPatch: // Get information about whether this unit has the RCM bug patched. - return u64{0}; + *out_config = u64{0}; + return ResultSuccess; case ConfigItem::ExosphereBlankProdInfo: // Get whether this unit should simulate a "blanked" PRODINFO. - return u64{0}; + *out_config = u64{0}; + return ResultSuccess; case ConfigItem::ExosphereAllowCalWrites: // Get whether this unit should allow writing to the calibration partition. - return u64{0}; + *out_config = u64{0}; + return ResultSuccess; case ConfigItem::ExosphereEmummcType: // Get what kind of emummc this unit has active. - return u64{0}; + *out_config = u64{0}; + return ResultSuccess; case ConfigItem::ExospherePayloadAddress: // Gets the physical address of the reboot payload buffer, if one exists. return ResultSecureMonitorNotInitialized; case ConfigItem::ExosphereLogConfiguration: // Get the log configuration. - return u64{0}; + *out_config = u64{0}; + return ResultSuccess; case ConfigItem::ExosphereForceEnableUsb30: // Get whether usb 3.0 should be force-enabled. - return u64{0}; + *out_config = u64{0}; + return ResultSuccess; default: return ResultSecureMonitorInvalidArgument; } diff --git a/src/core/hle/service/spl/spl_module.h b/src/core/hle/service/spl/spl_module.h index e074e115d..06dcffa6c 100644 --- a/src/core/hle/service/spl/spl_module.h +++ b/src/core/hle/service/spl/spl_module.h @@ -35,7 +35,7 @@ public: std::shared_ptr<Module> module; private: - ResultVal<u64> GetConfigImpl(ConfigItem config_item) const; + Result GetConfigImpl(u64* out_config, ConfigItem config_item) const; std::mt19937 rng; }; |