2018-01-13 22:22:39 +01:00
|
|
|
// Copyright 2018 yuzu emulator team
|
2017-05-21 09:11:36 +02:00
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "core/hle/result.h"
|
|
|
|
|
|
|
|
namespace Kernel {
|
|
|
|
|
|
|
|
namespace ErrCodes {
|
|
|
|
enum {
|
2018-01-09 18:05:10 +01:00
|
|
|
// TODO(Subv): Remove these 3DS OS error codes.
|
2017-05-21 09:11:36 +02:00
|
|
|
SessionClosedByRemote = 26,
|
2017-06-23 08:57:05 +02:00
|
|
|
NoPendingSessions = 35,
|
2017-05-21 09:11:36 +02:00
|
|
|
InvalidBufferDescriptor = 48,
|
2018-01-09 18:05:10 +01:00
|
|
|
|
|
|
|
// Confirmed Switch OS error codes
|
2018-08-25 12:15:58 +02:00
|
|
|
MaxConnectionsReached = 7,
|
2018-06-21 08:49:43 +02:00
|
|
|
InvalidAddress = 102,
|
2018-08-25 11:44:51 +02:00
|
|
|
HandleTableFull = 105,
|
2018-06-21 08:49:43 +02:00
|
|
|
InvalidMemoryState = 106,
|
2018-08-25 11:40:42 +02:00
|
|
|
InvalidMemoryPermissions = 108,
|
2018-05-30 19:03:19 +02:00
|
|
|
InvalidProcessorId = 113,
|
2018-01-09 18:05:10 +01:00
|
|
|
InvalidHandle = 114,
|
2018-05-30 19:03:19 +02:00
|
|
|
InvalidCombination = 116,
|
2018-01-09 18:05:10 +01:00
|
|
|
Timeout = 117,
|
2018-01-09 21:02:04 +01:00
|
|
|
SynchronizationCanceled = 118,
|
|
|
|
TooLarge = 119,
|
2018-06-21 08:49:43 +02:00
|
|
|
InvalidEnumValue = 120,
|
2018-06-21 09:40:29 +02:00
|
|
|
InvalidState = 125,
|
2018-08-25 12:15:58 +02:00
|
|
|
ResourceLimitExceeded = 132,
|
2017-05-21 09:11:36 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
// WARNING: The kernel is quite inconsistent in it's usage of errors code. Make sure to always
|
|
|
|
// double check that the code matches before re-using the constant.
|
|
|
|
|
2017-11-01 00:26:11 +01:00
|
|
|
// TODO(bunnei): Replace these with correct errors for Switch OS
|
2018-08-25 11:44:51 +02:00
|
|
|
constexpr ResultCode ERR_HANDLE_TABLE_FULL(ErrorModule::Kernel, ErrCodes::HandleTableFull);
|
2017-11-01 00:26:11 +01:00
|
|
|
constexpr ResultCode ERR_SESSION_CLOSED_BY_REMOTE(-1);
|
2018-08-25 11:52:57 +02:00
|
|
|
constexpr ResultCode ERR_PORT_NAME_TOO_LONG(ErrorModule::Kernel, ErrCodes::TooLarge);
|
2018-08-25 12:15:58 +02:00
|
|
|
constexpr ResultCode ERR_MAX_CONNECTIONS_REACHED(ErrorModule::Kernel,
|
|
|
|
ErrCodes::MaxConnectionsReached);
|
2018-06-21 08:49:43 +02:00
|
|
|
constexpr ResultCode ERR_INVALID_ENUM_VALUE(ErrorModule::Kernel, ErrCodes::InvalidEnumValue);
|
2017-11-01 00:26:11 +01:00
|
|
|
constexpr ResultCode ERR_INVALID_ENUM_VALUE_FND(-1);
|
|
|
|
constexpr ResultCode ERR_INVALID_COMBINATION(-1);
|
2018-08-25 11:37:37 +02:00
|
|
|
constexpr ResultCode ERR_INVALID_COMBINATION_KERNEL(ErrorModule::Kernel,
|
|
|
|
ErrCodes::InvalidCombination);
|
2017-11-01 00:26:11 +01:00
|
|
|
constexpr ResultCode ERR_OUT_OF_MEMORY(-1);
|
2018-06-21 08:49:43 +02:00
|
|
|
constexpr ResultCode ERR_INVALID_ADDRESS(ErrorModule::Kernel, ErrCodes::InvalidAddress);
|
|
|
|
constexpr ResultCode ERR_INVALID_ADDRESS_STATE(ErrorModule::Kernel, ErrCodes::InvalidMemoryState);
|
2018-08-25 11:40:42 +02:00
|
|
|
constexpr ResultCode ERR_INVALID_MEMORY_PERMISSIONS(ErrorModule::Kernel,
|
|
|
|
ErrCodes::InvalidMemoryPermissions);
|
2018-01-09 18:05:10 +01:00
|
|
|
constexpr ResultCode ERR_INVALID_HANDLE(ErrorModule::Kernel, ErrCodes::InvalidHandle);
|
2018-06-21 09:40:29 +02:00
|
|
|
constexpr ResultCode ERR_INVALID_STATE(ErrorModule::Kernel, ErrCodes::InvalidState);
|
2017-12-31 21:59:00 +01:00
|
|
|
constexpr ResultCode ERR_INVALID_POINTER(-1);
|
|
|
|
constexpr ResultCode ERR_INVALID_OBJECT_ADDR(-1);
|
|
|
|
constexpr ResultCode ERR_NOT_AUTHORIZED(-1);
|
2017-05-21 09:11:36 +02:00
|
|
|
/// Alternate code returned instead of ERR_INVALID_HANDLE in some code paths.
|
2017-11-01 00:26:11 +01:00
|
|
|
constexpr ResultCode ERR_INVALID_HANDLE_OS(-1);
|
|
|
|
constexpr ResultCode ERR_NOT_FOUND(-1);
|
|
|
|
constexpr ResultCode ERR_OUT_OF_RANGE(-1);
|
|
|
|
constexpr ResultCode ERR_OUT_OF_RANGE_KERNEL(-1);
|
2018-01-09 18:05:10 +01:00
|
|
|
constexpr ResultCode RESULT_TIMEOUT(ErrorModule::Kernel, ErrCodes::Timeout);
|
2017-06-23 08:57:05 +02:00
|
|
|
/// Returned when Accept() is called on a port with no sessions to be accepted.
|
2017-11-01 00:26:11 +01:00
|
|
|
constexpr ResultCode ERR_NO_PENDING_SESSIONS(-1);
|
2017-05-21 09:11:36 +02:00
|
|
|
|
|
|
|
} // namespace Kernel
|