Changeset 35b8f48a in rtems
- Timestamp:
- 12/06/13 18:21:20 (10 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 78c84df
- Parents:
- a77c3719
- git-author:
- Daniel Ramirez <javamonn@…> (12/06/13 18:21:20)
- git-committer:
- Joel Sherrill <joel.sherrill@…> (01/08/14 21:24:09)
- Location:
- cpukit
- Files:
-
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/libcsupport/Makefile.am
ra77c3719 r35b8f48a 137 137 src/sup_fs_node_type.c \ 138 138 src/sup_fs_deviceio.c \ 139 src/sup_fs_deviceerrno.c \140 139 src/clonenode.c \ 141 140 src/freenode.c \ -
cpukit/libcsupport/include/rtems/deviceio.h
ra77c3719 r35b8f48a 40 40 * IMFS device nodes onto calls to the RTEMS Classic API IO Manager. 41 41 */ 42 int rtems_deviceio_errno( rtems_status_code status );43 44 42 int rtems_deviceio_open( 45 43 rtems_libio_t *iop, -
cpukit/libcsupport/src/sup_fs_deviceio.c
ra77c3719 r35b8f48a 7 7 8 8 /* 9 * COPYRIGHT (c) 1989-201 2.9 * COPYRIGHT (c) 1989-2013. 10 10 * On-Line Applications Research Corporation (OAR). 11 11 * … … 20 20 21 21 #include <rtems/deviceio.h> 22 #include <rtems/rtems/status.h> 22 23 23 24 int rtems_deviceio_open( … … 39 40 status = rtems_io_open( major, minor, &args ); 40 41 41 return rtems_ deviceio_errno( status );42 return rtems_status_code_to_errno( status ); 42 43 } 43 44 … … 57 58 status = rtems_io_close( major, minor, &args ); 58 59 59 return rtems_ deviceio_errno( status );60 return rtems_status_code_to_errno( status ); 60 61 } 61 62 … … 84 85 return (ssize_t) args.bytes_moved; 85 86 } else { 86 return rtems_ deviceio_errno( status );87 return rtems_status_code_to_errno( status ); 87 88 } 88 89 } … … 112 113 return (ssize_t) args.bytes_moved; 113 114 } else { 114 return rtems_ deviceio_errno( status );115 return rtems_status_code_to_errno( status ); 115 116 } 116 117 } … … 135 136 return args.ioctl_return; 136 137 } else { 137 return rtems_ deviceio_errno(status);138 return rtems_status_code_to_errno(status); 138 139 } 139 140 } -
cpukit/rtems/include/rtems/rtems/status.h
ra77c3719 r35b8f48a 218 218 } 219 219 220 /** 221 * @brief RTEMS Status Code to Errno Mapping Function 222 * 223 * This function recieves an RTEMS status code and returns an 224 * errno error code. The retval values show the mappings between 225 * rtems_status_codes and errno error codes. 226 * 227 * @retval 0 RTEMS_SUCCESSFUL 228 * @retval EIO RTEMS_TASK_EXITED, RTEMS_MP_NOT_CONFIGURED, RTEMS_INVALID_ID, 229 * RTEMS_TOO_MANY, RTEMS_OBJECT_WAS_DELETED, RTEMS_INVALID_SIZE, 230 * RTEMS_INVALID_ADDRESS, RTEMS_NOT_DEFINED, RTEMS_INCORRECT_STATE, 231 * RTEMS_ILLEGAL_ON_SELF, RTEMS_ILLEGAL_ON_REMOTE_OBJECT, 232 * RTEMS_CALLED_FROM_ISR, RTEMS_INVALID_PRIORITY, RTEMS_INTERNAL_ERROR, 233 * RTEMS_IO_ERROR, RTEMS_PROXY_BLOCKING 234 * @retval EINVAL RTEMS_INVALID_NAME, RTEMS_INVALID_CLOCK, RTEMS_INVALID_NODE 235 * @retval ETIMEDOUT RTEMS_TIMEOUT 236 * @retval EBADF RTEMS_INVALID_NUMBER 237 * @retval EBUSY RTEMS_RESOURCE_IN_USE 238 * @retval ENODEV RTEMS_UNSATISFIED 239 * @retval ENOSYS RTEMS_NOT_IMPLEMENTED, RTEMS_NOT_CONFIGURED 240 * @retval ENOMEM RTEMS_NO_MEMORY 241 */ 242 int rtems_status_code_to_errno(rtems_status_code sc); 243 220 244 /**@}*/ 221 245 -
cpukit/rtems/src/status.c
ra77c3719 r35b8f48a 2 2 * @file 3 3 * 4 * @brief Status Object Name Errors to Status Array4 * @brief Status Mapping Arrays 5 5 * @ingroup ClassicStatus 6 6 */ 7 7 8 /* COPYRIGHT (c) 1989-20 08.8 /* COPYRIGHT (c) 1989-2013. 9 9 * On-Line Applications Research Corporation (OAR). 10 10 * … … 15 15 16 16 #include <rtems/rtems/statusimpl.h> 17 #include <errno.h> 17 18 18 19 const rtems_status_code _Status_Object_name_errors_to_status[] = { … … 28 29 RTEMS_INVALID_NODE 29 30 }; 31 32 static const int status_code_to_errno [RTEMS_STATUS_CODES_LAST + 1] = { 33 [RTEMS_SUCCESSFUL] = 0, 34 [RTEMS_TASK_EXITTED] = EIO, 35 [RTEMS_MP_NOT_CONFIGURED] = EIO, 36 [RTEMS_INVALID_NAME] = EINVAL, 37 [RTEMS_INVALID_ID] = EIO, 38 [RTEMS_TOO_MANY] = EIO, 39 [RTEMS_TIMEOUT] = ETIMEDOUT, 40 [RTEMS_OBJECT_WAS_DELETED] = EIO, 41 [RTEMS_INVALID_SIZE] = EIO, 42 [RTEMS_INVALID_ADDRESS] = EIO, 43 [RTEMS_INVALID_NUMBER] = EBADF, 44 [RTEMS_NOT_DEFINED] = EIO, 45 [RTEMS_RESOURCE_IN_USE] = EBUSY, 46 [RTEMS_UNSATISFIED] = ENODEV, 47 [RTEMS_INCORRECT_STATE] = EIO, 48 [RTEMS_ALREADY_SUSPENDED] = EIO, 49 [RTEMS_ILLEGAL_ON_SELF] = EIO, 50 [RTEMS_ILLEGAL_ON_REMOTE_OBJECT] = EIO, 51 [RTEMS_CALLED_FROM_ISR] = EIO, 52 [RTEMS_INVALID_PRIORITY] = EIO, 53 [RTEMS_INVALID_CLOCK] = EINVAL, 54 [RTEMS_INVALID_NODE] = EINVAL, 55 [RTEMS_NOT_CONFIGURED] = ENOSYS, 56 [RTEMS_NOT_OWNER_OF_RESOURCE] = EPERM, 57 [RTEMS_NOT_IMPLEMENTED] = ENOSYS, 58 [RTEMS_INTERNAL_ERROR] = EIO, 59 [RTEMS_NO_MEMORY] = ENOMEM, 60 [RTEMS_IO_ERROR] = EIO, 61 [RTEMS_PROXY_BLOCKING] = EIO 62 }; 63 64 int rtems_status_code_to_errno(rtems_status_code sc) 65 { 66 if (sc == RTEMS_SUCCESSFUL) { 67 return 0; 68 } else { 69 int eno = EINVAL; 70 71 if ((unsigned) sc <= RTEMS_STATUS_CODES_LAST) { 72 eno = status_code_to_errno [sc]; 73 } 74 75 errno = eno; 76 77 return -1; 78 } 79 }
Note: See TracChangeset
for help on using the changeset viewer.