summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar zkitx2021-03-11 02:36:48 -0500
committerGravatar zkitx2021-03-11 02:36:48 -0500
commitad653550ebf9515c522d9c36f1409c440c427e8d (patch)
tree2d81444bf8fe377f5af023f5ebbfc07ad8454205 /src
parentMerge pull request #5891 from ameerj/bgra-ogl (diff)
downloadyuzu-ad653550ebf9515c522d9c36f1409c440c427e8d.tar.gz
yuzu-ad653550ebf9515c522d9c36f1409c440c427e8d.tar.xz
yuzu-ad653550ebf9515c522d9c36f1409c440c427e8d.zip
Update SPL to fit N's service refactor (4.0.0+) which split into new services.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/spl/module.cpp5
-rw-r--r--src/core/hle/service/spl/spl.cpp152
-rw-r--r--src/core/hle/service/spl/spl.h30
3 files changed, 178 insertions, 9 deletions
diff --git a/src/core/hle/service/spl/module.cpp b/src/core/hle/service/spl/module.cpp
index dea6b0fe0..6903dd534 100644
--- a/src/core/hle/service/spl/module.cpp
+++ b/src/core/hle/service/spl/module.cpp
@@ -43,6 +43,11 @@ void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system
43 auto module = std::make_shared<Module>(); 43 auto module = std::make_shared<Module>();
44 std::make_shared<CSRNG>(system, module)->InstallAsService(service_manager); 44 std::make_shared<CSRNG>(system, module)->InstallAsService(service_manager);
45 std::make_shared<SPL>(system, module)->InstallAsService(service_manager); 45 std::make_shared<SPL>(system, module)->InstallAsService(service_manager);
46 std::make_shared<SPL_MIG>(system, module)->InstallAsService(service_manager);
47 std::make_shared<SPL_FS>(system, module)->InstallAsService(service_manager);
48 std::make_shared<SPL_SSL>(system, module)->InstallAsService(service_manager);
49 std::make_shared<SPL_ES>(system, module)->InstallAsService(service_manager);
50 std::make_shared<SPL_MANU>(system, module)->InstallAsService(service_manager);
46} 51}
47 52
48} // namespace Service::SPL 53} // namespace Service::SPL
diff --git a/src/core/hle/service/spl/spl.cpp b/src/core/hle/service/spl/spl.cpp
index 3fabc2c79..e18690554 100644
--- a/src/core/hle/service/spl/spl.cpp
+++ b/src/core/hle/service/spl/spl.cpp
@@ -8,6 +8,24 @@ namespace Service::SPL {
8 8
9SPL::SPL(Core::System& system_, std::shared_ptr<Module> module_) 9SPL::SPL(Core::System& system_, std::shared_ptr<Module> module_)
10 : Interface(system_, std::move(module_), "spl:") { 10 : Interface(system_, std::move(module_), "spl:") {
11 // clang-format off
12 static const FunctionInfo functions[] = {
13 {0, nullptr, "GetConfig"},
14 {1, nullptr, "ModularExponentiate"},
15 {5, nullptr, "SetConfig"},
16 {7, &SPL::GetRandomBytes, "GetRandomBytes"},
17 {11, nullptr, "IsDevelopment"},
18 {24, nullptr, "SetBootReason"},
19 {25, nullptr, "GetBootReason"},
20 };
21 // clang-format on
22
23 RegisterHandlers(functions);
24}
25
26SPL_MIG::SPL_MIG(Core::System& system_, std::shared_ptr<Module> module_)
27 : Interface(system_, std::move(module_), "spl:mig") {
28 // clang-format off
11 static const FunctionInfo functions[] = { 29 static const FunctionInfo functions[] = {
12 {0, nullptr, "GetConfig"}, 30 {0, nullptr, "GetConfig"},
13 {1, nullptr, "ModularExponentiate"}, 31 {1, nullptr, "ModularExponentiate"},
@@ -15,19 +33,67 @@ SPL::SPL(Core::System& system_, std::shared_ptr<Module> module_)
15 {3, nullptr, "LoadAesKey"}, 33 {3, nullptr, "LoadAesKey"},
16 {4, nullptr, "GenerateAesKey"}, 34 {4, nullptr, "GenerateAesKey"},
17 {5, nullptr, "SetConfig"}, 35 {5, nullptr, "SetConfig"},
18 {7, &SPL::GetRandomBytes, "GetRandomBytes"}, 36 {7, &SPL::GetRandomBytes, "GenerateRandomBytes"},
19 {9, nullptr, "ImportLotusKey"}, 37 {11, nullptr, "IsDevelopment"},
20 {10, nullptr, "DecryptLotusMessage"}, 38 {14, nullptr, "DecryptAesKey"},
39 {15, nullptr, "CryptAesCtr"},
40 {16, nullptr, "ComputeCmac"},
41 {21, nullptr, "AllocateAesKeyslot"},
42 {22, nullptr, "DeallocateAesKeyslot"},
43 {23, nullptr, "GetAesKeyslotAvailableEvent"},
44 {24, nullptr, "SetBootReason"},
45 {25, nullptr, "GetBootReason"},
46 };
47 // clang-format on
48
49 RegisterHandlers(functions);
50}
51
52SPL_FS::SPL_FS(Core::System& system_, std::shared_ptr<Module> module_)
53 : Interface(system_, std::move(module_), "spl:fs") {
54 // clang-format off
55 static const FunctionInfo functions[] = {
56 {0, nullptr, "GetConfig"},
57 {1, nullptr, "ModularExponentiate"},
58 {2, nullptr, "GenerateAesKek"},
59 {3, nullptr, "LoadAesKey"},
60 {4, nullptr, "GenerateAesKey"},
61 {5, nullptr, "SetConfig"},
62 {7, &SPL::GetRandomBytes, "GenerateRandomBytes"},
21 {11, nullptr, "IsDevelopment"}, 63 {11, nullptr, "IsDevelopment"},
22 {12, nullptr, "GenerateSpecificAesKey"}, 64 {12, nullptr, "GenerateSpecificAesKey"},
23 {13, nullptr, "DecryptDeviceUniqueData"},
24 {14, nullptr, "DecryptAesKey"}, 65 {14, nullptr, "DecryptAesKey"},
25 {15, nullptr, "CryptAesCtr"}, 66 {15, nullptr, "CryptAesCtr"},
26 {16, nullptr, "ComputeCmac"}, 67 {16, nullptr, "ComputeCmac"},
27 {17, nullptr, "ImportEsKey"},
28 {18, nullptr, "UnwrapTitleKey"},
29 {19, nullptr, "LoadTitleKey"}, 68 {19, nullptr, "LoadTitleKey"},
30 {20, nullptr, "PrepareEsCommonKey"}, 69 {21, nullptr, "AllocateAesKeyslot"},
70 {22, nullptr, "DeallocateAesKeyslot"},
71 {23, nullptr, "GetAesKeyslotAvailableEvent"},
72 {24, nullptr, "SetBootReason"},
73 {25, nullptr, "GetBootReason"},
74 {31, nullptr, "GetPackage2Hash"},
75 };
76 // clang-format on
77
78 RegisterHandlers(functions);
79}
80
81SPL_SSL::SPL_SSL(Core::System& system_, std::shared_ptr<Module> module_)
82 : Interface(system_, std::move(module_), "spl:ssl") {
83 // clang-format off
84 static const FunctionInfo functions[] = {
85 {0, nullptr, "GetConfig"},
86 {1, nullptr, "ModularExponentiate"},
87 {2, nullptr, "GenerateAesKek"},
88 {3, nullptr, "LoadAesKey"},
89 {4, nullptr, "GenerateAesKey"},
90 {5, nullptr, "SetConfig"},
91 {7, &SPL::GetRandomBytes, "GetRandomBytes"},
92 {11, nullptr, "IsDevelopment"},
93 {13, nullptr, "DecryptDeviceUniqueData"},
94 {14, nullptr, "DecryptAesKey"},
95 {15, nullptr, "CryptAesCtr"},
96 {16, nullptr, "ComputeCmac"},
31 {21, nullptr, "AllocateAesKeyslot"}, 97 {21, nullptr, "AllocateAesKeyslot"},
32 {22, nullptr, "DeallocateAesKeySlot"}, 98 {22, nullptr, "DeallocateAesKeySlot"},
33 {23, nullptr, "GetAesKeyslotAvailableEvent"}, 99 {23, nullptr, "GetAesKeyslotAvailableEvent"},
@@ -35,15 +101,83 @@ SPL::SPL(Core::System& system_, std::shared_ptr<Module> module_)
35 {25, nullptr, "GetBootReason"}, 101 {25, nullptr, "GetBootReason"},
36 {26, nullptr, "DecryptAndStoreSslClientCertKey"}, 102 {26, nullptr, "DecryptAndStoreSslClientCertKey"},
37 {27, nullptr, "ModularExponentiateWithSslClientCertKey"}, 103 {27, nullptr, "ModularExponentiateWithSslClientCertKey"},
104 };
105 // clang-format on
106
107 RegisterHandlers(functions);
108}
109
110SPL_ES::SPL_ES(Core::System& system_, std::shared_ptr<Module> module_)
111 : Interface(system_, std::move(module_), "spl:es") {
112 // clang-format off
113 static const FunctionInfo functions[] = {
114 {0, nullptr, "GetConfig"},
115 {1, nullptr, "ModularExponentiate"},
116 {2, nullptr, "GenerateAesKek"},
117 {3, nullptr, "LoadAesKey"},
118 {4, nullptr, "GenerateAesKey"},
119 {5, nullptr, "SetConfig"},
120 {7, &SPL::GetRandomBytes, "GenerateRandomBytes"},
121 {11, nullptr, "IsDevelopment"},
122 {13, nullptr, "DecryptDeviceUniqueData"},
123 {14, nullptr, "DecryptAesKey"},
124 {15, nullptr, "CryptAesCtr"},
125 {16, nullptr, "ComputeCmac"},
126 {18, nullptr, "UnwrapTitleKey"},
127 {20, nullptr, "PrepareEsCommonKey"},
128 {21, nullptr, "AllocateAesKeyslot"},
129 {22, nullptr, "DeallocateAesKeyslot"},
130 {23, nullptr, "GetAesKeyslotAvailableEvent"},
131 {24, nullptr, "SetBootReason"},
132 {25, nullptr, "GetBootReason"},
38 {28, nullptr, "DecryptAndStoreDrmDeviceCertKey"}, 133 {28, nullptr, "DecryptAndStoreDrmDeviceCertKey"},
39 {29, nullptr, "ModularExponentiateWithDrmDeviceCertKey"}, 134 {29, nullptr, "ModularExponentiateWithDrmDeviceCertKey"},
40 {30, nullptr, "ReencryptDeviceUniqueData "}, 135 {31, nullptr, "PrepareEsArchiveKey"},
41 {31, nullptr, "PrepareEsArchiveKey"}, // This is also GetPackage2Hash?
42 {32, nullptr, "LoadPreparedAesKey"}, 136 {32, nullptr, "LoadPreparedAesKey"},
43 }; 137 };
138 // clang-format on
139
140 RegisterHandlers(functions);
141}
142
143SPL_MANU::SPL_MANU(Core::System& system_, std::shared_ptr<Module> module_)
144 : Interface(system_, std::move(module_), "spl:manu") {
145 // clang-format off
146 static const FunctionInfo functions[] = {
147 {0, nullptr, "GetConfig"},
148 {1, nullptr, "ModularExponentiate"},
149 {2, nullptr, "GenerateAesKek"},
150 {3, nullptr, "LoadAesKey"},
151 {4, nullptr, "GenerateAesKey"},
152 {5, nullptr, "SetConfig"},
153 {7, &SPL::GetRandomBytes, "GetRandomBytes"},
154 {11, nullptr, "IsDevelopment"},
155 {13, nullptr, "DecryptDeviceUniqueData"},
156 {14, nullptr, "DecryptAesKey"},
157 {15, nullptr, "CryptAesCtr"},
158 {16, nullptr, "ComputeCmac"},
159 {21, nullptr, "AllocateAesKeyslot"},
160 {22, nullptr, "DeallocateAesKeySlot"},
161 {23, nullptr, "GetAesKeyslotAvailableEvent"},
162 {24, nullptr, "SetBootReason"},
163 {25, nullptr, "GetBootReason"},
164 {30, nullptr, "ReencryptDeviceUniqueData"},
165 };
166 // clang-format on
167
44 RegisterHandlers(functions); 168 RegisterHandlers(functions);
45} 169}
46 170
47SPL::~SPL() = default; 171SPL::~SPL() = default;
48 172
173SPL_MIG::~SPL_MIG() = default;
174
175SPL_FS::~SPL_FS() = default;
176
177SPL_SSL::~SPL_SSL() = default;
178
179SPL_ES::~SPL_ES() = default;
180
181SPL_MANU::~SPL_MANU() = default;
182
49} // namespace Service::SPL 183} // namespace Service::SPL
diff --git a/src/core/hle/service/spl/spl.h b/src/core/hle/service/spl/spl.h
index d27d16b86..9b35012ed 100644
--- a/src/core/hle/service/spl/spl.h
+++ b/src/core/hle/service/spl/spl.h
@@ -18,4 +18,34 @@ public:
18 ~SPL() override; 18 ~SPL() override;
19}; 19};
20 20
21class SPL_MIG final : public Module::Interface {
22public:
23 explicit SPL_MIG(Core::System& system_, std::shared_ptr<Module> module_);
24 ~SPL_MIG() override;
25};
26
27class SPL_FS final : public Module::Interface {
28public:
29 explicit SPL_FS(Core::System& system_, std::shared_ptr<Module> module_);
30 ~SPL_FS() override;
31};
32
33class SPL_SSL final : public Module::Interface {
34public:
35 explicit SPL_SSL(Core::System& system_, std::shared_ptr<Module> module_);
36 ~SPL_SSL() override;
37};
38
39class SPL_ES final : public Module::Interface {
40public:
41 explicit SPL_ES(Core::System& system_, std::shared_ptr<Module> module_);
42 ~SPL_ES() override;
43};
44
45class SPL_MANU final : public Module::Interface {
46public:
47 explicit SPL_MANU(Core::System& system_, std::shared_ptr<Module> module_);
48 ~SPL_MANU() override;
49};
50
21} // namespace Service::SPL 51} // namespace Service::SPL