summaryrefslogtreecommitdiff
path: root/src/core
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
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')
-rw-r--r--src/core/CMakeLists.txt1
-rw-r--r--src/core/hle/kernel/k_process.h4
-rw-r--r--src/core/hle/service/acc/acc.cpp26
-rw-r--r--src/core/hle/service/acc/errors.h10
-rw-r--r--src/core/hle/service/am/am.cpp20
-rw-r--r--src/core/hle/service/am/applets/applet_controller.cpp7
-rw-r--r--src/core/hle/service/am/applets/applet_profile_select.cpp7
-rw-r--r--src/core/hle/service/audio/audren_u.cpp6
-rw-r--r--src/core/hle/service/audio/errors.h24
-rw-r--r--src/core/hle/service/friend/errors.h11
-rw-r--r--src/core/hle/service/friend/friend.cpp4
-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
-rw-r--r--src/core/hle/service/ipc_helpers.h2
-rw-r--r--src/core/hle/service/ns/errors.h5
-rw-r--r--src/core/hle/service/ns/ns.cpp8
-rw-r--r--src/core/hle/service/server_manager.cpp2
-rw-r--r--src/core/hle/service/service.cpp2
-rw-r--r--src/core/hle/service/set/set.cpp4
-rw-r--r--src/core/hle/service/sm/sm.cpp24
22 files changed, 105 insertions, 119 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 4a1a8bb43..75e0c4f38 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -454,7 +454,6 @@ add_library(core STATIC
454 hle/service/filesystem/fsp_srv.h 454 hle/service/filesystem/fsp_srv.h
455 hle/service/fgm/fgm.cpp 455 hle/service/fgm/fgm.cpp
456 hle/service/fgm/fgm.h 456 hle/service/fgm/fgm.h
457 hle/service/friend/errors.h
458 hle/service/friend/friend.cpp 457 hle/service/friend/friend.cpp
459 hle/service/friend/friend.h 458 hle/service/friend/friend.h
460 hle/service/friend/friend_interface.cpp 459 hle/service/friend/friend_interface.cpp
diff --git a/src/core/hle/kernel/k_process.h b/src/core/hle/kernel/k_process.h
index 09bf2f1d0..549809000 100644
--- a/src/core/hle/kernel/k_process.h
+++ b/src/core/hle/kernel/k_process.h
@@ -310,10 +310,10 @@ public:
310 /// Clears the signaled state of the process if and only if it's signaled. 310 /// Clears the signaled state of the process if and only if it's signaled.
311 /// 311 ///
312 /// @pre The process must not be already terminated. If this is called on a 312 /// @pre The process must not be already terminated. If this is called on a
313 /// terminated process, then ERR_INVALID_STATE will be returned. 313 /// terminated process, then ResultInvalidState will be returned.
314 /// 314 ///
315 /// @pre The process must be in a signaled state. If this is called on a 315 /// @pre The process must be in a signaled state. If this is called on a
316 /// process instance that is not signaled, ERR_INVALID_STATE will be 316 /// process instance that is not signaled, ResultInvalidState will be
317 /// returned. 317 /// returned.
318 Result Reset(); 318 Result Reset();
319 319
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp
index ddc3a6dbe..120282aa4 100644
--- a/src/core/hle/service/acc/acc.cpp
+++ b/src/core/hle/service/acc/acc.cpp
@@ -30,12 +30,6 @@
30 30
31namespace Service::Account { 31namespace Service::Account {
32 32
33constexpr Result ERR_INVALID_USER_ID{ErrorModule::Account, 20};
34constexpr Result ERR_INVALID_APPLICATION_ID{ErrorModule::Account, 22};
35constexpr Result ERR_INVALID_BUFFER{ErrorModule::Account, 30};
36constexpr Result ERR_INVALID_BUFFER_SIZE{ErrorModule::Account, 31};
37constexpr Result ERR_FAILED_SAVE_DATA{ErrorModule::Account, 100};
38
39// Thumbnails are hard coded to be at least this size 33// Thumbnails are hard coded to be at least this size
40constexpr std::size_t THUMBNAIL_SIZE = 0x24000; 34constexpr std::size_t THUMBNAIL_SIZE = 0x24000;
41 35
@@ -384,7 +378,7 @@ protected:
384 if (user_data.size() < sizeof(UserData)) { 378 if (user_data.size() < sizeof(UserData)) {
385 LOG_ERROR(Service_ACC, "UserData buffer too small!"); 379 LOG_ERROR(Service_ACC, "UserData buffer too small!");
386 IPC::ResponseBuilder rb{ctx, 2}; 380 IPC::ResponseBuilder rb{ctx, 2};
387 rb.Push(ERR_INVALID_BUFFER); 381 rb.Push(Account::ResultInvalidArrayLength);
388 return; 382 return;
389 } 383 }
390 384
@@ -394,7 +388,7 @@ protected:
394 if (!profile_manager.SetProfileBaseAndData(user_id, base, data)) { 388 if (!profile_manager.SetProfileBaseAndData(user_id, base, data)) {
395 LOG_ERROR(Service_ACC, "Failed to update user data and base!"); 389 LOG_ERROR(Service_ACC, "Failed to update user data and base!");
396 IPC::ResponseBuilder rb{ctx, 2}; 390 IPC::ResponseBuilder rb{ctx, 2};
397 rb.Push(ERR_FAILED_SAVE_DATA); 391 rb.Push(Account::ResultAccountUpdateFailed);
398 return; 392 return;
399 } 393 }
400 394
@@ -417,7 +411,7 @@ protected:
417 if (user_data.size() < sizeof(UserData)) { 411 if (user_data.size() < sizeof(UserData)) {
418 LOG_ERROR(Service_ACC, "UserData buffer too small!"); 412 LOG_ERROR(Service_ACC, "UserData buffer too small!");
419 IPC::ResponseBuilder rb{ctx, 2}; 413 IPC::ResponseBuilder rb{ctx, 2};
420 rb.Push(ERR_INVALID_BUFFER); 414 rb.Push(Account::ResultInvalidArrayLength);
421 return; 415 return;
422 } 416 }
423 417
@@ -432,7 +426,7 @@ protected:
432 !profile_manager.SetProfileBaseAndData(user_id, base, data)) { 426 !profile_manager.SetProfileBaseAndData(user_id, base, data)) {
433 LOG_ERROR(Service_ACC, "Failed to update profile data, base, and image!"); 427 LOG_ERROR(Service_ACC, "Failed to update profile data, base, and image!");
434 IPC::ResponseBuilder rb{ctx, 2}; 428 IPC::ResponseBuilder rb{ctx, 2};
435 rb.Push(ERR_FAILED_SAVE_DATA); 429 rb.Push(Account::ResultAccountUpdateFailed);
436 return; 430 return;
437 } 431 }
438 432
@@ -764,7 +758,7 @@ void Module::Interface::InitializeApplicationInfoRestricted(HLERequestContext& c
764Result Module::Interface::InitializeApplicationInfoBase() { 758Result Module::Interface::InitializeApplicationInfoBase() {
765 if (application_info) { 759 if (application_info) {
766 LOG_ERROR(Service_ACC, "Application already initialized"); 760 LOG_ERROR(Service_ACC, "Application already initialized");
767 return ERR_ACCOUNTINFO_ALREADY_INITIALIZED; 761 return Account::ResultApplicationInfoAlreadyInitialized;
768 } 762 }
769 763
770 // TODO(ogniK): This should be changed to reflect the target process for when we have multiple 764 // TODO(ogniK): This should be changed to reflect the target process for when we have multiple
@@ -775,7 +769,7 @@ Result Module::Interface::InitializeApplicationInfoBase() {
775 769
776 if (launch_property.Failed()) { 770 if (launch_property.Failed()) {
777 LOG_ERROR(Service_ACC, "Failed to get launch property"); 771 LOG_ERROR(Service_ACC, "Failed to get launch property");
778 return ERR_ACCOUNTINFO_BAD_APPLICATION; 772 return Account::ResultInvalidApplication;
779 } 773 }
780 774
781 switch (launch_property->base_game_storage_id) { 775 switch (launch_property->base_game_storage_id) {
@@ -791,7 +785,7 @@ Result Module::Interface::InitializeApplicationInfoBase() {
791 default: 785 default:
792 LOG_ERROR(Service_ACC, "Invalid game storage ID! storage_id={}", 786 LOG_ERROR(Service_ACC, "Invalid game storage ID! storage_id={}",
793 launch_property->base_game_storage_id); 787 launch_property->base_game_storage_id);
794 return ERR_ACCOUNTINFO_BAD_APPLICATION; 788 return Account::ResultInvalidApplication;
795 } 789 }
796 790
797 LOG_WARNING(Service_ACC, "ApplicationInfo init required"); 791 LOG_WARNING(Service_ACC, "ApplicationInfo init required");
@@ -899,20 +893,20 @@ void Module::Interface::StoreSaveDataThumbnail(HLERequestContext& ctx, const Com
899 893
900 if (tid == 0) { 894 if (tid == 0) {
901 LOG_ERROR(Service_ACC, "TitleID is not valid!"); 895 LOG_ERROR(Service_ACC, "TitleID is not valid!");
902 rb.Push(ERR_INVALID_APPLICATION_ID); 896 rb.Push(Account::ResultInvalidApplication);
903 return; 897 return;
904 } 898 }
905 899
906 if (uuid.IsInvalid()) { 900 if (uuid.IsInvalid()) {
907 LOG_ERROR(Service_ACC, "User ID is not valid!"); 901 LOG_ERROR(Service_ACC, "User ID is not valid!");
908 rb.Push(ERR_INVALID_USER_ID); 902 rb.Push(Account::ResultInvalidUserId);
909 return; 903 return;
910 } 904 }
911 const auto thumbnail_size = ctx.GetReadBufferSize(); 905 const auto thumbnail_size = ctx.GetReadBufferSize();
912 if (thumbnail_size != THUMBNAIL_SIZE) { 906 if (thumbnail_size != THUMBNAIL_SIZE) {
913 LOG_ERROR(Service_ACC, "Buffer size is empty! size={:X} expecting {:X}", thumbnail_size, 907 LOG_ERROR(Service_ACC, "Buffer size is empty! size={:X} expecting {:X}", thumbnail_size,
914 THUMBNAIL_SIZE); 908 THUMBNAIL_SIZE);
915 rb.Push(ERR_INVALID_BUFFER_SIZE); 909 rb.Push(Account::ResultInvalidArrayLength);
916 return; 910 return;
917 } 911 }
918 912
diff --git a/src/core/hle/service/acc/errors.h b/src/core/hle/service/acc/errors.h
index e9c16b951..433ebfe9d 100644
--- a/src/core/hle/service/acc/errors.h
+++ b/src/core/hle/service/acc/errors.h
@@ -7,7 +7,13 @@
7 7
8namespace Service::Account { 8namespace Service::Account {
9 9
10constexpr Result ERR_ACCOUNTINFO_BAD_APPLICATION{ErrorModule::Account, 22}; 10constexpr Result ResultCancelledByUser{ErrorModule::Account, 1};
11constexpr Result ERR_ACCOUNTINFO_ALREADY_INITIALIZED{ErrorModule::Account, 41}; 11constexpr Result ResultNoNotifications{ErrorModule::Account, 15};
12constexpr Result ResultInvalidUserId{ErrorModule::Account, 20};
13constexpr Result ResultInvalidApplication{ErrorModule::Account, 22};
14constexpr Result ResultNullptr{ErrorModule::Account, 30};
15constexpr Result ResultInvalidArrayLength{ErrorModule::Account, 32};
16constexpr Result ResultApplicationInfoAlreadyInitialized{ErrorModule::Account, 41};
17constexpr Result ResultAccountUpdateFailed{ErrorModule::Account, 100};
12 18
13} // namespace Service::Account 19} // namespace Service::Account
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index f74c7b550..f17df5124 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -39,9 +39,9 @@
39 39
40namespace Service::AM { 40namespace Service::AM {
41 41
42constexpr Result ERR_NO_DATA_IN_CHANNEL{ErrorModule::AM, 2}; 42constexpr Result ResultNoDataInChannel{ErrorModule::AM, 2};
43constexpr Result ERR_NO_MESSAGES{ErrorModule::AM, 3}; 43constexpr Result ResultNoMessages{ErrorModule::AM, 3};
44constexpr Result ERR_SIZE_OUT_OF_BOUNDS{ErrorModule::AM, 503}; 44constexpr Result ResultInvalidOffset{ErrorModule::AM, 503};
45 45
46enum class LaunchParameterKind : u32 { 46enum class LaunchParameterKind : u32 {
47 ApplicationSpecific = 1, 47 ApplicationSpecific = 1,
@@ -758,7 +758,7 @@ void ICommonStateGetter::ReceiveMessage(HLERequestContext& ctx) {
758 758
759 if (message == AppletMessageQueue::AppletMessage::None) { 759 if (message == AppletMessageQueue::AppletMessage::None) {
760 LOG_ERROR(Service_AM, "Message queue is empty"); 760 LOG_ERROR(Service_AM, "Message queue is empty");
761 rb.Push(ERR_NO_MESSAGES); 761 rb.Push(AM::ResultNoMessages);
762 rb.PushEnum<AppletMessageQueue::AppletMessage>(message); 762 rb.PushEnum<AppletMessageQueue::AppletMessage>(message);
763 return; 763 return;
764 } 764 }
@@ -1028,7 +1028,7 @@ private:
1028 LOG_DEBUG(Service_AM, 1028 LOG_DEBUG(Service_AM,
1029 "storage is a nullptr. There is no data in the current normal channel"); 1029 "storage is a nullptr. There is no data in the current normal channel");
1030 IPC::ResponseBuilder rb{ctx, 2}; 1030 IPC::ResponseBuilder rb{ctx, 2};
1031 rb.Push(ERR_NO_DATA_IN_CHANNEL); 1031 rb.Push(AM::ResultNoDataInChannel);
1032 return; 1032 return;
1033 } 1033 }
1034 1034
@@ -1059,7 +1059,7 @@ private:
1059 LOG_DEBUG(Service_AM, 1059 LOG_DEBUG(Service_AM,
1060 "storage is a nullptr. There is no data in the current interactive channel"); 1060 "storage is a nullptr. There is no data in the current interactive channel");
1061 IPC::ResponseBuilder rb{ctx, 2}; 1061 IPC::ResponseBuilder rb{ctx, 2};
1062 rb.Push(ERR_NO_DATA_IN_CHANNEL); 1062 rb.Push(AM::ResultNoDataInChannel);
1063 return; 1063 return;
1064 } 1064 }
1065 1065
@@ -1138,7 +1138,7 @@ void IStorageAccessor::Write(HLERequestContext& ctx) {
1138 backing.GetSize(), size, offset); 1138 backing.GetSize(), size, offset);
1139 1139
1140 IPC::ResponseBuilder rb{ctx, 2}; 1140 IPC::ResponseBuilder rb{ctx, 2};
1141 rb.Push(ERR_SIZE_OUT_OF_BOUNDS); 1141 rb.Push(AM::ResultInvalidOffset);
1142 return; 1142 return;
1143 } 1143 }
1144 1144
@@ -1161,7 +1161,7 @@ void IStorageAccessor::Read(HLERequestContext& ctx) {
1161 backing.GetSize(), size, offset); 1161 backing.GetSize(), size, offset);
1162 1162
1163 IPC::ResponseBuilder rb{ctx, 2}; 1163 IPC::ResponseBuilder rb{ctx, 2};
1164 rb.Push(ERR_SIZE_OUT_OF_BOUNDS); 1164 rb.Push(AM::ResultInvalidOffset);
1165 return; 1165 return;
1166 } 1166 }
1167 1167
@@ -1502,7 +1502,7 @@ void IApplicationFunctions::PopLaunchParameter(HLERequestContext& ctx) {
1502 1502
1503 LOG_ERROR(Service_AM, "Attempted to load launch parameter but none was found!"); 1503 LOG_ERROR(Service_AM, "Attempted to load launch parameter but none was found!");
1504 IPC::ResponseBuilder rb{ctx, 2}; 1504 IPC::ResponseBuilder rb{ctx, 2};
1505 rb.Push(ERR_NO_DATA_IN_CHANNEL); 1505 rb.Push(AM::ResultNoDataInChannel);
1506} 1506}
1507 1507
1508void IApplicationFunctions::CreateApplicationAndRequestToStartForQuest(HLERequestContext& ctx) { 1508void IApplicationFunctions::CreateApplicationAndRequestToStartForQuest(HLERequestContext& ctx) {
@@ -1799,7 +1799,7 @@ void IApplicationFunctions::TryPopFromFriendInvitationStorageChannel(HLERequestC
1799 LOG_WARNING(Service_AM, "(STUBBED) called"); 1799 LOG_WARNING(Service_AM, "(STUBBED) called");
1800 1800
1801 IPC::ResponseBuilder rb{ctx, 2}; 1801 IPC::ResponseBuilder rb{ctx, 2};
1802 rb.Push(ERR_NO_DATA_IN_CHANNEL); 1802 rb.Push(AM::ResultNoDataInChannel);
1803} 1803}
1804 1804
1805void IApplicationFunctions::GetNotificationStorageChannelEvent(HLERequestContext& ctx) { 1805void IApplicationFunctions::GetNotificationStorageChannelEvent(HLERequestContext& ctx) {
diff --git a/src/core/hle/service/am/applets/applet_controller.cpp b/src/core/hle/service/am/applets/applet_controller.cpp
index b418031de..58484519b 100644
--- a/src/core/hle/service/am/applets/applet_controller.cpp
+++ b/src/core/hle/service/am/applets/applet_controller.cpp
@@ -19,10 +19,9 @@
19 19
20namespace Service::AM::Applets { 20namespace Service::AM::Applets {
21 21
22// This error code (0x183ACA) is thrown when the applet fails to initialize. 22[[maybe_unused]] constexpr Result ResultControllerSupportCanceled{ErrorModule::HID, 3101};
23[[maybe_unused]] constexpr Result ERR_CONTROLLER_APPLET_3101{ErrorModule::HID, 3101}; 23[[maybe_unused]] constexpr Result ResultControllerSupportNotSupportedNpadStyle{ErrorModule::HID,
24// This error code (0x183CCA) is thrown when the u32 result in ControllerSupportResultInfo is 2. 24 3102};
25[[maybe_unused]] constexpr Result ERR_CONTROLLER_APPLET_3102{ErrorModule::HID, 3102};
26 25
27static Core::Frontend::ControllerParameters ConvertToFrontendParameters( 26static Core::Frontend::ControllerParameters ConvertToFrontendParameters(
28 ControllerSupportArgPrivate private_arg, ControllerSupportArgHeader header, bool enable_text, 27 ControllerSupportArgPrivate private_arg, ControllerSupportArgHeader header, bool enable_text,
diff --git a/src/core/hle/service/am/applets/applet_profile_select.cpp b/src/core/hle/service/am/applets/applet_profile_select.cpp
index c738db028..1d69f5447 100644
--- a/src/core/hle/service/am/applets/applet_profile_select.cpp
+++ b/src/core/hle/service/am/applets/applet_profile_select.cpp
@@ -7,13 +7,12 @@
7#include "common/string_util.h" 7#include "common/string_util.h"
8#include "core/core.h" 8#include "core/core.h"
9#include "core/frontend/applets/profile_select.h" 9#include "core/frontend/applets/profile_select.h"
10#include "core/hle/service/acc/errors.h"
10#include "core/hle/service/am/am.h" 11#include "core/hle/service/am/am.h"
11#include "core/hle/service/am/applets/applet_profile_select.h" 12#include "core/hle/service/am/applets/applet_profile_select.h"
12 13
13namespace Service::AM::Applets { 14namespace Service::AM::Applets {
14 15
15constexpr Result ERR_USER_CANCELLED_SELECTION{ErrorModule::Account, 1};
16
17ProfileSelect::ProfileSelect(Core::System& system_, LibraryAppletMode applet_mode_, 16ProfileSelect::ProfileSelect(Core::System& system_, LibraryAppletMode applet_mode_,
18 const Core::Frontend::ProfileSelectApplet& frontend_) 17 const Core::Frontend::ProfileSelectApplet& frontend_)
19 : Applet{system_, applet_mode_}, frontend{frontend_}, system{system_} {} 18 : Applet{system_, applet_mode_}, frontend{frontend_}, system{system_} {}
@@ -63,8 +62,8 @@ void ProfileSelect::SelectionComplete(std::optional<Common::UUID> uuid) {
63 output.result = 0; 62 output.result = 0;
64 output.uuid_selected = *uuid; 63 output.uuid_selected = *uuid;
65 } else { 64 } else {
66 status = ERR_USER_CANCELLED_SELECTION; 65 status = Account::ResultCancelledByUser;
67 output.result = ERR_USER_CANCELLED_SELECTION.raw; 66 output.result = Account::ResultCancelledByUser.raw;
68 output.uuid_selected = Common::InvalidUUID; 67 output.uuid_selected = Common::InvalidUUID;
69 } 68 }
70 69
diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp
index 0a6830ffa..7086d4750 100644
--- a/src/core/hle/service/audio/audren_u.cpp
+++ b/src/core/hle/service/audio/audren_u.cpp
@@ -170,7 +170,7 @@ private:
170 170
171 if (impl->GetSystem().GetExecutionMode() == AudioCore::ExecutionMode::Manual) { 171 if (impl->GetSystem().GetExecutionMode() == AudioCore::ExecutionMode::Manual) {
172 IPC::ResponseBuilder rb{ctx, 2}; 172 IPC::ResponseBuilder rb{ctx, 2};
173 rb.Push(ERR_NOT_SUPPORTED); 173 rb.Push(Audio::ResultNotSupported);
174 return; 174 return;
175 } 175 }
176 176
@@ -448,7 +448,7 @@ void AudRenU::OpenAudioRenderer(HLERequestContext& ctx) {
448 if (impl->GetSessionCount() + 1 > AudioCore::MaxRendererSessions) { 448 if (impl->GetSessionCount() + 1 > AudioCore::MaxRendererSessions) {
449 LOG_ERROR(Service_Audio, "Too many AudioRenderer sessions open!"); 449 LOG_ERROR(Service_Audio, "Too many AudioRenderer sessions open!");
450 IPC::ResponseBuilder rb{ctx, 2}; 450 IPC::ResponseBuilder rb{ctx, 2};
451 rb.Push(ERR_MAXIMUM_SESSIONS_REACHED); 451 rb.Push(Audio::ResultOutOfSessions);
452 return; 452 return;
453 } 453 }
454 454
@@ -461,7 +461,7 @@ void AudRenU::OpenAudioRenderer(HLERequestContext& ctx) {
461 if (session_id == -1) { 461 if (session_id == -1) {
462 LOG_ERROR(Service_Audio, "Tried to open a session that's already in use!"); 462 LOG_ERROR(Service_Audio, "Tried to open a session that's already in use!");
463 IPC::ResponseBuilder rb{ctx, 2}; 463 IPC::ResponseBuilder rb{ctx, 2};
464 rb.Push(ERR_MAXIMUM_SESSIONS_REACHED); 464 rb.Push(Audio::ResultOutOfSessions);
465 return; 465 return;
466 } 466 }
467 467
diff --git a/src/core/hle/service/audio/errors.h b/src/core/hle/service/audio/errors.h
index d706978cb..3d3d3d97a 100644
--- a/src/core/hle/service/audio/errors.h
+++ b/src/core/hle/service/audio/errors.h
@@ -7,17 +7,17 @@
7 7
8namespace Service::Audio { 8namespace Service::Audio {
9 9
10constexpr Result ERR_INVALID_DEVICE_NAME{ErrorModule::Audio, 1}; 10constexpr Result ResultNotFound{ErrorModule::Audio, 1};
11constexpr Result ERR_OPERATION_FAILED{ErrorModule::Audio, 2}; 11constexpr Result ResultOperationFailed{ErrorModule::Audio, 2};
12constexpr Result ERR_INVALID_SAMPLE_RATE{ErrorModule::Audio, 3}; 12constexpr Result ResultInvalidSampleRate{ErrorModule::Audio, 3};
13constexpr Result ERR_INSUFFICIENT_BUFFER_SIZE{ErrorModule::Audio, 4}; 13constexpr Result ResultInsufficientBuffer{ErrorModule::Audio, 4};
14constexpr Result ERR_MAXIMUM_SESSIONS_REACHED{ErrorModule::Audio, 5}; 14constexpr Result ResultOutOfSessions{ErrorModule::Audio, 5};
15constexpr Result ERR_BUFFER_COUNT_EXCEEDED{ErrorModule::Audio, 8}; 15constexpr Result ResultBufferCountReached{ErrorModule::Audio, 8};
16constexpr Result ERR_INVALID_CHANNEL_COUNT{ErrorModule::Audio, 10}; 16constexpr Result ResultInvalidChannelCount{ErrorModule::Audio, 10};
17constexpr Result ERR_INVALID_UPDATE_DATA{ErrorModule::Audio, 41}; 17constexpr Result ResultInvalidUpdateInfo{ErrorModule::Audio, 41};
18constexpr Result ERR_POOL_MAPPING_FAILED{ErrorModule::Audio, 42}; 18constexpr Result ResultInvalidAddressInfo{ErrorModule::Audio, 42};
19constexpr Result ERR_NOT_SUPPORTED{ErrorModule::Audio, 513}; 19constexpr Result ResultNotSupported{ErrorModule::Audio, 513};
20constexpr Result ERR_INVALID_PROCESS_HANDLE{ErrorModule::Audio, 1536}; 20constexpr Result ResultInvalidHandle{ErrorModule::Audio, 1536};
21constexpr Result ERR_INVALID_REVISION{ErrorModule::Audio, 1537}; 21constexpr Result ResultInvalidRevision{ErrorModule::Audio, 1537};
22 22
23} // namespace Service::Audio 23} // namespace Service::Audio
diff --git a/src/core/hle/service/friend/errors.h b/src/core/hle/service/friend/errors.h
deleted file mode 100644
index ff525d865..000000000
--- a/src/core/hle/service/friend/errors.h
+++ /dev/null
@@ -1,11 +0,0 @@
1// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#include "core/hle/result.h"
7
8namespace Service::Friend {
9
10constexpr Result ERR_NO_NOTIFICATIONS{ErrorModule::Account, 15};
11}
diff --git a/src/core/hle/service/friend/friend.cpp b/src/core/hle/service/friend/friend.cpp
index 447deab8b..9d05f9801 100644
--- a/src/core/hle/service/friend/friend.cpp
+++ b/src/core/hle/service/friend/friend.cpp
@@ -6,7 +6,7 @@
6#include "common/uuid.h" 6#include "common/uuid.h"
7#include "core/core.h" 7#include "core/core.h"
8#include "core/hle/kernel/k_event.h" 8#include "core/hle/kernel/k_event.h"
9#include "core/hle/service/friend/errors.h" 9#include "core/hle/service/acc/errors.h"
10#include "core/hle/service/friend/friend.h" 10#include "core/hle/service/friend/friend.h"
11#include "core/hle/service/friend/friend_interface.h" 11#include "core/hle/service/friend/friend_interface.h"
12#include "core/hle/service/ipc_helpers.h" 12#include "core/hle/service/ipc_helpers.h"
@@ -259,7 +259,7 @@ private:
259 if (notifications.empty()) { 259 if (notifications.empty()) {
260 LOG_ERROR(Service_Friend, "No notifications in queue!"); 260 LOG_ERROR(Service_Friend, "No notifications in queue!");
261 IPC::ResponseBuilder rb{ctx, 2}; 261 IPC::ResponseBuilder rb{ctx, 2};
262 rb.Push(ERR_NO_NOTIFICATIONS); 262 rb.Push(Account::ResultNoNotifications);
263 return; 263 return;
264 } 264 }
265 265
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
diff --git a/src/core/hle/service/ipc_helpers.h b/src/core/hle/service/ipc_helpers.h
index 3e67123c7..8703b57ca 100644
--- a/src/core/hle/service/ipc_helpers.h
+++ b/src/core/hle/service/ipc_helpers.h
@@ -19,7 +19,7 @@
19 19
20namespace IPC { 20namespace IPC {
21 21
22constexpr Result ERR_REMOTE_PROCESS_DEAD{ErrorModule::HIPC, 301}; 22constexpr Result ResultSessionClosed{ErrorModule::HIPC, 301};
23 23
24class RequestHelperBase { 24class RequestHelperBase {
25protected: 25protected:
diff --git a/src/core/hle/service/ns/errors.h b/src/core/hle/service/ns/errors.h
index 8a7621798..16d2ea6f7 100644
--- a/src/core/hle/service/ns/errors.h
+++ b/src/core/hle/service/ns/errors.h
@@ -7,5 +7,6 @@
7 7
8namespace Service::NS { 8namespace Service::NS {
9 9
10constexpr Result ERR_APPLICATION_LANGUAGE_NOT_FOUND{ErrorModule::NS, 300}; 10constexpr Result ResultApplicationLanguageNotFound{ErrorModule::NS, 300};
11} \ No newline at end of file 11
12}
diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cpp
index d6f0faea2..376067a95 100644
--- a/src/core/hle/service/ns/ns.cpp
+++ b/src/core/hle/service/ns/ns.cpp
@@ -416,14 +416,14 @@ ResultVal<u8> IApplicationManagerInterface::GetApplicationDesiredLanguage(
416 if (application_language == std::nullopt) { 416 if (application_language == std::nullopt) {
417 LOG_ERROR(Service_NS, "Could not convert application language! language_code={}", 417 LOG_ERROR(Service_NS, "Could not convert application language! language_code={}",
418 language_code); 418 language_code);
419 return ERR_APPLICATION_LANGUAGE_NOT_FOUND; 419 return Service::NS::ResultApplicationLanguageNotFound;
420 } 420 }
421 const auto priority_list = GetApplicationLanguagePriorityList(*application_language); 421 const auto priority_list = GetApplicationLanguagePriorityList(*application_language);
422 if (!priority_list) { 422 if (!priority_list) {
423 LOG_ERROR(Service_NS, 423 LOG_ERROR(Service_NS,
424 "Could not find application language priorities! application_language={}", 424 "Could not find application language priorities! application_language={}",
425 *application_language); 425 *application_language);
426 return ERR_APPLICATION_LANGUAGE_NOT_FOUND; 426 return Service::NS::ResultApplicationLanguageNotFound;
427 } 427 }
428 428
429 // Try to find a valid language. 429 // Try to find a valid language.
@@ -436,7 +436,7 @@ ResultVal<u8> IApplicationManagerInterface::GetApplicationDesiredLanguage(
436 436
437 LOG_ERROR(Service_NS, "Could not find a valid language! supported_languages={:08X}", 437 LOG_ERROR(Service_NS, "Could not find a valid language! supported_languages={:08X}",
438 supported_languages); 438 supported_languages);
439 return ERR_APPLICATION_LANGUAGE_NOT_FOUND; 439 return Service::NS::ResultApplicationLanguageNotFound;
440} 440}
441 441
442void IApplicationManagerInterface::ConvertApplicationLanguageToLanguageCode( 442void IApplicationManagerInterface::ConvertApplicationLanguageToLanguageCode(
@@ -461,7 +461,7 @@ ResultVal<u64> IApplicationManagerInterface::ConvertApplicationLanguageToLanguag
461 ConvertToLanguageCode(static_cast<ApplicationLanguage>(application_language)); 461 ConvertToLanguageCode(static_cast<ApplicationLanguage>(application_language));
462 if (language_code == std::nullopt) { 462 if (language_code == std::nullopt) {
463 LOG_ERROR(Service_NS, "Language not found! application_language={}", application_language); 463 LOG_ERROR(Service_NS, "Language not found! application_language={}", application_language);
464 return ERR_APPLICATION_LANGUAGE_NOT_FOUND; 464 return Service::NS::ResultApplicationLanguageNotFound;
465 } 465 }
466 466
467 return static_cast<u64>(*language_code); 467 return static_cast<u64>(*language_code);
diff --git a/src/core/hle/service/server_manager.cpp b/src/core/hle/service/server_manager.cpp
index c91f6d880..bd04cd023 100644
--- a/src/core/hle/service/server_manager.cpp
+++ b/src/core/hle/service/server_manager.cpp
@@ -404,7 +404,7 @@ Result ServerManager::CompleteSyncRequest(RequestState&& request) {
404 rc = request.session->SendReplyHLE(); 404 rc = request.session->SendReplyHLE();
405 405
406 // If the session has been closed, we're done. 406 // If the session has been closed, we're done.
407 if (rc == Kernel::ResultSessionClosed || service_rc == IPC::ERR_REMOTE_PROCESS_DEAD) { 407 if (rc == Kernel::ResultSessionClosed || service_rc == IPC::ResultSessionClosed) {
408 // Close the session. 408 // Close the session.
409 request.session->Close(); 409 request.session->Close();
410 410
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index eed615377..69cdb5918 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -176,7 +176,7 @@ Result ServiceFrameworkBase::HandleSyncRequest(Kernel::KServerSession& session,
176 case IPC::CommandType::TIPC_Close: { 176 case IPC::CommandType::TIPC_Close: {
177 IPC::ResponseBuilder rb{ctx, 2}; 177 IPC::ResponseBuilder rb{ctx, 2};
178 rb.Push(ResultSuccess); 178 rb.Push(ResultSuccess);
179 result = IPC::ERR_REMOTE_PROCESS_DEAD; 179 result = IPC::ResultSessionClosed;
180 break; 180 break;
181 } 181 }
182 case IPC::CommandType::ControlWithContext: 182 case IPC::CommandType::ControlWithContext:
diff --git a/src/core/hle/service/set/set.cpp b/src/core/hle/service/set/set.cpp
index 88df52331..f5788b481 100644
--- a/src/core/hle/service/set/set.cpp
+++ b/src/core/hle/service/set/set.cpp
@@ -74,7 +74,7 @@ constexpr std::array<std::pair<LanguageCode, KeyboardLayout>, 18> language_to_la
74constexpr std::size_t PRE_4_0_0_MAX_ENTRIES = 0xF; 74constexpr std::size_t PRE_4_0_0_MAX_ENTRIES = 0xF;
75constexpr std::size_t POST_4_0_0_MAX_ENTRIES = 0x40; 75constexpr std::size_t POST_4_0_0_MAX_ENTRIES = 0x40;
76 76
77constexpr Result ERR_INVALID_LANGUAGE{ErrorModule::Settings, 625}; 77constexpr Result ResultInvalidLanguage{ErrorModule::Settings, 625};
78 78
79void PushResponseLanguageCode(HLERequestContext& ctx, std::size_t num_language_codes) { 79void PushResponseLanguageCode(HLERequestContext& ctx, std::size_t num_language_codes) {
80 IPC::ResponseBuilder rb{ctx, 3}; 80 IPC::ResponseBuilder rb{ctx, 3};
@@ -130,7 +130,7 @@ void SET::MakeLanguageCode(HLERequestContext& ctx) {
130 if (index >= available_language_codes.size()) { 130 if (index >= available_language_codes.size()) {
131 LOG_ERROR(Service_SET, "Invalid language code index! index={}", index); 131 LOG_ERROR(Service_SET, "Invalid language code index! index={}", index);
132 IPC::ResponseBuilder rb{ctx, 2}; 132 IPC::ResponseBuilder rb{ctx, 2};
133 rb.Push(ERR_INVALID_LANGUAGE); 133 rb.Push(Set::ResultInvalidLanguage);
134 return; 134 return;
135 } 135 }
136 136
diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp
index a46f47d3e..b4046d3ce 100644
--- a/src/core/hle/service/sm/sm.cpp
+++ b/src/core/hle/service/sm/sm.cpp
@@ -18,10 +18,10 @@
18 18
19namespace Service::SM { 19namespace Service::SM {
20 20
21constexpr Result ERR_NOT_INITIALIZED(ErrorModule::SM, 2); 21constexpr Result ResultInvalidClient(ErrorModule::SM, 2);
22constexpr Result ERR_ALREADY_REGISTERED(ErrorModule::SM, 4); 22constexpr Result ResultAlreadyRegistered(ErrorModule::SM, 4);
23constexpr Result ERR_INVALID_NAME(ErrorModule::SM, 6); 23constexpr Result ResultInvalidServiceName(ErrorModule::SM, 6);
24constexpr Result ERR_SERVICE_NOT_REGISTERED(ErrorModule::SM, 7); 24constexpr Result ResultNotRegistered(ErrorModule::SM, 7);
25 25
26ServiceManager::ServiceManager(Kernel::KernelCore& kernel_) : kernel{kernel_} { 26ServiceManager::ServiceManager(Kernel::KernelCore& kernel_) : kernel{kernel_} {
27 controller_interface = std::make_unique<Controller>(kernel.System()); 27 controller_interface = std::make_unique<Controller>(kernel.System());
@@ -45,7 +45,7 @@ void ServiceManager::InvokeControlRequest(HLERequestContext& context) {
45static Result ValidateServiceName(const std::string& name) { 45static Result ValidateServiceName(const std::string& name) {
46 if (name.empty() || name.size() > 8) { 46 if (name.empty() || name.size() > 8) {
47 LOG_ERROR(Service_SM, "Invalid service name! service={}", name); 47 LOG_ERROR(Service_SM, "Invalid service name! service={}", name);
48 return ERR_INVALID_NAME; 48 return Service::SM::ResultInvalidServiceName;
49 } 49 }
50 return ResultSuccess; 50 return ResultSuccess;
51} 51}
@@ -58,7 +58,7 @@ Result ServiceManager::RegisterService(std::string name, u32 max_sessions,
58 std::scoped_lock lk{lock}; 58 std::scoped_lock lk{lock};
59 if (registered_services.find(name) != registered_services.end()) { 59 if (registered_services.find(name) != registered_services.end()) {
60 LOG_ERROR(Service_SM, "Service is already registered! service={}", name); 60 LOG_ERROR(Service_SM, "Service is already registered! service={}", name);
61 return ERR_ALREADY_REGISTERED; 61 return Service::SM::ResultAlreadyRegistered;
62 } 62 }
63 63
64 auto* port = Kernel::KPort::Create(kernel); 64 auto* port = Kernel::KPort::Create(kernel);
@@ -80,7 +80,7 @@ Result ServiceManager::UnregisterService(const std::string& name) {
80 const auto iter = registered_services.find(name); 80 const auto iter = registered_services.find(name);
81 if (iter == registered_services.end()) { 81 if (iter == registered_services.end()) {
82 LOG_ERROR(Service_SM, "Server is not registered! service={}", name); 82 LOG_ERROR(Service_SM, "Server is not registered! service={}", name);
83 return ERR_SERVICE_NOT_REGISTERED; 83 return Service::SM::ResultNotRegistered;
84 } 84 }
85 85
86 registered_services.erase(iter); 86 registered_services.erase(iter);
@@ -96,7 +96,7 @@ ResultVal<Kernel::KPort*> ServiceManager::GetServicePort(const std::string& name
96 auto it = service_ports.find(name); 96 auto it = service_ports.find(name);
97 if (it == service_ports.end()) { 97 if (it == service_ports.end()) {
98 LOG_WARNING(Service_SM, "Server is not registered! service={}", name); 98 LOG_WARNING(Service_SM, "Server is not registered! service={}", name);
99 return ERR_SERVICE_NOT_REGISTERED; 99 return Service::SM::ResultNotRegistered;
100 } 100 }
101 101
102 return it->second; 102 return it->second;
@@ -160,7 +160,7 @@ static std::string PopServiceName(IPC::RequestParser& rp) {
160 160
161ResultVal<Kernel::KClientSession*> SM::GetServiceImpl(HLERequestContext& ctx) { 161ResultVal<Kernel::KClientSession*> SM::GetServiceImpl(HLERequestContext& ctx) {
162 if (!ctx.GetManager()->GetIsInitializedForSm()) { 162 if (!ctx.GetManager()->GetIsInitializedForSm()) {
163 return ERR_NOT_INITIALIZED; 163 return Service::SM::ResultInvalidClient;
164 } 164 }
165 165
166 IPC::RequestParser rp{ctx}; 166 IPC::RequestParser rp{ctx};
@@ -168,15 +168,15 @@ ResultVal<Kernel::KClientSession*> SM::GetServiceImpl(HLERequestContext& ctx) {
168 168
169 // Find the named port. 169 // Find the named port.
170 auto port_result = service_manager.GetServicePort(name); 170 auto port_result = service_manager.GetServicePort(name);
171 if (port_result.Code() == ERR_INVALID_NAME) { 171 if (port_result.Code() == Service::SM::ResultInvalidServiceName) {
172 LOG_ERROR(Service_SM, "Invalid service name '{}'", name); 172 LOG_ERROR(Service_SM, "Invalid service name '{}'", name);
173 return ERR_INVALID_NAME; 173 return Service::SM::ResultInvalidServiceName;
174 } 174 }
175 175
176 if (port_result.Failed()) { 176 if (port_result.Failed()) {
177 LOG_INFO(Service_SM, "Waiting for service {} to become available", name); 177 LOG_INFO(Service_SM, "Waiting for service {} to become available", name);
178 ctx.SetIsDeferred(); 178 ctx.SetIsDeferred();
179 return ERR_SERVICE_NOT_REGISTERED; 179 return Service::SM::ResultNotRegistered;
180 } 180 }
181 auto& port = port_result.Unwrap(); 181 auto& port = port_result.Unwrap();
182 182