mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-31 14:58:22 -04:00
spl: refactor for accuracy/move into libstrat
This commit is contained in:
parent
4758dfa933
commit
d8a36e39f2
40 changed files with 1898 additions and 1732 deletions
|
@ -15,19 +15,44 @@
|
|||
*/
|
||||
#pragma once
|
||||
#include <stratosphere.hpp>
|
||||
#include "spl_secure_monitor_manager.hpp"
|
||||
|
||||
namespace ams::spl {
|
||||
|
||||
class GeneralService {
|
||||
protected:
|
||||
SecureMonitorManager &m_manager;
|
||||
public:
|
||||
explicit GeneralService(SecureMonitorManager *manager) : m_manager(*manager) { /* ... */ }
|
||||
public:
|
||||
/* Actual commands. */
|
||||
Result GetConfig(sf::Out<u64> out, u32 which);
|
||||
Result ModularExponentiate(const sf::OutPointerBuffer &out, const sf::InPointerBuffer &base, const sf::InPointerBuffer &exp, const sf::InPointerBuffer &mod);
|
||||
Result SetConfig(u32 which, u64 value);
|
||||
Result GenerateRandomBytes(const sf::OutPointerBuffer &out);
|
||||
Result IsDevelopment(sf::Out<bool> is_dev);
|
||||
Result SetBootReason(BootReasonValue boot_reason);
|
||||
Result GetBootReason(sf::Out<BootReasonValue> out);
|
||||
Result GetConfig(sf::Out<u64> out, u32 key) {
|
||||
return m_manager.GetConfig(out.GetPointer(), static_cast<spl::ConfigItem>(key));
|
||||
}
|
||||
|
||||
Result ModularExponentiate(const sf::OutPointerBuffer &out, const sf::InPointerBuffer &base, const sf::InPointerBuffer &exp, const sf::InPointerBuffer &mod) {
|
||||
return m_manager.ModularExponentiate(out.GetPointer(), out.GetSize(), base.GetPointer(), base.GetSize(), exp.GetPointer(), exp.GetSize(), mod.GetPointer(), mod.GetSize());
|
||||
}
|
||||
|
||||
Result SetConfig(u32 key, u64 value) {
|
||||
return m_manager.SetConfig(static_cast<spl::ConfigItem>(key), value);
|
||||
}
|
||||
|
||||
Result GenerateRandomBytes(const sf::OutPointerBuffer &out) {
|
||||
return m_manager.GenerateRandomBytes(out.GetPointer(), out.GetSize());
|
||||
}
|
||||
|
||||
Result IsDevelopment(sf::Out<bool> is_dev) {
|
||||
return m_manager.IsDevelopment(is_dev.GetPointer());
|
||||
}
|
||||
|
||||
Result SetBootReason(BootReasonValue boot_reason) {
|
||||
return m_manager.SetBootReason(boot_reason);
|
||||
}
|
||||
|
||||
Result GetBootReason(sf::Out<BootReasonValue> out) {
|
||||
return m_manager.GetBootReason(out.GetPointer());
|
||||
}
|
||||
};
|
||||
static_assert(spl::impl::IsIGeneralInterface<GeneralService>);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue