summaryrefslogtreecommitdiff
path: root/src/core/hle/service/glue
diff options
context:
space:
mode:
authorGravatar Liam2023-03-06 19:04:12 -0500
committerGravatar Liam2023-03-06 20:58:42 -0500
commit1d0fe75e7cca27d79006654dcc56c44cb4096d3a (patch)
tree3291e0ad973cd3c0e07ded22c968f40c2c6dd955 /src/core/hle/service/glue
parentMerge pull request #9890 from Kelebek1/reverb_fix (diff)
downloadyuzu-1d0fe75e7cca27d79006654dcc56c44cb4096d3a.tar.gz
yuzu-1d0fe75e7cca27d79006654dcc56c44cb4096d3a.tar.xz
yuzu-1d0fe75e7cca27d79006654dcc56c44cb4096d3a.zip
hle: rename legacy errors to Results
Diffstat (limited to 'src/core/hle/service/glue')
-rw-r--r--src/core/hle/service/glue/arp.cpp18
-rw-r--r--src/core/hle/service/glue/errors.h7
-rw-r--r--src/core/hle/service/glue/glue_manager.cpp16
-rw-r--r--src/core/hle/service/glue/glue_manager.h16
4 files changed, 28 insertions, 29 deletions
diff --git a/src/core/hle/service/glue/arp.cpp b/src/core/hle/service/glue/arp.cpp
index 9db136bac..929dcca0d 100644
--- a/src/core/hle/service/glue/arp.cpp
+++ b/src/core/hle/service/glue/arp.cpp
@@ -61,7 +61,7 @@ void ARP_R::GetApplicationLaunchProperty(HLERequestContext& ctx) {
61 if (!title_id.has_value()) { 61 if (!title_id.has_value()) {
62 LOG_ERROR(Service_ARP, "Failed to get title ID for process ID!"); 62 LOG_ERROR(Service_ARP, "Failed to get title ID for process ID!");
63 IPC::ResponseBuilder rb{ctx, 2}; 63 IPC::ResponseBuilder rb{ctx, 2};
64 rb.Push(ERR_NOT_REGISTERED); 64 rb.Push(Glue::ResultProcessIdNotRegistered);
65 return; 65 return;
66 } 66 }
67 67
@@ -109,7 +109,7 @@ void ARP_R::GetApplicationControlProperty(HLERequestContext& ctx) {
109 if (!title_id.has_value()) { 109 if (!title_id.has_value()) {
110 LOG_ERROR(Service_ARP, "Failed to get title ID for process ID!"); 110 LOG_ERROR(Service_ARP, "Failed to get title ID for process ID!");
111 IPC::ResponseBuilder rb{ctx, 2}; 111 IPC::ResponseBuilder rb{ctx, 2};
112 rb.Push(ERR_NOT_REGISTERED); 112 rb.Push(Glue::ResultProcessIdNotRegistered);
113 return; 113 return;
114 } 114 }
115 115
@@ -178,7 +178,7 @@ private:
178 if (process_id == 0) { 178 if (process_id == 0) {
179 LOG_ERROR(Service_ARP, "Must have non-zero process ID!"); 179 LOG_ERROR(Service_ARP, "Must have non-zero process ID!");
180 IPC::ResponseBuilder rb{ctx, 2}; 180 IPC::ResponseBuilder rb{ctx, 2};
181 rb.Push(ERR_INVALID_PROCESS_ID); 181 rb.Push(Glue::ResultInvalidProcessId);
182 return; 182 return;
183 } 183 }
184 184
@@ -186,7 +186,7 @@ private:
186 LOG_ERROR(Service_ARP, 186 LOG_ERROR(Service_ARP,
187 "Attempted to issue registrar, but registrar is already issued!"); 187 "Attempted to issue registrar, but registrar is already issued!");
188 IPC::ResponseBuilder rb{ctx, 2}; 188 IPC::ResponseBuilder rb{ctx, 2};
189 rb.Push(ERR_INVALID_ACCESS); 189 rb.Push(Glue::ResultAlreadyBound);
190 return; 190 return;
191 } 191 }
192 192
@@ -205,7 +205,7 @@ private:
205 Service_ARP, 205 Service_ARP,
206 "Attempted to set application launch property, but registrar is already issued!"); 206 "Attempted to set application launch property, but registrar is already issued!");
207 IPC::ResponseBuilder rb{ctx, 2}; 207 IPC::ResponseBuilder rb{ctx, 2};
208 rb.Push(ERR_INVALID_ACCESS); 208 rb.Push(Glue::ResultAlreadyBound);
209 return; 209 return;
210 } 210 }
211 211
@@ -224,7 +224,7 @@ private:
224 Service_ARP, 224 Service_ARP,
225 "Attempted to set application control property, but registrar is already issued!"); 225 "Attempted to set application control property, but registrar is already issued!");
226 IPC::ResponseBuilder rb{ctx, 2}; 226 IPC::ResponseBuilder rb{ctx, 2};
227 rb.Push(ERR_INVALID_ACCESS); 227 rb.Push(Glue::ResultAlreadyBound);
228 return; 228 return;
229 } 229 }
230 230
@@ -263,7 +263,7 @@ void ARP_W::AcquireRegistrar(HLERequestContext& ctx) {
263 system, [this](u64 process_id, ApplicationLaunchProperty launch, std::vector<u8> control) { 263 system, [this](u64 process_id, ApplicationLaunchProperty launch, std::vector<u8> control) {
264 const auto res = GetTitleIDForProcessID(system, process_id); 264 const auto res = GetTitleIDForProcessID(system, process_id);
265 if (!res.has_value()) { 265 if (!res.has_value()) {
266 return ERR_NOT_REGISTERED; 266 return Glue::ResultProcessIdNotRegistered;
267 } 267 }
268 268
269 return manager.Register(*res, launch, std::move(control)); 269 return manager.Register(*res, launch, std::move(control));
@@ -283,7 +283,7 @@ void ARP_W::UnregisterApplicationInstance(HLERequestContext& ctx) {
283 if (process_id == 0) { 283 if (process_id == 0) {
284 LOG_ERROR(Service_ARP, "Must have non-zero process ID!"); 284 LOG_ERROR(Service_ARP, "Must have non-zero process ID!");
285 IPC::ResponseBuilder rb{ctx, 2}; 285 IPC::ResponseBuilder rb{ctx, 2};
286 rb.Push(ERR_INVALID_PROCESS_ID); 286 rb.Push(Glue::ResultInvalidProcessId);
287 return; 287 return;
288 } 288 }
289 289
@@ -292,7 +292,7 @@ void ARP_W::UnregisterApplicationInstance(HLERequestContext& ctx) {
292 if (!title_id.has_value()) { 292 if (!title_id.has_value()) {
293 LOG_ERROR(Service_ARP, "No title ID for process ID!"); 293 LOG_ERROR(Service_ARP, "No title ID for process ID!");
294 IPC::ResponseBuilder rb{ctx, 2}; 294 IPC::ResponseBuilder rb{ctx, 2};
295 rb.Push(ERR_NOT_REGISTERED); 295 rb.Push(Glue::ResultProcessIdNotRegistered);
296 return; 296 return;
297 } 297 }
298 298
diff --git a/src/core/hle/service/glue/errors.h b/src/core/hle/service/glue/errors.h
index d4ce7f44e..30feaa5c0 100644
--- a/src/core/hle/service/glue/errors.h
+++ b/src/core/hle/service/glue/errors.h
@@ -7,9 +7,8 @@
7 7
8namespace Service::Glue { 8namespace Service::Glue {
9 9
10constexpr Result ERR_INVALID_RESOURCE{ErrorModule::ARP, 30}; 10constexpr Result ResultInvalidProcessId{ErrorModule::ARP, 31};
11constexpr Result ERR_INVALID_PROCESS_ID{ErrorModule::ARP, 31}; 11constexpr Result ResultAlreadyBound{ErrorModule::ARP, 42};
12constexpr Result ERR_INVALID_ACCESS{ErrorModule::ARP, 42}; 12constexpr Result ResultProcessIdNotRegistered{ErrorModule::ARP, 102};
13constexpr Result ERR_NOT_REGISTERED{ErrorModule::ARP, 102};
14 13
15} // namespace Service::Glue 14} // namespace Service::Glue
diff --git a/src/core/hle/service/glue/glue_manager.cpp b/src/core/hle/service/glue/glue_manager.cpp
index 8a654cdca..4bf67921b 100644
--- a/src/core/hle/service/glue/glue_manager.cpp
+++ b/src/core/hle/service/glue/glue_manager.cpp
@@ -17,12 +17,12 @@ ARPManager::~ARPManager() = default;
17 17
18ResultVal<ApplicationLaunchProperty> ARPManager::GetLaunchProperty(u64 title_id) const { 18ResultVal<ApplicationLaunchProperty> ARPManager::GetLaunchProperty(u64 title_id) const {
19 if (title_id == 0) { 19 if (title_id == 0) {
20 return ERR_INVALID_PROCESS_ID; 20 return Glue::ResultInvalidProcessId;
21 } 21 }
22 22
23 const auto iter = entries.find(title_id); 23 const auto iter = entries.find(title_id);
24 if (iter == entries.end()) { 24 if (iter == entries.end()) {
25 return ERR_NOT_REGISTERED; 25 return Glue::ResultProcessIdNotRegistered;
26 } 26 }
27 27
28 return iter->second.launch; 28 return iter->second.launch;
@@ -30,12 +30,12 @@ ResultVal<ApplicationLaunchProperty> ARPManager::GetLaunchProperty(u64 title_id)
30 30
31ResultVal<std::vector<u8>> ARPManager::GetControlProperty(u64 title_id) const { 31ResultVal<std::vector<u8>> ARPManager::GetControlProperty(u64 title_id) const {
32 if (title_id == 0) { 32 if (title_id == 0) {
33 return ERR_INVALID_PROCESS_ID; 33 return Glue::ResultInvalidProcessId;
34 } 34 }
35 35
36 const auto iter = entries.find(title_id); 36 const auto iter = entries.find(title_id);
37 if (iter == entries.end()) { 37 if (iter == entries.end()) {
38 return ERR_NOT_REGISTERED; 38 return Glue::ResultProcessIdNotRegistered;
39 } 39 }
40 40
41 return iter->second.control; 41 return iter->second.control;
@@ -44,12 +44,12 @@ ResultVal<std::vector<u8>> ARPManager::GetControlProperty(u64 title_id) const {
44Result ARPManager::Register(u64 title_id, ApplicationLaunchProperty launch, 44Result ARPManager::Register(u64 title_id, ApplicationLaunchProperty launch,
45 std::vector<u8> control) { 45 std::vector<u8> control) {
46 if (title_id == 0) { 46 if (title_id == 0) {
47 return ERR_INVALID_PROCESS_ID; 47 return Glue::ResultInvalidProcessId;
48 } 48 }
49 49
50 const auto iter = entries.find(title_id); 50 const auto iter = entries.find(title_id);
51 if (iter != entries.end()) { 51 if (iter != entries.end()) {
52 return ERR_INVALID_ACCESS; 52 return Glue::ResultAlreadyBound;
53 } 53 }
54 54
55 entries.insert_or_assign(title_id, MapEntry{launch, std::move(control)}); 55 entries.insert_or_assign(title_id, MapEntry{launch, std::move(control)});
@@ -58,12 +58,12 @@ Result ARPManager::Register(u64 title_id, ApplicationLaunchProperty launch,
58 58
59Result ARPManager::Unregister(u64 title_id) { 59Result ARPManager::Unregister(u64 title_id) {
60 if (title_id == 0) { 60 if (title_id == 0) {
61 return ERR_INVALID_PROCESS_ID; 61 return Glue::ResultInvalidProcessId;
62 } 62 }
63 63
64 const auto iter = entries.find(title_id); 64 const auto iter = entries.find(title_id);
65 if (iter == entries.end()) { 65 if (iter == entries.end()) {
66 return ERR_NOT_REGISTERED; 66 return Glue::ResultProcessIdNotRegistered;
67 } 67 }
68 68
69 entries.erase(iter); 69 entries.erase(iter);
diff --git a/src/core/hle/service/glue/glue_manager.h b/src/core/hle/service/glue/glue_manager.h
index cd0b092ac..1cf53d9d9 100644
--- a/src/core/hle/service/glue/glue_manager.h
+++ b/src/core/hle/service/glue/glue_manager.h
@@ -30,23 +30,23 @@ public:
30 ~ARPManager(); 30 ~ARPManager();
31 31
32 // Returns the ApplicationLaunchProperty corresponding to the provided title ID if it was 32 // Returns the ApplicationLaunchProperty corresponding to the provided title ID if it was
33 // previously registered, otherwise ERR_NOT_REGISTERED if it was never registered or 33 // previously registered, otherwise ResultProcessIdNotRegistered if it was never registered or
34 // ERR_INVALID_PROCESS_ID if the title ID is 0. 34 // ResultInvalidProcessId if the title ID is 0.
35 ResultVal<ApplicationLaunchProperty> GetLaunchProperty(u64 title_id) const; 35 ResultVal<ApplicationLaunchProperty> GetLaunchProperty(u64 title_id) const;
36 36
37 // Returns a vector of the raw bytes of NACP data (necessarily 0x4000 in size) corresponding to 37 // Returns a vector of the raw bytes of NACP data (necessarily 0x4000 in size) corresponding to
38 // the provided title ID if it was previously registered, otherwise ERR_NOT_REGISTERED if it was 38 // the provided title ID if it was previously registered, otherwise ResultProcessIdNotRegistered
39 // never registered or ERR_INVALID_PROCESS_ID if the title ID is 0. 39 // if it was never registered or ResultInvalidProcessId if the title ID is 0.
40 ResultVal<std::vector<u8>> GetControlProperty(u64 title_id) const; 40 ResultVal<std::vector<u8>> GetControlProperty(u64 title_id) const;
41 41
42 // Adds a new entry to the internal database with the provided parameters, returning 42 // Adds a new entry to the internal database with the provided parameters, returning
43 // ERR_INVALID_ACCESS if attempting to re-register a title ID without an intermediate Unregister 43 // ResultProcessIdNotRegistered if attempting to re-register a title ID without an intermediate
44 // step, and ERR_INVALID_PROCESS_ID if the title ID is 0. 44 // Unregister step, and ResultInvalidProcessId if the title ID is 0.
45 Result Register(u64 title_id, ApplicationLaunchProperty launch, std::vector<u8> control); 45 Result Register(u64 title_id, ApplicationLaunchProperty launch, std::vector<u8> control);
46 46
47 // Removes the registration for the provided title ID from the database, returning 47 // Removes the registration for the provided title ID from the database, returning
48 // ERR_NOT_REGISTERED if it doesn't exist in the database and ERR_INVALID_PROCESS_ID if the 48 // ResultProcessIdNotRegistered if it doesn't exist in the database and ResultInvalidProcessId
49 // title ID is 0. 49 // if the title ID is 0.
50 Result Unregister(u64 title_id); 50 Result Unregister(u64 title_id);
51 51
52 // Removes all entries from the database, always succeeds. Should only be used when resetting 52 // Removes all entries from the database, always succeeds. Should only be used when resetting