diff options
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r-- | src/core/hle/kernel/errors.h | 94 | ||||
-rw-r--r-- | src/core/hle/kernel/thread.cpp | 5 |
2 files changed, 22 insertions, 77 deletions
diff --git a/src/core/hle/kernel/errors.h b/src/core/hle/kernel/errors.h index 64aa61460..f8890f0e3 100644 --- a/src/core/hle/kernel/errors.h +++ b/src/core/hle/kernel/errors.h @@ -23,81 +23,27 @@ enum { // 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. -constexpr ResultCode ERR_OUT_OF_HANDLES(ErrCodes::OutOfHandles, ErrorModule::Kernel, - ErrorSummary::OutOfResource, - ErrorLevel::Permanent); // 0xD8600413 -constexpr ResultCode ERR_SESSION_CLOSED_BY_REMOTE(ErrCodes::SessionClosedByRemote, ErrorModule::OS, - ErrorSummary::Canceled, - ErrorLevel::Status); // 0xC920181A -constexpr ResultCode ERR_PORT_NAME_TOO_LONG(ErrCodes::PortNameTooLong, ErrorModule::OS, - ErrorSummary::InvalidArgument, - ErrorLevel::Usage); // 0xE0E0181E -constexpr ResultCode ERR_WRONG_PERMISSION(ErrCodes::WrongPermission, ErrorModule::OS, - ErrorSummary::WrongArgument, ErrorLevel::Permanent); -constexpr ResultCode ERR_INVALID_BUFFER_DESCRIPTOR(ErrCodes::InvalidBufferDescriptor, - ErrorModule::OS, ErrorSummary::WrongArgument, - ErrorLevel::Permanent); -constexpr ResultCode ERR_MAX_CONNECTIONS_REACHED(ErrCodes::MaxConnectionsReached, ErrorModule::OS, - ErrorSummary::WouldBlock, - ErrorLevel::Temporary); // 0xD0401834 - -constexpr ResultCode ERR_NOT_AUTHORIZED(ErrorDescription::NotAuthorized, ErrorModule::OS, - ErrorSummary::WrongArgument, - ErrorLevel::Permanent); // 0xD9001BEA -constexpr ResultCode ERR_INVALID_ENUM_VALUE(ErrorDescription::InvalidEnumValue, ErrorModule::Kernel, - ErrorSummary::InvalidArgument, - ErrorLevel::Permanent); // 0xD8E007ED -constexpr ResultCode ERR_INVALID_ENUM_VALUE_FND(ErrorDescription::InvalidEnumValue, - ErrorModule::FND, ErrorSummary::InvalidArgument, - ErrorLevel::Permanent); // 0xD8E093ED -constexpr ResultCode ERR_INVALID_COMBINATION(ErrorDescription::InvalidCombination, ErrorModule::OS, - ErrorSummary::InvalidArgument, - ErrorLevel::Usage); // 0xE0E01BEE -constexpr ResultCode ERR_INVALID_COMBINATION_KERNEL(ErrorDescription::InvalidCombination, - ErrorModule::Kernel, - ErrorSummary::WrongArgument, - ErrorLevel::Permanent); // 0xD90007EE -constexpr ResultCode ERR_MISALIGNED_ADDRESS(ErrorDescription::MisalignedAddress, ErrorModule::OS, - ErrorSummary::InvalidArgument, - ErrorLevel::Usage); // 0xE0E01BF1 -constexpr ResultCode ERR_MISALIGNED_SIZE(ErrorDescription::MisalignedSize, ErrorModule::OS, - ErrorSummary::InvalidArgument, - ErrorLevel::Usage); // 0xE0E01BF2 -constexpr ResultCode ERR_OUT_OF_MEMORY(ErrorDescription::OutOfMemory, ErrorModule::Kernel, - ErrorSummary::OutOfResource, - ErrorLevel::Permanent); // 0xD86007F3 -constexpr ResultCode ERR_NOT_IMPLEMENTED(ErrorDescription::NotImplemented, ErrorModule::OS, - ErrorSummary::InvalidArgument, - ErrorLevel::Usage); // 0xE0E01BF4 -constexpr ResultCode ERR_INVALID_ADDRESS(ErrorDescription::InvalidAddress, ErrorModule::OS, - ErrorSummary::InvalidArgument, - ErrorLevel::Usage); // 0xE0E01BF5 -constexpr ResultCode ERR_INVALID_ADDRESS_STATE(ErrorDescription::InvalidAddress, ErrorModule::OS, - ErrorSummary::InvalidState, - ErrorLevel::Usage); // 0xE0A01BF5 -constexpr ResultCode ERR_INVALID_POINTER(ErrorDescription::InvalidPointer, ErrorModule::Kernel, - ErrorSummary::InvalidArgument, - ErrorLevel::Permanent); // 0xD8E007F6 -constexpr ResultCode ERR_INVALID_HANDLE(ErrorDescription::InvalidHandle, ErrorModule::Kernel, - ErrorSummary::InvalidArgument, - ErrorLevel::Permanent); // 0xD8E007F7 +// TODO(bunnei): Replace these with correct errors for Switch OS +constexpr ResultCode ERR_OUT_OF_HANDLES(-1); +constexpr ResultCode ERR_SESSION_CLOSED_BY_REMOTE(-1); +constexpr ResultCode ERR_PORT_NAME_TOO_LONG(-1); +constexpr ResultCode ERR_WRONG_PERMISSION(-1); +constexpr ResultCode ERR_MAX_CONNECTIONS_REACHED(-1); +constexpr ResultCode ERR_INVALID_ENUM_VALUE(-1); +constexpr ResultCode ERR_INVALID_ENUM_VALUE_FND(-1); +constexpr ResultCode ERR_INVALID_COMBINATION(-1); +constexpr ResultCode ERR_INVALID_COMBINATION_KERNEL(-1); +constexpr ResultCode ERR_OUT_OF_MEMORY(-1); +constexpr ResultCode ERR_INVALID_ADDRESS(-1); +constexpr ResultCode ERR_INVALID_ADDRESS_STATE(-1); +constexpr ResultCode ERR_INVALID_HANDLE(-1); /// Alternate code returned instead of ERR_INVALID_HANDLE in some code paths. -constexpr ResultCode ERR_INVALID_HANDLE_OS(ErrorDescription::InvalidHandle, ErrorModule::OS, - ErrorSummary::WrongArgument, - ErrorLevel::Permanent); // 0xD9001BF7 -constexpr ResultCode ERR_NOT_FOUND(ErrorDescription::NotFound, ErrorModule::Kernel, - ErrorSummary::NotFound, ErrorLevel::Permanent); // 0xD88007FA -constexpr ResultCode ERR_OUT_OF_RANGE(ErrorDescription::OutOfRange, ErrorModule::OS, - ErrorSummary::InvalidArgument, - ErrorLevel::Usage); // 0xE0E01BFD -constexpr ResultCode ERR_OUT_OF_RANGE_KERNEL(ErrorDescription::OutOfRange, ErrorModule::Kernel, - ErrorSummary::InvalidArgument, - ErrorLevel::Permanent); // 0xD8E007FD -constexpr ResultCode RESULT_TIMEOUT(ErrorDescription::Timeout, ErrorModule::OS, - ErrorSummary::StatusChanged, ErrorLevel::Info); +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); +constexpr ResultCode RESULT_TIMEOUT(-1); /// Returned when Accept() is called on a port with no sessions to be accepted. -constexpr ResultCode ERR_NO_PENDING_SESSIONS(ErrCodes::NoPendingSessions, ErrorModule::OS, - ErrorSummary::WouldBlock, - ErrorLevel::Permanent); // 0xD8401823 +constexpr ResultCode ERR_NO_PENDING_SESSIONS(-1); } // namespace Kernel diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 8b72084bf..372cafdd9 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -386,9 +386,8 @@ ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point, if (!Memory::IsValidVirtualAddress(*owner_process, entry_point)) { LOG_ERROR(Kernel_SVC, "(name=%s): invalid entry %08x", name.c_str(), entry_point); - // TODO: Verify error - return ResultCode(ErrorDescription::InvalidAddress, ErrorModule::Kernel, - ErrorSummary::InvalidArgument, ErrorLevel::Permanent); + // TODO (bunnei): Find the correct error code to use here + return ResultCode(-1); } SharedPtr<Thread> thread(new Thread); |