summaryrefslogtreecommitdiffstats
path: root/src/core/hle/result.h
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2017-05-21 06:00:18 +0200
committerYuri Kunde Schlesner <yuriks@yuriks.net>2017-05-25 06:05:59 +0200
commit3b1f0fea31d3c56d94f580c1ea3978a5590b5f8a (patch)
treef1fe3acaba7ad0508cc893aebf32f7776ed0ea4a /src/core/hle/result.h
parentMake BitField and ResultCode constexpr-initializable (diff)
downloadyuzu-3b1f0fea31d3c56d94f580c1ea3978a5590b5f8a.tar
yuzu-3b1f0fea31d3c56d94f580c1ea3978a5590b5f8a.tar.gz
yuzu-3b1f0fea31d3c56d94f580c1ea3978a5590b5f8a.tar.bz2
yuzu-3b1f0fea31d3c56d94f580c1ea3978a5590b5f8a.tar.lz
yuzu-3b1f0fea31d3c56d94f580c1ea3978a5590b5f8a.tar.xz
yuzu-3b1f0fea31d3c56d94f580c1ea3978a5590b5f8a.tar.zst
yuzu-3b1f0fea31d3c56d94f580c1ea3978a5590b5f8a.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/result.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/core/hle/result.h b/src/core/hle/result.h
index db548bd76..c44668732 100644
--- a/src/core/hle/result.h
+++ b/src/core/hle/result.h
@@ -13,9 +13,14 @@
// All the constants in this file come from http://3dbrew.org/wiki/Error_codes
-/// Detailed description of the error. This listing is likely incomplete.
+/**
+ * Detailed description of the error. Code 0 always means success. Codes 1000 and above are
+ * considered "well-known" and have common values between all modules. The meaning of other codes
+ * vary by module.
+ */
enum class ErrorDescription : u32 {
Success = 0,
+
SessionClosedByRemote = 26,
WrongPermission = 46,
OS_InvalidBufferDescriptor = 48,
@@ -45,6 +50,8 @@ enum class ErrorDescription : u32 {
FS_UnsupportedOpenFlags = 760,
FS_IncorrectExeFSReadSize = 761,
FS_UnexpectedFileOrDirectory = 770,
+
+ // Codes 1000 and above are considered "well-known" and have common values between all modules.
InvalidSection = 1000,
TooLarge = 1001,
NotAuthorized = 1002,
@@ -218,7 +225,7 @@ enum class ErrorLevel : u32 {
union ResultCode {
u32 raw;
- BitField<0, 10, ErrorDescription> description;
+ BitField<0, 10, u32> description;
BitField<10, 8, ErrorModule> module;
BitField<21, 6, ErrorSummary> summary;
@@ -230,7 +237,11 @@ union ResultCode {
constexpr explicit ResultCode(u32 raw) : raw(raw) {}
- constexpr ResultCode(ErrorDescription description_, ErrorModule module_, ErrorSummary summary_,
+ constexpr ResultCode(ErrorDescription description, ErrorModule module, ErrorSummary summary,
+ ErrorLevel level)
+ : ResultCode(static_cast<u32>(description), module, summary, level) {}
+
+ constexpr ResultCode(u32 description_, ErrorModule module_, ErrorSummary summary_,
ErrorLevel level_)
: raw(description.FormatValue(description_) | module.FormatValue(module_) |
summary.FormatValue(summary_) | level.FormatValue(level_)) {}