sf: Change interface definition methodology (#1074)

* sf: Begin experimenting with new interface declaration format

* sf: convert fs interfaces to new format

* sf: finish conversion of libstrat to new definitions

* sf: convert loader to new format

* sf: convert spl to new format

* sf: update ncm for new format

* sf: convert pm to new format

* sf: convert ro/sm to new format

* sf: update fatal for new format

* sf: support building dmnt under new scheme

* sf: update ams.mitm for new format

* sf: correct invocation def for pointer holder

* fs: correct 10.x+ user bindings for Get*SpaceSize
This commit is contained in:
SciresM 2020-07-07 17:07:23 -07:00 committed by GitHub
parent 94eb2195d3
commit 9fde97cfdd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
190 changed files with 3220 additions and 3172 deletions

View file

@ -18,76 +18,17 @@
namespace ams::spl {
class GeneralService : public sf::IServiceObject {
protected:
enum class CommandId {
/* 1.0.0+ */
GetConfig = 0,
ExpMod = 1,
GenerateAesKek = 2,
LoadAesKey = 3,
GenerateAesKey = 4,
SetConfig = 5,
GenerateRandomBytes = 7,
ImportLotusKeyDeprecated = 9,
ImportLotusKey = 9,
DecryptLotusMessage = 10,
IsDevelopment = 11,
GenerateSpecificAesKey = 12,
DecryptRsaPrivateKeyDeprecated = 13,
DecryptRsaPrivateKey = 13,
DecryptAesKey = 14,
CryptAesCtr = 15,
ComputeCmac = 16,
ImportEsKeyDeprecated = 17,
ImportEsKey = 17,
UnwrapTitleKey = 18,
LoadTitleKey = 19,
/* 2.0.0+ */
UnwrapCommonTitleKey = 20,
AllocateAesKeyslot = 21,
FreeAesKeyslot = 22,
GetAesKeyslotAvailableEvent = 23,
/* 3.0.0+ */
SetBootReason = 24,
GetBootReason = 25,
/* 5.0.0+ */
ImportSslKey = 26,
SslExpMod = 27,
ImportDrmKey = 28,
DrmExpMod = 29,
ReEncryptRsaPrivateKey = 30,
GetPackage2Hash = 31,
/* 6.0.0+ */
UnwrapElicenseKey = 31, /* re-used command id :( */
LoadElicenseKey = 32,
};
class GeneralService {
public:
GeneralService() { /* ... */ }
virtual ~GeneralService() { /* ... */ }
protected:
/* Actual commands. */
virtual Result GetConfig(sf::Out<u64> out, u32 which);
virtual Result ExpMod(const sf::OutPointerBuffer &out, const sf::InPointerBuffer &base, const sf::InPointerBuffer &exp, const sf::InPointerBuffer &mod);
virtual Result SetConfig(u32 which, u64 value);
virtual Result GenerateRandomBytes(const sf::OutPointerBuffer &out);
virtual Result IsDevelopment(sf::Out<bool> is_dev);
virtual Result SetBootReason(BootReasonValue boot_reason);
virtual Result GetBootReason(sf::Out<BootReasonValue> out);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MAKE_SERVICE_COMMAND_META(GetConfig),
MAKE_SERVICE_COMMAND_META(ExpMod),
MAKE_SERVICE_COMMAND_META(SetConfig),
MAKE_SERVICE_COMMAND_META(GenerateRandomBytes),
MAKE_SERVICE_COMMAND_META(IsDevelopment),
MAKE_SERVICE_COMMAND_META(SetBootReason, hos::Version_3_0_0),
MAKE_SERVICE_COMMAND_META(GetBootReason, hos::Version_3_0_0),
};
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);
};
static_assert(spl::impl::IsIGeneralInterface<GeneralService>);
}