Ram Gandikota
/
IOTMetronome
FRDM K64F Metronome
pal/Source/PAL-Impl/Services-API/pal_errors.h@0:dbad57390bd1, 2017-05-14 (annotated)
- Committer:
- ram54288
- Date:
- Sun May 14 18:37:05 2017 +0000
- Revision:
- 0:dbad57390bd1
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ram54288 | 0:dbad57390bd1 | 1 | /* |
ram54288 | 0:dbad57390bd1 | 2 | * Copyright (c) 2016 ARM Limited. All rights reserved. |
ram54288 | 0:dbad57390bd1 | 3 | * SPDX-License-Identifier: Apache-2.0 |
ram54288 | 0:dbad57390bd1 | 4 | * Licensed under the Apache License, Version 2.0 (the License); you may |
ram54288 | 0:dbad57390bd1 | 5 | * not use this file except in compliance with the License. |
ram54288 | 0:dbad57390bd1 | 6 | * You may obtain a copy of the License at |
ram54288 | 0:dbad57390bd1 | 7 | * |
ram54288 | 0:dbad57390bd1 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
ram54288 | 0:dbad57390bd1 | 9 | * |
ram54288 | 0:dbad57390bd1 | 10 | * Unless required by applicable law or agreed to in writing, software |
ram54288 | 0:dbad57390bd1 | 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT |
ram54288 | 0:dbad57390bd1 | 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
ram54288 | 0:dbad57390bd1 | 13 | * See the License for the specific language governing permissions and |
ram54288 | 0:dbad57390bd1 | 14 | * limitations under the License. |
ram54288 | 0:dbad57390bd1 | 15 | */ |
ram54288 | 0:dbad57390bd1 | 16 | |
ram54288 | 0:dbad57390bd1 | 17 | |
ram54288 | 0:dbad57390bd1 | 18 | #ifndef _PAL_ERRORS_H |
ram54288 | 0:dbad57390bd1 | 19 | #define _PAL_ERRORS_H |
ram54288 | 0:dbad57390bd1 | 20 | |
ram54288 | 0:dbad57390bd1 | 21 | #ifdef __cplusplus |
ram54288 | 0:dbad57390bd1 | 22 | extern "C" { |
ram54288 | 0:dbad57390bd1 | 23 | #endif |
ram54288 | 0:dbad57390bd1 | 24 | |
ram54288 | 0:dbad57390bd1 | 25 | #include "pal_types.h" |
ram54288 | 0:dbad57390bd1 | 26 | |
ram54288 | 0:dbad57390bd1 | 27 | |
ram54288 | 0:dbad57390bd1 | 28 | typedef enum { |
ram54288 | 0:dbad57390bd1 | 29 | PAL_ERR_MODULE_GENERAL = 0x4, |
ram54288 | 0:dbad57390bd1 | 30 | PAL_ERR_MODULE_PAL = 0x6, |
ram54288 | 0:dbad57390bd1 | 31 | PAL_ERR_MODULE_C = 0x8, |
ram54288 | 0:dbad57390bd1 | 32 | PAL_ERR_MODULE_RTOS = 0xC, |
ram54288 | 0:dbad57390bd1 | 33 | PAL_ERR_MODULE_NET = 0x10, |
ram54288 | 0:dbad57390bd1 | 34 | PAL_ERR_MODULE_TLS = 0x14, |
ram54288 | 0:dbad57390bd1 | 35 | PAL_ERR_MODULE_CRYPTO = 0x18, |
ram54288 | 0:dbad57390bd1 | 36 | PAL_ERR_MODULE_UPDATE = 0x1C, |
ram54288 | 0:dbad57390bd1 | 37 | } palErrorModules_t; |
ram54288 | 0:dbad57390bd1 | 38 | |
ram54288 | 0:dbad57390bd1 | 39 | |
ram54288 | 0:dbad57390bd1 | 40 | typedef enum { |
ram54288 | 0:dbad57390bd1 | 41 | // generic errors |
ram54288 | 0:dbad57390bd1 | 42 | PAL_ERR_GENERAL_BASE = (-1 << PAL_ERR_MODULE_GENERAL), |
ram54288 | 0:dbad57390bd1 | 43 | PAL_ERR_GENERIC_FAILURE = PAL_ERR_GENERAL_BASE, /*! generic failure*/ // try to use a more specific error message whenever possible |
ram54288 | 0:dbad57390bd1 | 44 | PAL_ERR_INVALID_ARGUMENT = PAL_ERR_GENERAL_BASE + 1, /*! one or more of the functions arguments is invalid */ |
ram54288 | 0:dbad57390bd1 | 45 | PAL_ERR_NO_MEMORY = PAL_ERR_GENERAL_BASE + 2, /*! failure due to a failed attempt to allocate memory */ |
ram54288 | 0:dbad57390bd1 | 46 | PAL_ERR_BUFFER_TOO_SMALL = PAL_ERR_GENERAL_BASE + 3, /*! buffer given is too small*/ |
ram54288 | 0:dbad57390bd1 | 47 | PAL_ERR_NOT_SUPPORTED = PAL_ERR_GENERAL_BASE + 4, /*! operation not supported by PAL for the current configuration*/ |
ram54288 | 0:dbad57390bd1 | 48 | PAL_ERR_TIMEOUT_EXPIRED = PAL_ERR_GENERAL_BASE + 5, /*! timeout for the operation has expired */ |
ram54288 | 0:dbad57390bd1 | 49 | PAL_ERR_NOT_INITIALIZED = PAL_ERR_GENERAL_BASE + 6, /*! timeout for the operation has expired */ |
ram54288 | 0:dbad57390bd1 | 50 | PAL_ERR_NULL_POINTER = PAL_ERR_GENERAL_BASE + 7, /*! received a null pointer when it should be initialized */ |
ram54288 | 0:dbad57390bd1 | 51 | PAL_ERR_CREATION_FAILED = PAL_ERR_GENERAL_BASE + 8, /*! failure in creation of given type, like: mutex, thread , etc */ |
ram54288 | 0:dbad57390bd1 | 52 | // pal errors |
ram54288 | 0:dbad57390bd1 | 53 | PAL_ERR_NOT_IMPLEMENTED = (-1 << PAL_ERR_MODULE_PAL), /*!Currently not implemented will be in the future*/ |
ram54288 | 0:dbad57390bd1 | 54 | // c errors |
ram54288 | 0:dbad57390bd1 | 55 | // RTOS errors |
ram54288 | 0:dbad57390bd1 | 56 | PAL_ERR_RTOS_ERROR_BASE = (-1 << PAL_ERR_MODULE_RTOS), /*! generic failure in RTOS module*/ // try to use a more specific error message whenever possible |
ram54288 | 0:dbad57390bd1 | 57 | PAL_ERR_RTOS_PARAMETER = PAL_ERR_RTOS_ERROR_BASE + 0x80,/*! PAL mapping of CMSIS error osErrorParameter : parameter error: a mandatory parameter was missing or specified an incorrect object.*/ |
ram54288 | 0:dbad57390bd1 | 58 | PAL_ERR_RTOS_RESOURCE = PAL_ERR_RTOS_ERROR_BASE + 0x81,/*! PAL mapping of CMSIS error osErrorResource : resource not available: a specified resource was not available.*/ |
ram54288 | 0:dbad57390bd1 | 59 | PAL_ERR_RTOS_TIMEOUT = PAL_ERR_RTOS_ERROR_BASE + 0xC1,/*! PAL mapping of CMSIS error osErrorTimeoutResource : resource not available within given time: a specified resource was not available within the timeout period*/ |
ram54288 | 0:dbad57390bd1 | 60 | PAL_ERR_RTOS_ISR = PAL_ERR_RTOS_ERROR_BASE + 0x82,/*! PAL mapping of CMSIS error osErrorISR : not allowed in ISR context: the function cannot be called from interrupt service routines.*/ |
ram54288 | 0:dbad57390bd1 | 61 | PAL_ERR_RTOS_ISR_RECURSIVE = PAL_ERR_RTOS_ERROR_BASE + 0x83,/*! PAL mapping of CMSIS error osErrorISRRecursive : function called multiple times from ISR with same object.c*/ |
ram54288 | 0:dbad57390bd1 | 62 | PAL_ERR_RTOS_PRIORITY = PAL_ERR_RTOS_ERROR_BASE + 0x84,/*! PAL mapping of CMSIS error osErrorPriority : system cannot determine priority or thread has illegal priority.*/ |
ram54288 | 0:dbad57390bd1 | 63 | PAL_ERR_RTOS_NO_MEMORY = PAL_ERR_RTOS_ERROR_BASE + 0x85,/*! PAL mapping of CMSIS error osErrorNoMemory : system is out of memory: it was impossible to allocate or reserve memory for the operation.*/ |
ram54288 | 0:dbad57390bd1 | 64 | PAL_ERR_RTOS_VALUE = PAL_ERR_RTOS_ERROR_BASE + 0x86,/*! PAL mapping of CMSIS error osErrorValue : value of a parameter is out of range.*/ |
ram54288 | 0:dbad57390bd1 | 65 | PAL_ERR_RTOS_OS = PAL_ERR_RTOS_ERROR_BASE + 0xFF,/*! PAL mapping of CMSIS error osErrorOS : unspecified RTOS error: run-time error but no other error message fits.*/ |
ram54288 | 0:dbad57390bd1 | 66 | // network errors |
ram54288 | 0:dbad57390bd1 | 67 | PAL_ERR_SOCKET_ERROR_BASE = (-1 << PAL_ERR_MODULE_NET), /*! generic socket error */ |
ram54288 | 0:dbad57390bd1 | 68 | PAL_ERR_SOCKET_GENERIC = PAL_ERR_SOCKET_ERROR_BASE, /*! generic socket error */ |
ram54288 | 0:dbad57390bd1 | 69 | PAL_ERR_SOCKET_NO_BUFFERS = PAL_ERR_SOCKET_ERROR_BASE + 1, /*! no buffers - PAL mapping of posix error ENOBUFS*/ |
ram54288 | 0:dbad57390bd1 | 70 | PAL_ERR_SOCKET_HOST_UNREACHABLE = PAL_ERR_SOCKET_ERROR_BASE + 2, /*! host unreachable (routing error)- PAL mapping of posix error EHOSTUNREACH*/ |
ram54288 | 0:dbad57390bd1 | 71 | PAL_ERR_SOCKET_IN_PROGRES = PAL_ERR_SOCKET_ERROR_BASE + 3, /*! in progress- PAL mapping of posix error EINPROGRESS*/ |
ram54288 | 0:dbad57390bd1 | 72 | PAL_ERR_SOCKET_INVALID_VALUE = PAL_ERR_SOCKET_ERROR_BASE + 4, /*!invalid value - PAL mapping of posix error EINVAL*/ |
ram54288 | 0:dbad57390bd1 | 73 | PAL_ERR_SOCKET_WOULD_BLOCK = PAL_ERR_SOCKET_ERROR_BASE + 5, /*! would block - PAL mapping of posix error EWOULDBLOCK*/ |
ram54288 | 0:dbad57390bd1 | 74 | PAL_ERR_SOCKET_ADDRESS_IN_USE = PAL_ERR_SOCKET_ERROR_BASE + 6, /*! Address in use - PAL mapping of posix error EADDRINUSE*/ |
ram54288 | 0:dbad57390bd1 | 75 | PAL_ERR_SOCKET_ALREADY_CONNECTED = PAL_ERR_SOCKET_ERROR_BASE + 7, /*! Already connected - PAL mapping of posix error EALREADY*/ |
ram54288 | 0:dbad57390bd1 | 76 | PAL_ERR_SOCKET_CONNECTION_ABORTED = PAL_ERR_SOCKET_ERROR_BASE + 8, /*! Connection aborted - PAL mapping of posix error ECONNABORTED*/ |
ram54288 | 0:dbad57390bd1 | 77 | PAL_ERR_SOCKET_CONNECTION_RESET = PAL_ERR_SOCKET_ERROR_BASE + 9, /*! Connection reset - PAL mapping of posix error ECONNRESET*/ |
ram54288 | 0:dbad57390bd1 | 78 | PAL_ERR_SOCKET_NOT_CONNECTED = PAL_ERR_SOCKET_ERROR_BASE + 10, /*! Not connected - PAL mapping of posix error ENOTCONN*/ |
ram54288 | 0:dbad57390bd1 | 79 | PAL_ERR_SOCKET_INPUT_OUTPUT_ERROR = PAL_ERR_SOCKET_ERROR_BASE + 11, /*! I/O error PAL mapping of posix error EIO*/ |
ram54288 | 0:dbad57390bd1 | 80 | PAL_ERR_SOCKET_CONNECTION_CLOSED = PAL_ERR_SOCKET_ERROR_BASE + 12, /*! connection closed */ |
ram54288 | 0:dbad57390bd1 | 81 | PAL_ERR_SOCKET_FAILED_TO_SET_SOCKET_TO_NON_BLOCKING = PAL_ERR_SOCKET_ERROR_BASE + 13, /*! failed to set socket to non-blocking */ |
ram54288 | 0:dbad57390bd1 | 82 | PAL_ERR_SOCKET_INVALID_ADDRESS_FAMILY = PAL_ERR_SOCKET_ERROR_BASE + 14, /*! failed to set socket to non-blocking */ |
ram54288 | 0:dbad57390bd1 | 83 | PAL_ERR_SOCKET_INVALID_ADDRESS = PAL_ERR_SOCKET_ERROR_BASE + 15, /*! address given was not valid/found*/ |
ram54288 | 0:dbad57390bd1 | 84 | PAL_ERR_SOCKET_DNS_ERROR = PAL_ERR_SOCKET_ERROR_BASE + 16, /*! DNS lookup error*/ |
ram54288 | 0:dbad57390bd1 | 85 | PAL_ERR_SOCKET_HDCP_ERROR = PAL_ERR_SOCKET_ERROR_BASE + 17, /*! HDCP error*/ |
ram54288 | 0:dbad57390bd1 | 86 | PAL_ERR_SOCKET_AUTH_ERROR = PAL_ERR_SOCKET_ERROR_BASE + 18, /*! authentication error*/ |
ram54288 | 0:dbad57390bd1 | 87 | PAL_ERR_SOCKET_OPTION_NOT_SUPPORTED = PAL_ERR_SOCKET_ERROR_BASE + 19, /*! socket option not supported*/ |
ram54288 | 0:dbad57390bd1 | 88 | //update Error |
ram54288 | 0:dbad57390bd1 | 89 | PAL_ERR_UPDATE_ERROR_BASE = (-1 << PAL_ERR_MODULE_UPDATE), /*! generic error */ |
ram54288 | 0:dbad57390bd1 | 90 | PAL_ERR_UPDATE_ERROR = PAL_ERR_UPDATE_ERROR_BASE, /*! unknown error */ |
ram54288 | 0:dbad57390bd1 | 91 | PAL_ERR_UPDATE_BUSY = PAL_ERR_UPDATE_ERROR_BASE + 1, /*! unknown error */ |
ram54288 | 0:dbad57390bd1 | 92 | PAL_ERR_UPDATE_TIMEOUT = PAL_ERR_UPDATE_ERROR_BASE + 2, /*! unknown error */ |
ram54288 | 0:dbad57390bd1 | 93 | PAL_ERR_UPDATE_OUT_OF_BOUNDS = PAL_ERR_UPDATE_ERROR_BASE + 3, /*! unknown error */ |
ram54288 | 0:dbad57390bd1 | 94 | PAL_ERR_UPDATE_PALFROM_API = PAL_ERR_UPDATE_ERROR_BASE + 4, /*! unknown error */ |
ram54288 | 0:dbad57390bd1 | 95 | PAL_ERR_UPDATE_PALFROM_IO = PAL_ERR_UPDATE_ERROR_BASE + 5, /*! unknown error */ |
ram54288 | 0:dbad57390bd1 | 96 | PAL_ERR_UPDATE_END_OF_IMAGE = PAL_ERR_UPDATE_ERROR_BASE + 6, /*! unknown error */ |
ram54288 | 0:dbad57390bd1 | 97 | PAL_ERR_UPDATE_CHUNK_TO_SMALL = PAL_ERR_UPDATE_ERROR_BASE + 7, /*! unknown error */ |
ram54288 | 0:dbad57390bd1 | 98 | |
ram54288 | 0:dbad57390bd1 | 99 | } palError_t; /*! errors returned by the pal service API */ |
ram54288 | 0:dbad57390bd1 | 100 | |
ram54288 | 0:dbad57390bd1 | 101 | |
ram54288 | 0:dbad57390bd1 | 102 | #ifdef __cplusplus |
ram54288 | 0:dbad57390bd1 | 103 | } |
ram54288 | 0:dbad57390bd1 | 104 | #endif |
ram54288 | 0:dbad57390bd1 | 105 | #endif //_PAL_ERRORS |