source: rtems/cpukit/rtems/src/semtranslatereturncode.c @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 3.7 KB
Line 
1/*
2 *  Semaphore Manager
3 *
4 *  DESCRIPTION:
5 *
6 *  This package is the implementation of the Semaphore Manager.
7 *  This manager utilizes standard Dijkstra counting semaphores to provide
8 *  synchronization and mutual exclusion capabilities.
9 *
10 *  Directives provided are:
11 *
12 *     + create a semaphore
13 *     + get an ID of a semaphore
14 *     + delete a semaphore
15 *     + acquire a semaphore
16 *     + release a semaphore
17 *
18 *  COPYRIGHT (c) 1989-2009.
19 *  On-Line Applications Research Corporation (OAR).
20 *
21 *  The license and distribution terms for this file may be
22 *  found in the file LICENSE in this distribution or at
23 *  http://www.rtems.com/license/LICENSE.
24 */
25
26#if HAVE_CONFIG_H
27#include "config.h"
28#endif
29
30#include <rtems/system.h>
31#include <rtems/rtems/status.h>
32#include <rtems/rtems/support.h>
33#include <rtems/rtems/attr.h>
34#include <rtems/score/isr.h>
35#include <rtems/score/object.h>
36#include <rtems/rtems/options.h>
37#include <rtems/rtems/sem.h>
38#include <rtems/score/coremutex.h>
39#include <rtems/score/coresem.h>
40#include <rtems/score/states.h>
41#include <rtems/score/thread.h>
42#include <rtems/score/threadq.h>
43#if defined(RTEMS_MULTIPROCESSING)
44#include <rtems/score/mpci.h>
45#endif
46#include <rtems/score/sysstate.h>
47
48#include <rtems/score/interr.h>
49
50/*
51 *  _Semaphore_Translate_core_mutex_return_code
52 *
53 *  Input parameters:
54 *    status - mutex status code to translate
55 *
56 *  Output parameters:
57 *    rtems status code - translated RTEMS status code
58 *
59 */
60
61const rtems_status_code _Semaphore_Translate_core_mutex_return_code_[] = {
62  RTEMS_SUCCESSFUL,         /* CORE_MUTEX_STATUS_SUCCESSFUL */
63  RTEMS_UNSATISFIED,        /* CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT */
64#if defined(RTEMS_POSIX_API)
65  RTEMS_UNSATISFIED,        /* CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED */
66#endif
67  RTEMS_NOT_OWNER_OF_RESOURCE, /* CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE */
68  RTEMS_OBJECT_WAS_DELETED, /* CORE_MUTEX_WAS_DELETED */
69  RTEMS_TIMEOUT,            /* CORE_MUTEX_TIMEOUT */
70#if defined(__RTEMS_STRICT_ORDER_MUTEX__)
71    123,
72#endif
73  RTEMS_INVALID_PRIORITY   /* CORE_MUTEX_STATUS_CEILING_VIOLATED */
74};
75
76rtems_status_code _Semaphore_Translate_core_mutex_return_code (
77  uint32_t   status
78)
79{
80  /*
81   *  If this thread is blocking waiting for a result on a remote operation.
82   */
83  #if defined(RTEMS_MULTIPROCESSING)
84    if ( _Thread_Is_proxy_blocking(status) )
85      return RTEMS_PROXY_BLOCKING;
86  #endif
87
88  /*
89   *  Internal consistency check for bad status from SuperCore
90   */
91  #if defined(RTEMS_DEBUG)
92    if ( status > CORE_MUTEX_STATUS_LAST )
93      return RTEMS_INTERNAL_ERROR;
94  #endif
95  return _Semaphore_Translate_core_mutex_return_code_[status];
96}
97
98/*
99 *  _Semaphore_Translate_core_semaphore_return_code
100 *
101 *  Input parameters:
102 *    status - semaphore status code to translate
103 *
104 *  Output parameters:
105 *    rtems status code - translated RTEMS status code
106 *
107 */
108
109const rtems_status_code _Semaphore_Translate_core_semaphore_return_code_[] = {
110  RTEMS_SUCCESSFUL,         /* CORE_SEMAPHORE_STATUS_SUCCESSFUL */
111  RTEMS_UNSATISFIED,        /* CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT */
112  RTEMS_OBJECT_WAS_DELETED, /* CORE_SEMAPHORE_WAS_DELETED */
113  RTEMS_TIMEOUT,            /* CORE_SEMAPHORE_TIMEOUT  */
114  RTEMS_INTERNAL_ERROR,     /* CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED */
115};
116
117rtems_status_code _Semaphore_Translate_core_semaphore_return_code (
118  uint32_t   status
119)
120{
121  #if defined(RTEMS_MULTIPROCESSING)
122    if ( _Thread_Is_proxy_blocking(status) )
123      return RTEMS_PROXY_BLOCKING;
124  #endif
125  /*
126   *  Internal consistency check for bad status from SuperCore
127   */
128  #if defined(RTEMS_DEBUG)
129    if ( status > CORE_SEMAPHORE_STATUS_LAST )
130      return RTEMS_INTERNAL_ERROR;
131  #endif
132  return _Semaphore_Translate_core_semaphore_return_code_[status];
133}
Note: See TracBrowser for help on using the repository browser.