mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2025-01-09 22:36:18 +00:00
Add Result.hpp
This commit is contained in:
parent
cfeebbd1c9
commit
b492096aed
2 changed files with 72 additions and 2 deletions
72
mesosphere/include/mesosphere/core/Result.hpp
Normal file
72
mesosphere/include/mesosphere/core/Result.hpp
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <mesosphere/core/types.hpp>
|
||||||
|
|
||||||
|
namespace mesosphere
|
||||||
|
{
|
||||||
|
|
||||||
|
struct Result {
|
||||||
|
enum class Module : uint {
|
||||||
|
None = 0,
|
||||||
|
Kernel = 1,
|
||||||
|
/* Other modules not included. */
|
||||||
|
};
|
||||||
|
|
||||||
|
enum class Description : uint {
|
||||||
|
None = 0,
|
||||||
|
|
||||||
|
InvalidCapabilityDescriptor = 14,
|
||||||
|
|
||||||
|
NotImplemented = 33,
|
||||||
|
|
||||||
|
ThreadTerminated = 59,
|
||||||
|
|
||||||
|
OutOfDebugEvents = 70,
|
||||||
|
|
||||||
|
InvalidSize = 101,
|
||||||
|
InvalidAddress = 102,
|
||||||
|
AllocatorDepleted = 103,
|
||||||
|
OutOfMemory = 104,
|
||||||
|
OutOfHandles = 105,
|
||||||
|
InvalidMemoryState = 106,
|
||||||
|
InvalidMemoryPermissions = 108,
|
||||||
|
InvalidMemoryRange = 110,
|
||||||
|
InvalidPriority = 112,
|
||||||
|
InvalidCoreId = 113,
|
||||||
|
InvalidHandle = 114,
|
||||||
|
InvalidUserBuffer = 115,
|
||||||
|
InvalidCombination = 116,
|
||||||
|
TimedOut = 117,
|
||||||
|
Cancelled = 118,
|
||||||
|
OutOfRange = 119,
|
||||||
|
InvalidEnumValue = 120,
|
||||||
|
NotFound = 121,
|
||||||
|
AlreadyExists = 122,
|
||||||
|
ConnectionClosed = 123,
|
||||||
|
UnhandledUserInterrupt = 124,
|
||||||
|
NotPermitted = 125,
|
||||||
|
ReservedValue = 126,
|
||||||
|
InvalidHwBreakpoint = 127,
|
||||||
|
FatalUserException = 128,
|
||||||
|
OwnedByAnotherProcess = 129,
|
||||||
|
ConnectionRefused = 131,
|
||||||
|
OutOfResource = 132,
|
||||||
|
|
||||||
|
IpcMapFailed = 259,
|
||||||
|
IpcCmdbufTooSmall = 260,
|
||||||
|
|
||||||
|
NotDebugged = 520,
|
||||||
|
};
|
||||||
|
|
||||||
|
Module module : 9;
|
||||||
|
Description description : 23;
|
||||||
|
|
||||||
|
Result() : module{Module::None}, description{Description::None} {}
|
||||||
|
Result(Description description, Module module = Module::Kernel) : description{description}, module{module} {}
|
||||||
|
|
||||||
|
constexpr bool IsSuccess() const { return module == Module::None && description == Description::None; }
|
||||||
|
constexpr bool operator==(const Result &other) const { return module == other.module && description == other.description; }
|
||||||
|
constexpr bool operator!=(const Result &other) const { return !(*this == other); }
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
|
@ -39,8 +39,6 @@ using vs16 = volatile int16_t;
|
||||||
using vs32 = volatile int32_t;
|
using vs32 = volatile int32_t;
|
||||||
using vs64 = volatile int64_t;
|
using vs64 = volatile int64_t;
|
||||||
|
|
||||||
using Result = uint;
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
using SharedPtr = boost::intrusive_ptr<T>;
|
using SharedPtr = boost::intrusive_ptr<T>;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue