summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/errors.h21
-rw-r--r--src/core/hle/kernel/handle_table.cpp2
-rw-r--r--src/core/hle/kernel/handle_table.h2
-rw-r--r--src/core/hle/kernel/shared_memory.cpp2
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 {
11namespace ErrCodes { 11namespace ErrCodes {
12enum { 12enum {
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
40constexpr ResultCode ERR_OUT_OF_HANDLES(-1); 40constexpr ResultCode ERR_HANDLE_TABLE_FULL(ErrorModule::Kernel, ErrCodes::HandleTableFull);
41constexpr ResultCode ERR_SESSION_CLOSED_BY_REMOTE(-1); 41constexpr ResultCode ERR_SESSION_CLOSED_BY_REMOTE(-1);
42constexpr ResultCode ERR_PORT_NAME_TOO_LONG(-1); 42constexpr ResultCode ERR_PORT_NAME_TOO_LONG(ErrorModule::Kernel, ErrCodes::TooLarge);
43constexpr ResultCode ERR_WRONG_PERMISSION(-1); 43constexpr ResultCode ERR_MAX_CONNECTIONS_REACHED(ErrorModule::Kernel,
44constexpr ResultCode ERR_MAX_CONNECTIONS_REACHED(-1); 44 ErrCodes::MaxConnectionsReached);
45constexpr ResultCode ERR_INVALID_ENUM_VALUE(ErrorModule::Kernel, ErrCodes::InvalidEnumValue); 45constexpr ResultCode ERR_INVALID_ENUM_VALUE(ErrorModule::Kernel, ErrCodes::InvalidEnumValue);
46constexpr ResultCode ERR_INVALID_ENUM_VALUE_FND(-1); 46constexpr ResultCode ERR_INVALID_ENUM_VALUE_FND(-1);
47constexpr ResultCode ERR_INVALID_COMBINATION(-1); 47constexpr ResultCode ERR_INVALID_COMBINATION(-1);
48constexpr ResultCode ERR_INVALID_COMBINATION_KERNEL(-1); 48constexpr ResultCode ERR_INVALID_COMBINATION_KERNEL(ErrorModule::Kernel,
49 ErrCodes::InvalidCombination);
49constexpr ResultCode ERR_OUT_OF_MEMORY(-1); 50constexpr ResultCode ERR_OUT_OF_MEMORY(-1);
50constexpr ResultCode ERR_INVALID_ADDRESS(ErrorModule::Kernel, ErrCodes::InvalidAddress); 51constexpr ResultCode ERR_INVALID_ADDRESS(ErrorModule::Kernel, ErrCodes::InvalidAddress);
51constexpr ResultCode ERR_INVALID_ADDRESS_STATE(ErrorModule::Kernel, ErrCodes::InvalidMemoryState); 52constexpr ResultCode ERR_INVALID_ADDRESS_STATE(ErrorModule::Kernel, ErrCodes::InvalidMemoryState);
53constexpr ResultCode ERR_INVALID_MEMORY_PERMISSIONS(ErrorModule::Kernel,
54 ErrCodes::InvalidMemoryPermissions);
52constexpr ResultCode ERR_INVALID_HANDLE(ErrorModule::Kernel, ErrCodes::InvalidHandle); 55constexpr ResultCode ERR_INVALID_HANDLE(ErrorModule::Kernel, ErrCodes::InvalidHandle);
53constexpr ResultCode ERR_INVALID_STATE(ErrorModule::Kernel, ErrCodes::InvalidState); 56constexpr ResultCode ERR_INVALID_STATE(ErrorModule::Kernel, ErrCodes::InvalidState);
54constexpr ResultCode ERR_INVALID_POINTER(-1); 57constexpr 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;