diff options
| author | 2018-08-27 18:37:48 -0400 | |
|---|---|---|
| committer | 2018-08-27 18:37:48 -0400 | |
| commit | a409d49bbd2fe68fde2c5bacd83a4b2e5f396641 (patch) | |
| tree | 38a7ceb610ba22622bfc5142aca139ff7fe7f882 /src/core/hle/kernel | |
| parent | Merge pull request #1169 from Lakumakkara/sel (diff) | |
| parent | kernel/error: Amend error code for ERR_MAX_CONNECTIONS_REACHED (diff) | |
| download | yuzu-a409d49bbd2fe68fde2c5bacd83a4b2e5f396641.tar.gz yuzu-a409d49bbd2fe68fde2c5bacd83a4b2e5f396641.tar.xz yuzu-a409d49bbd2fe68fde2c5bacd83a4b2e5f396641.zip | |
Merge pull request #1177 from lioncash/err
kernel/error: Amend several error codes
Diffstat (limited to 'src/core/hle/kernel')
| -rw-r--r-- | src/core/hle/kernel/errors.h | 21 | ||||
| -rw-r--r-- | src/core/hle/kernel/handle_table.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/handle_table.h | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/shared_memory.cpp | 2 |
4 files changed, 15 insertions, 12 deletions
diff --git a/src/core/hle/kernel/errors.h b/src/core/hle/kernel/errors.h index 221cb1bb5..4054d5db6 100644 --- a/src/core/hle/kernel/errors.h +++ b/src/core/hle/kernel/errors.h | |||
| @@ -11,17 +11,16 @@ namespace Kernel { | |||
| 11 | namespace ErrCodes { | 11 | namespace ErrCodes { |
| 12 | enum { | 12 | enum { |
| 13 | // TODO(Subv): Remove these 3DS OS error codes. | 13 | // TODO(Subv): Remove these 3DS OS error codes. |
| 14 | OutOfHandles = 19, | ||
| 15 | SessionClosedByRemote = 26, | 14 | SessionClosedByRemote = 26, |
| 16 | PortNameTooLong = 30, | ||
| 17 | NoPendingSessions = 35, | 15 | NoPendingSessions = 35, |
| 18 | WrongPermission = 46, | ||
| 19 | InvalidBufferDescriptor = 48, | 16 | InvalidBufferDescriptor = 48, |
| 20 | MaxConnectionsReached = 52, | ||
| 21 | 17 | ||
| 22 | // Confirmed Switch OS error codes | 18 | // Confirmed Switch OS error codes |
| 19 | MaxConnectionsReached = 7, | ||
| 23 | InvalidAddress = 102, | 20 | InvalidAddress = 102, |
| 21 | HandleTableFull = 105, | ||
| 24 | InvalidMemoryState = 106, | 22 | InvalidMemoryState = 106, |
| 23 | InvalidMemoryPermissions = 108, | ||
| 25 | InvalidProcessorId = 113, | 24 | InvalidProcessorId = 113, |
| 26 | InvalidHandle = 114, | 25 | InvalidHandle = 114, |
| 27 | InvalidCombination = 116, | 26 | InvalidCombination = 116, |
| @@ -30,6 +29,7 @@ enum { | |||
| 30 | TooLarge = 119, | 29 | TooLarge = 119, |
| 31 | InvalidEnumValue = 120, | 30 | InvalidEnumValue = 120, |
| 32 | InvalidState = 125, | 31 | InvalidState = 125, |
| 32 | ResourceLimitExceeded = 132, | ||
| 33 | }; | 33 | }; |
| 34 | } | 34 | } |
| 35 | 35 | ||
| @@ -37,18 +37,21 @@ enum { | |||
| 37 | // double check that the code matches before re-using the constant. | 37 | // double check that the code matches before re-using the constant. |
| 38 | 38 | ||
| 39 | // TODO(bunnei): Replace these with correct errors for Switch OS | 39 | // TODO(bunnei): Replace these with correct errors for Switch OS |
| 40 | constexpr ResultCode ERR_OUT_OF_HANDLES(-1); | 40 | constexpr ResultCode ERR_HANDLE_TABLE_FULL(ErrorModule::Kernel, ErrCodes::HandleTableFull); |
| 41 | constexpr ResultCode ERR_SESSION_CLOSED_BY_REMOTE(-1); | 41 | constexpr ResultCode ERR_SESSION_CLOSED_BY_REMOTE(-1); |
| 42 | constexpr ResultCode ERR_PORT_NAME_TOO_LONG(-1); | 42 | constexpr ResultCode ERR_PORT_NAME_TOO_LONG(ErrorModule::Kernel, ErrCodes::TooLarge); |
| 43 | constexpr ResultCode ERR_WRONG_PERMISSION(-1); | 43 | constexpr ResultCode ERR_MAX_CONNECTIONS_REACHED(ErrorModule::Kernel, |
| 44 | constexpr ResultCode ERR_MAX_CONNECTIONS_REACHED(-1); | 44 | ErrCodes::MaxConnectionsReached); |
| 45 | constexpr ResultCode ERR_INVALID_ENUM_VALUE(ErrorModule::Kernel, ErrCodes::InvalidEnumValue); | 45 | constexpr ResultCode ERR_INVALID_ENUM_VALUE(ErrorModule::Kernel, ErrCodes::InvalidEnumValue); |
| 46 | constexpr ResultCode ERR_INVALID_ENUM_VALUE_FND(-1); | 46 | constexpr ResultCode ERR_INVALID_ENUM_VALUE_FND(-1); |
| 47 | constexpr ResultCode ERR_INVALID_COMBINATION(-1); | 47 | constexpr ResultCode ERR_INVALID_COMBINATION(-1); |
| 48 | constexpr ResultCode ERR_INVALID_COMBINATION_KERNEL(-1); | 48 | constexpr ResultCode ERR_INVALID_COMBINATION_KERNEL(ErrorModule::Kernel, |
| 49 | ErrCodes::InvalidCombination); | ||
| 49 | constexpr ResultCode ERR_OUT_OF_MEMORY(-1); | 50 | constexpr ResultCode ERR_OUT_OF_MEMORY(-1); |
| 50 | constexpr ResultCode ERR_INVALID_ADDRESS(ErrorModule::Kernel, ErrCodes::InvalidAddress); | 51 | constexpr ResultCode ERR_INVALID_ADDRESS(ErrorModule::Kernel, ErrCodes::InvalidAddress); |
| 51 | constexpr ResultCode ERR_INVALID_ADDRESS_STATE(ErrorModule::Kernel, ErrCodes::InvalidMemoryState); | 52 | constexpr ResultCode ERR_INVALID_ADDRESS_STATE(ErrorModule::Kernel, ErrCodes::InvalidMemoryState); |
| 53 | constexpr ResultCode ERR_INVALID_MEMORY_PERMISSIONS(ErrorModule::Kernel, | ||
| 54 | ErrCodes::InvalidMemoryPermissions); | ||
| 52 | constexpr ResultCode ERR_INVALID_HANDLE(ErrorModule::Kernel, ErrCodes::InvalidHandle); | 55 | constexpr ResultCode ERR_INVALID_HANDLE(ErrorModule::Kernel, ErrCodes::InvalidHandle); |
| 53 | constexpr ResultCode ERR_INVALID_STATE(ErrorModule::Kernel, ErrCodes::InvalidState); | 56 | constexpr ResultCode ERR_INVALID_STATE(ErrorModule::Kernel, ErrCodes::InvalidState); |
| 54 | constexpr ResultCode ERR_INVALID_POINTER(-1); | 57 | constexpr ResultCode ERR_INVALID_POINTER(-1); |
diff --git a/src/core/hle/kernel/handle_table.cpp b/src/core/hle/kernel/handle_table.cpp index 28e21428a..6d9f7a02b 100644 --- a/src/core/hle/kernel/handle_table.cpp +++ b/src/core/hle/kernel/handle_table.cpp | |||
| @@ -26,7 +26,7 @@ ResultVal<Handle> HandleTable::Create(SharedPtr<Object> obj) { | |||
| 26 | u16 slot = next_free_slot; | 26 | u16 slot = next_free_slot; |
| 27 | if (slot >= generations.size()) { | 27 | if (slot >= generations.size()) { |
| 28 | LOG_ERROR(Kernel, "Unable to allocate Handle, too many slots in use."); | 28 | LOG_ERROR(Kernel, "Unable to allocate Handle, too many slots in use."); |
| 29 | return ERR_OUT_OF_HANDLES; | 29 | return ERR_HANDLE_TABLE_FULL; |
| 30 | } | 30 | } |
| 31 | next_free_slot = generations[slot]; | 31 | next_free_slot = generations[slot]; |
| 32 | 32 | ||
diff --git a/src/core/hle/kernel/handle_table.h b/src/core/hle/kernel/handle_table.h index 22ddda630..aee3583e8 100644 --- a/src/core/hle/kernel/handle_table.h +++ b/src/core/hle/kernel/handle_table.h | |||
| @@ -47,7 +47,7 @@ public: | |||
| 47 | /** | 47 | /** |
| 48 | * Allocates a handle for the given object. | 48 | * Allocates a handle for the given object. |
| 49 | * @return The created Handle or one of the following errors: | 49 | * @return The created Handle or one of the following errors: |
| 50 | * - `ERR_OUT_OF_HANDLES`: the maximum number of handles has been exceeded. | 50 | * - `ERR_HANDLE_TABLE_FULL`: the maximum number of handles has been exceeded. |
| 51 | */ | 51 | */ |
| 52 | ResultVal<Handle> Create(SharedPtr<Object> obj); | 52 | ResultVal<Handle> Create(SharedPtr<Object> obj); |
| 53 | 53 | ||
diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp index 21ddc2f7d..fc168d2b5 100644 --- a/src/core/hle/kernel/shared_memory.cpp +++ b/src/core/hle/kernel/shared_memory.cpp | |||
| @@ -101,7 +101,7 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi | |||
| 101 | static_cast<u32>(this->permissions) & ~static_cast<u32>(other_permissions)) { | 101 | static_cast<u32>(this->permissions) & ~static_cast<u32>(other_permissions)) { |
| 102 | LOG_ERROR(Kernel, "cannot map id={}, address=0x{:X} name={}, permissions don't match", | 102 | LOG_ERROR(Kernel, "cannot map id={}, address=0x{:X} name={}, permissions don't match", |
| 103 | GetObjectId(), address, name); | 103 | GetObjectId(), address, name); |
| 104 | return ERR_WRONG_PERMISSION; | 104 | return ERR_INVALID_MEMORY_PERMISSIONS; |
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | VAddr target_address = address; | 107 | VAddr target_address = address; |