mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-10-31 11:40:52 +00:00
[hle] constexpr handler dispatch maps, introduce version gating (#4480)
This PR primarily focuses on upbringing constexpr maps for handlers. Each time an HLE object of a service is construed, it registers it's own handlers, over and over. Regardless of whetever it needs them at the moment or not. Additionally we don't require to keep track of different function pointers amongst each object. This can be done by overriding the given function instead, as opposed to having a separate hash map for every given object. In other words: Remove handlers (and handlers_tipc) map for every instance then read from a static defined per-class. - [x] Migrate all HLE functions to new `frozen::map` constexpr time finder - [ ] Measure if this approach actually makes better codegen Optional: - [x] Properly gate all functions (that have versions commented next to them) - [x] Maybe store `HandlerFnP<>` and `const char*` separately, version gating can go in a different map as well Information such as name can be used on debug builds, but doesn't particularly help on release as one can consult an external reference (or have an annotated IPC map) Signed-off-by: lizzie <lizzie@eden-emu.dev> - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Co-authored-by: Maufeat <sahyno1996@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4480 Reviewed-by: Maufeat <sahyno1996@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
This commit is contained in:
@@ -8,181 +8,22 @@
|
||||
|
||||
namespace Service::SPL {
|
||||
|
||||
SPL::SPL(Core::System& system_, std::shared_ptr<Module> module_)
|
||||
: Interface(system_, std::move(module_), "spl:") {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &SPL::GetConfig, "GetConfig"},
|
||||
{1, &SPL::ModularExponentiate, "ModularExponentiate"},
|
||||
{5, &SPL::SetConfig, "SetConfig"},
|
||||
{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"},
|
||||
{11, &SPL::IsDevelopment, "IsDevelopment"},
|
||||
{24, &SPL::SetBootReason, "SetBootReason"},
|
||||
{25, &SPL::GetBootReason, "GetBootReason"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
SPL::SPL(Core::System& system_, std::shared_ptr<Module> module_) : Interface(system_, std::move(module_), "spl:") {}
|
||||
SPL::~SPL() = default;
|
||||
|
||||
SPL_MIG::SPL_MIG(Core::System& system_, std::shared_ptr<Module> module_)
|
||||
: Interface(system_, std::move(module_), "spl:mig") {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &SPL::GetConfig, "GetConfig"},
|
||||
{1, &SPL::ModularExponentiate, "ModularExponentiate"},
|
||||
{2, &SPL::GenerateAesKek, "GenerateAesKek"},
|
||||
{3, nullptr, "LoadAesKey"},
|
||||
{4, &SPL::GenerateAesKey, "GenerateAesKey"},
|
||||
{5, &SPL::SetConfig, "SetConfig"},
|
||||
{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"},
|
||||
{11, &SPL::IsDevelopment, "IsDevelopment"},
|
||||
{14, nullptr, "DecryptAesKey"},
|
||||
{15, nullptr, "CryptAesCtr"},
|
||||
{16, nullptr, "ComputeCmac"},
|
||||
{21, nullptr, "AllocateAesKeyslot"},
|
||||
{22, nullptr, "DeallocateAesKeySlot"},
|
||||
{23, nullptr, "GetAesKeyslotAvailableEvent"},
|
||||
{24, &SPL::SetBootReason, "SetBootReason"},
|
||||
{25, &SPL::GetBootReason, "GetBootReason"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
SPL_MIG::SPL_MIG(Core::System& system_, std::shared_ptr<Module> module_) : Interface(system_, std::move(module_), "spl:mig") {}
|
||||
SPL_MIG::~SPL_MIG() = default;
|
||||
|
||||
SPL_FS::SPL_FS(Core::System& system_, std::shared_ptr<Module> module_)
|
||||
: Interface(system_, std::move(module_), "spl:fs") {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &SPL::GetConfig, "GetConfig"},
|
||||
{1, &SPL::ModularExponentiate, "ModularExponentiate"},
|
||||
{2, nullptr, "GenerateAesKek"},
|
||||
{3, nullptr, "LoadAesKey"},
|
||||
{4, nullptr, "GenerateAesKey"},
|
||||
{5, &SPL::SetConfig, "SetConfig"},
|
||||
{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"},
|
||||
{9, nullptr, "ImportLotusKey"},
|
||||
{10, nullptr, "DecryptLotusMessage"},
|
||||
{11, &SPL::IsDevelopment, "IsDevelopment"},
|
||||
{12, nullptr, "GenerateSpecificAesKey"},
|
||||
{14, nullptr, "DecryptAesKey"},
|
||||
{15, nullptr, "CryptAesCtr"},
|
||||
{16, nullptr, "ComputeCmac"},
|
||||
{19, nullptr, "LoadTitleKey"},
|
||||
{21, nullptr, "AllocateAesKeyslot"},
|
||||
{22, nullptr, "DeallocateAesKeySlot"},
|
||||
{23, nullptr, "GetAesKeyslotAvailableEvent"},
|
||||
{24, &SPL::SetBootReason, "SetBootReason"},
|
||||
{25, &SPL::GetBootReason, "GetBootReason"},
|
||||
{31, nullptr, "GetPackage2Hash"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
SPL_FS::SPL_FS(Core::System& system_, std::shared_ptr<Module> module_) : Interface(system_, std::move(module_), "spl:fs") {}
|
||||
SPL_FS::~SPL_FS() = default;
|
||||
|
||||
SPL_SSL::SPL_SSL(Core::System& system_, std::shared_ptr<Module> module_)
|
||||
: Interface(system_, std::move(module_), "spl:ssl") {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &SPL::GetConfig, "GetConfig"},
|
||||
{1, &SPL::ModularExponentiate, "ModularExponentiate"},
|
||||
{2, nullptr, "GenerateAesKek"},
|
||||
{3, nullptr, "LoadAesKey"},
|
||||
{4, nullptr, "GenerateAesKey"},
|
||||
{5, &SPL::SetConfig, "SetConfig"},
|
||||
{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"},
|
||||
{11, &SPL::IsDevelopment, "IsDevelopment"},
|
||||
{13, nullptr, "DecryptDeviceUniqueData"},
|
||||
{14, nullptr, "DecryptAesKey"},
|
||||
{15, nullptr, "CryptAesCtr"},
|
||||
{16, nullptr, "ComputeCmac"},
|
||||
{21, nullptr, "AllocateAesKeyslot"},
|
||||
{22, nullptr, "DeallocateAesKeySlot"},
|
||||
{23, nullptr, "GetAesKeyslotAvailableEvent"},
|
||||
{24, &SPL::SetBootReason, "SetBootReason"},
|
||||
{25, &SPL::GetBootReason, "GetBootReason"},
|
||||
{26, nullptr, "DecryptAndStoreSslClientCertKey"},
|
||||
{27, nullptr, "ModularExponentiateWithSslClientCertKey"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
SPL_SSL::SPL_SSL(Core::System& system_, std::shared_ptr<Module> module_) : Interface(system_, std::move(module_), "spl:ssl") {}
|
||||
SPL_SSL::~SPL_SSL() = default;
|
||||
|
||||
SPL_ES::SPL_ES(Core::System& system_, std::shared_ptr<Module> module_)
|
||||
: Interface(system_, std::move(module_), "spl:es") {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &SPL::GetConfig, "GetConfig"},
|
||||
{1, &SPL::ModularExponentiate, "ModularExponentiate"},
|
||||
{2, nullptr, "GenerateAesKek"},
|
||||
{3, nullptr, "LoadAesKey"},
|
||||
{4, nullptr, "GenerateAesKey"},
|
||||
{5, &SPL::SetConfig, "SetConfig"},
|
||||
{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"},
|
||||
{11, &SPL::IsDevelopment, "IsDevelopment"},
|
||||
{13, nullptr, "DecryptDeviceUniqueData"},
|
||||
{14, nullptr, "DecryptAesKey"},
|
||||
{15, nullptr, "CryptAesCtr"},
|
||||
{16, nullptr, "ComputeCmac"},
|
||||
{17, nullptr, "ImportEsKey"},
|
||||
{18, nullptr, "UnwrapTitleKey"},
|
||||
{20, nullptr, "PrepareEsCommonKey"},
|
||||
{21, nullptr, "AllocateAesKeyslot"},
|
||||
{22, nullptr, "DeallocateAesKeySlot"},
|
||||
{23, nullptr, "GetAesKeyslotAvailableEvent"},
|
||||
{24, &SPL::SetBootReason, "SetBootReason"},
|
||||
{25, &SPL::GetBootReason, "GetBootReason"},
|
||||
{28, nullptr, "DecryptAndStoreDrmDeviceCertKey"},
|
||||
{29, nullptr, "ModularExponentiateWithDrmDeviceCertKey"},
|
||||
{31, nullptr, "PrepareEsArchiveKey"},
|
||||
{32, nullptr, "LoadPreparedAesKey"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
SPL_ES::SPL_ES(Core::System& system_, std::shared_ptr<Module> module_) : Interface(system_, std::move(module_), "spl:es") {}
|
||||
SPL_ES::~SPL_ES() = default;
|
||||
|
||||
SPL_MANU::SPL_MANU(Core::System& system_, std::shared_ptr<Module> module_)
|
||||
: Interface(system_, std::move(module_), "spl:manu") {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &SPL::GetConfig, "GetConfig"},
|
||||
{1, &SPL::ModularExponentiate, "ModularExponentiate"},
|
||||
{2, nullptr, "GenerateAesKek"},
|
||||
{3, nullptr, "LoadAesKey"},
|
||||
{4, nullptr, "GenerateAesKey"},
|
||||
{5, &SPL::SetConfig, "SetConfig"},
|
||||
{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"},
|
||||
{11, &SPL::IsDevelopment, "IsDevelopment"},
|
||||
{13, nullptr, "DecryptDeviceUniqueData"},
|
||||
{14, nullptr, "DecryptAesKey"},
|
||||
{15, nullptr, "CryptAesCtr"},
|
||||
{16, nullptr, "ComputeCmac"},
|
||||
{21, nullptr, "AllocateAesKeyslot"},
|
||||
{22, nullptr, "DeallocateAesKeySlot"},
|
||||
{23, nullptr, "GetAesKeyslotAvailableEvent"},
|
||||
{24, &SPL::SetBootReason, "SetBootReason"},
|
||||
{25, &SPL::GetBootReason, "GetBootReason"},
|
||||
{30, nullptr, "ReencryptDeviceUniqueData"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
SPL_MANU::SPL_MANU(Core::System& system_, std::shared_ptr<Module> module_) : Interface(system_, std::move(module_), "spl:manu") {}
|
||||
SPL_MANU::~SPL_MANU() = default;
|
||||
|
||||
} // namespace Service::SPL
|
||||
|
||||
@@ -18,36 +18,177 @@ class SPL final : public Module::Interface {
|
||||
public:
|
||||
explicit SPL(Core::System& system_, std::shared_ptr<Module> module_);
|
||||
~SPL() override;
|
||||
|
||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, &SPL::GetConfig, "GetConfig"},
|
||||
FunctionInfo{1, &SPL::ModularExponentiate, "ModularExponentiate"},
|
||||
FunctionInfo{5, &SPL::SetConfig, "SetConfig"},
|
||||
FunctionInfo{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"},
|
||||
FunctionInfo{11, &SPL::IsDevelopment, "IsDevelopment"},
|
||||
FunctionInfo{24, &SPL::SetBootReason, "SetBootReason"},
|
||||
FunctionInfo{25, &SPL::GetBootReason, "GetBootReason"}
|
||||
);
|
||||
};
|
||||
|
||||
class SPL_MIG final : public Module::Interface {
|
||||
public:
|
||||
explicit SPL_MIG(Core::System& system_, std::shared_ptr<Module> module_);
|
||||
~SPL_MIG() override;
|
||||
|
||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, &SPL::GetConfig, "GetConfig"},
|
||||
FunctionInfo{1, &SPL::ModularExponentiate, "ModularExponentiate"},
|
||||
FunctionInfo{2, &SPL::GenerateAesKek, "GenerateAesKek"},
|
||||
FunctionInfo{3, nullptr, "LoadAesKey"},
|
||||
FunctionInfo{4, &SPL::GenerateAesKey, "GenerateAesKey"},
|
||||
FunctionInfo{5, &SPL::SetConfig, "SetConfig"},
|
||||
FunctionInfo{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"},
|
||||
FunctionInfo{11, &SPL::IsDevelopment, "IsDevelopment"},
|
||||
FunctionInfo{14, nullptr, "DecryptAesKey"},
|
||||
FunctionInfo{15, nullptr, "CryptAesCtr"},
|
||||
FunctionInfo{16, nullptr, "ComputeCmac"},
|
||||
FunctionInfo{21, nullptr, "AllocateAesKeyslot"},
|
||||
FunctionInfo{22, nullptr, "DeallocateAesKeySlot"},
|
||||
FunctionInfo{23, nullptr, "GetAesKeyslotAvailableEvent"},
|
||||
FunctionInfo{24, &SPL::SetBootReason, "SetBootReason"},
|
||||
FunctionInfo{25, &SPL::GetBootReason, "GetBootReason"}
|
||||
);
|
||||
};
|
||||
|
||||
class SPL_FS final : public Module::Interface {
|
||||
public:
|
||||
explicit SPL_FS(Core::System& system_, std::shared_ptr<Module> module_);
|
||||
~SPL_FS() override;
|
||||
|
||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, &SPL::GetConfig, "GetConfig"},
|
||||
FunctionInfo{1, &SPL::ModularExponentiate, "ModularExponentiate"},
|
||||
FunctionInfo{2, nullptr, "GenerateAesKek"},
|
||||
FunctionInfo{3, nullptr, "LoadAesKey"},
|
||||
FunctionInfo{4, nullptr, "GenerateAesKey"},
|
||||
FunctionInfo{5, &SPL::SetConfig, "SetConfig"},
|
||||
FunctionInfo{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"},
|
||||
FunctionInfo{9, nullptr, "ImportLotusKey"},
|
||||
FunctionInfo{10, nullptr, "DecryptLotusMessage"},
|
||||
FunctionInfo{11, &SPL::IsDevelopment, "IsDevelopment"},
|
||||
FunctionInfo{12, nullptr, "GenerateSpecificAesKey"},
|
||||
FunctionInfo{14, nullptr, "DecryptAesKey"},
|
||||
FunctionInfo{15, nullptr, "CryptAesCtr"},
|
||||
FunctionInfo{16, nullptr, "ComputeCmac"},
|
||||
FunctionInfo{19, nullptr, "LoadTitleKey"},
|
||||
FunctionInfo{21, nullptr, "AllocateAesKeyslot"},
|
||||
FunctionInfo{22, nullptr, "DeallocateAesKeySlot"},
|
||||
FunctionInfo{23, nullptr, "GetAesKeyslotAvailableEvent"},
|
||||
FunctionInfo{24, &SPL::SetBootReason, "SetBootReason"},
|
||||
FunctionInfo{25, &SPL::GetBootReason, "GetBootReason"},
|
||||
FunctionInfo{31, nullptr, "GetPackage2Hash"}
|
||||
);
|
||||
};
|
||||
|
||||
class SPL_SSL final : public Module::Interface {
|
||||
public:
|
||||
explicit SPL_SSL(Core::System& system_, std::shared_ptr<Module> module_);
|
||||
~SPL_SSL() override;
|
||||
|
||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, &SPL::GetConfig, "GetConfig"},
|
||||
FunctionInfo{1, &SPL::ModularExponentiate, "ModularExponentiate"},
|
||||
FunctionInfo{2, nullptr, "GenerateAesKek"},
|
||||
FunctionInfo{3, nullptr, "LoadAesKey"},
|
||||
FunctionInfo{4, nullptr, "GenerateAesKey"},
|
||||
FunctionInfo{5, &SPL::SetConfig, "SetConfig"},
|
||||
FunctionInfo{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"},
|
||||
FunctionInfo{11, &SPL::IsDevelopment, "IsDevelopment"},
|
||||
FunctionInfo{13, nullptr, "DecryptDeviceUniqueData"},
|
||||
FunctionInfo{14, nullptr, "DecryptAesKey"},
|
||||
FunctionInfo{15, nullptr, "CryptAesCtr"},
|
||||
FunctionInfo{16, nullptr, "ComputeCmac"},
|
||||
FunctionInfo{21, nullptr, "AllocateAesKeyslot"},
|
||||
FunctionInfo{22, nullptr, "DeallocateAesKeySlot"},
|
||||
FunctionInfo{23, nullptr, "GetAesKeyslotAvailableEvent"},
|
||||
FunctionInfo{24, &SPL::SetBootReason, "SetBootReason"},
|
||||
FunctionInfo{25, &SPL::GetBootReason, "GetBootReason"},
|
||||
FunctionInfo{26, nullptr, "DecryptAndStoreSslClientCertKey"},
|
||||
FunctionInfo{27, nullptr, "ModularExponentiateWithSslClientCertKey"}
|
||||
);
|
||||
};
|
||||
|
||||
class SPL_ES final : public Module::Interface {
|
||||
public:
|
||||
explicit SPL_ES(Core::System& system_, std::shared_ptr<Module> module_);
|
||||
~SPL_ES() override;
|
||||
|
||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, &SPL::GetConfig, "GetConfig"},
|
||||
FunctionInfo{1, &SPL::ModularExponentiate, "ModularExponentiate"},
|
||||
FunctionInfo{2, nullptr, "GenerateAesKek"},
|
||||
FunctionInfo{3, nullptr, "LoadAesKey"},
|
||||
FunctionInfo{4, nullptr, "GenerateAesKey"},
|
||||
FunctionInfo{5, &SPL::SetConfig, "SetConfig"},
|
||||
FunctionInfo{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"},
|
||||
FunctionInfo{11, &SPL::IsDevelopment, "IsDevelopment"},
|
||||
FunctionInfo{13, nullptr, "DecryptDeviceUniqueData"},
|
||||
FunctionInfo{14, nullptr, "DecryptAesKey"},
|
||||
FunctionInfo{15, nullptr, "CryptAesCtr"},
|
||||
FunctionInfo{16, nullptr, "ComputeCmac"},
|
||||
FunctionInfo{17, nullptr, "ImportEsKey"},
|
||||
FunctionInfo{18, nullptr, "UnwrapTitleKey"},
|
||||
FunctionInfo{20, nullptr, "PrepareEsCommonKey"},
|
||||
FunctionInfo{21, nullptr, "AllocateAesKeyslot"},
|
||||
FunctionInfo{22, nullptr, "DeallocateAesKeySlot"},
|
||||
FunctionInfo{23, nullptr, "GetAesKeyslotAvailableEvent"},
|
||||
FunctionInfo{24, &SPL::SetBootReason, "SetBootReason"},
|
||||
FunctionInfo{25, &SPL::GetBootReason, "GetBootReason"},
|
||||
FunctionInfo{28, nullptr, "DecryptAndStoreDrmDeviceCertKey"},
|
||||
FunctionInfo{29, nullptr, "ModularExponentiateWithDrmDeviceCertKey"},
|
||||
FunctionInfo{31, nullptr, "PrepareEsArchiveKey"},
|
||||
FunctionInfo{32, nullptr, "LoadPreparedAesKey"}
|
||||
);
|
||||
};
|
||||
|
||||
class SPL_MANU final : public Module::Interface {
|
||||
public:
|
||||
explicit SPL_MANU(Core::System& system_, std::shared_ptr<Module> module_);
|
||||
~SPL_MANU() override;
|
||||
|
||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, &SPL::GetConfig, "GetConfig"},
|
||||
FunctionInfo{1, &SPL::ModularExponentiate, "ModularExponentiate"},
|
||||
FunctionInfo{2, nullptr, "GenerateAesKek"},
|
||||
FunctionInfo{3, nullptr, "LoadAesKey"},
|
||||
FunctionInfo{4, nullptr, "GenerateAesKey"},
|
||||
FunctionInfo{5, &SPL::SetConfig, "SetConfig"},
|
||||
FunctionInfo{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"},
|
||||
FunctionInfo{11, &SPL::IsDevelopment, "IsDevelopment"},
|
||||
FunctionInfo{13, nullptr, "DecryptDeviceUniqueData"},
|
||||
FunctionInfo{14, nullptr, "DecryptAesKey"},
|
||||
FunctionInfo{15, nullptr, "CryptAesCtr"},
|
||||
FunctionInfo{16, nullptr, "ComputeCmac"},
|
||||
FunctionInfo{21, nullptr, "AllocateAesKeyslot"},
|
||||
FunctionInfo{22, nullptr, "DeallocateAesKeySlot"},
|
||||
FunctionInfo{23, nullptr, "GetAesKeyslotAvailableEvent"},
|
||||
FunctionInfo{24, &SPL::SetBootReason, "SetBootReason"},
|
||||
FunctionInfo{25, &SPL::GetBootReason, "GetBootReason"},
|
||||
FunctionInfo{30, nullptr, "ReencryptDeviceUniqueData"}
|
||||
);
|
||||
};
|
||||
|
||||
} // namespace Service::SPL
|
||||
|
||||
@@ -204,14 +204,15 @@ Result Module::Interface::GetConfigImpl(u64* out_config, ConfigItem config_item)
|
||||
|
||||
class CSRNG final : public Module::Interface {
|
||||
public:
|
||||
explicit CSRNG(Core::System& system_, std::shared_ptr<Module> module_)
|
||||
: Interface(system_, std::move(module_), "csrng") {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &CSRNG::GenerateRandomBytes, "GenerateRandomBytes"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
explicit CSRNG(Core::System& system_, std::shared_ptr<Module> module_) : Interface(system_, std::move(module_), "csrng") {}
|
||||
~CSRNG() override = default;
|
||||
|
||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, &CSRNG::GenerateRandomBytes, "GenerateRandomBytes"}
|
||||
);
|
||||
};
|
||||
|
||||
void LoopProcess(Core::System& system) {
|
||||
|
||||
Reference in New Issue
Block a user