Changeset 860c34e in rtems


Ignore:
Timestamp:
Nov 30, 2007, 8:34:13 PM (12 years ago)
Author:
Glenn Humphrey <glenn.humphrey@…>
Branches:
4.10, 4.11, 4.9, master
Children:
a045c9d
Parents:
8da6d77d
Message:

2007-11-30 Glenn Humphrey <glenn.humphrey@…>

  • posix/include/rtems/posix/mutex.h, posix/include/rtems/posix/semaphore.h, posix/src/cancel.c, posix/src/conddestroy.c, posix/src/condsignalsupp.c, posix/src/condwaitsupp.c, posix/src/keydelete.c, posix/src/keygetspecific.c, posix/src/keysetspecific.c, posix/src/mqueueclose.c, posix/src/mqueuegetattr.c, posix/src/mqueuenotify.c, posix/src/mqueuerecvsupp.c, posix/src/mqueuesendsupp.c, posix/src/mqueuesetattr.c, posix/src/mqueuetranslatereturncode.c, posix/src/mutexdestroy.c, posix/src/mutexgetprioceiling.c, posix/src/mutexinit.c, posix/src/mutexlocksupp.c, posix/src/mutexsetprioceiling.c, posix/src/mutexunlock.c, posix/src/pbarrierdestroy.c, posix/src/pbarriertranslatereturncode.c, posix/src/pbarrierwait.c, posix/src/prwlockdestroy.c, posix/src/prwlockrdlock.c, posix/src/prwlocktimedrdlock.c, posix/src/prwlocktimedwrlock.c, posix/src/prwlocktranslatereturncode.c, posix/src/prwlocktryrdlock.c, posix/src/prwlocktrywrlock.c, posix/src/prwlockunlock.c, posix/src/prwlockwrlock.c, posix/src/pspindestroy.c, posix/src/pspinlock.c, posix/src/pspinlocktranslatereturncode.c, posix/src/pspintrylock.c, posix/src/pspinunlock.c, posix/src/pthreaddetach.c, posix/src/pthreadequal.c, posix/src/pthreadgetschedparam.c, posix/src/pthreadjoin.c, posix/src/pthreadkill.c, posix/src/pthreadsetschedparam.c, posix/src/ptimer1.c, posix/src/semaphorewaitsupp.c, posix/src/semclose.c, posix/src/semdestroy.c, posix/src/semgetvalue.c, posix/src/sempost.c, posix/src/types.c, rtems/src/msgqtranslatereturncode.c, rtems/src/semobtain.c, rtems/src/timerfireafter.c, score/include/rtems/system.h, score/include/rtems/score/corebarrier.h, score/include/rtems/score/coremsg.h, score/include/rtems/score/coremutex.h, score/include/rtems/score/coresem.h: Restructed to move the OBJECTS_LOCAL case to the top of the switch statement and eliminate the fall-through return of POSIX_BOTTOM_REACHED. These changes produced simplier assembly code and allowed for complete test coverage. Also applied some consistency to the functions that translate the core status codes to POSIX status codes.
  • posix/src/mutextranslatereturncode.c, posix/src/semaphoretranslatereturncode.c: New files.
  • posix/src/mutexfromcorestatus.c: Removed.
Location:
cpukit
Files:
2 added
1 deleted
61 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r8da6d77d r860c34e  
     12007-11-30      Glenn Humphrey <glenn.humphrey@OARcorp.com>
     2
     3        * posix/include/rtems/posix/mutex.h,
     4        posix/include/rtems/posix/semaphore.h, posix/src/cancel.c,
     5        posix/src/conddestroy.c, posix/src/condsignalsupp.c,
     6        posix/src/condwaitsupp.c, posix/src/keydelete.c,
     7        posix/src/keygetspecific.c, posix/src/keysetspecific.c,
     8        posix/src/mqueueclose.c, posix/src/mqueuegetattr.c,
     9        posix/src/mqueuenotify.c, posix/src/mqueuerecvsupp.c,
     10        posix/src/mqueuesendsupp.c, posix/src/mqueuesetattr.c,
     11        posix/src/mqueuetranslatereturncode.c, posix/src/mutexdestroy.c,
     12        posix/src/mutexgetprioceiling.c, posix/src/mutexinit.c,
     13        posix/src/mutexlocksupp.c, posix/src/mutexsetprioceiling.c,
     14        posix/src/mutexunlock.c, posix/src/pbarrierdestroy.c,
     15        posix/src/pbarriertranslatereturncode.c, posix/src/pbarrierwait.c,
     16        posix/src/prwlockdestroy.c, posix/src/prwlockrdlock.c,
     17        posix/src/prwlocktimedrdlock.c, posix/src/prwlocktimedwrlock.c,
     18        posix/src/prwlocktranslatereturncode.c, posix/src/prwlocktryrdlock.c,
     19        posix/src/prwlocktrywrlock.c, posix/src/prwlockunlock.c,
     20        posix/src/prwlockwrlock.c, posix/src/pspindestroy.c,
     21        posix/src/pspinlock.c, posix/src/pspinlocktranslatereturncode.c,
     22        posix/src/pspintrylock.c, posix/src/pspinunlock.c,
     23        posix/src/pthreaddetach.c, posix/src/pthreadequal.c,
     24        posix/src/pthreadgetschedparam.c, posix/src/pthreadjoin.c,
     25        posix/src/pthreadkill.c, posix/src/pthreadsetschedparam.c,
     26        posix/src/ptimer1.c, posix/src/semaphorewaitsupp.c,
     27        posix/src/semclose.c, posix/src/semdestroy.c,
     28        posix/src/semgetvalue.c, posix/src/sempost.c, posix/src/types.c,
     29        rtems/src/msgqtranslatereturncode.c, rtems/src/semobtain.c,
     30        rtems/src/timerfireafter.c, score/include/rtems/system.h,
     31        score/include/rtems/score/corebarrier.h,
     32        score/include/rtems/score/coremsg.h,
     33        score/include/rtems/score/coremutex.h,
     34        score/include/rtems/score/coresem.h: Restructed to move the
     35        OBJECTS_LOCAL case to the top of the switch statement and
     36        eliminate the fall-through return of POSIX_BOTTOM_REACHED.  These
     37        changes produced simplier assembly code and allowed for complete
     38        test coverage.  Also applied some consistency to the functions
     39        that translate the core status codes to POSIX status codes.
     40        * posix/src/mutextranslatereturncode.c,
     41        posix/src/semaphoretranslatereturncode.c: New files.
     42        * posix/src/mutexfromcorestatus.c: Removed.
     43
    1442007-11-30      Joel Sherrill <joel.sherrill@oarcorp.com>
    245
  • cpukit/posix/include/rtems/posix/mutex.h

    r8da6d77d r860c34e  
    77 *  POSIX mutex's.
    88 *
    9  *  COPYRIGHT (c) 1989-1999.
     9 *  COPYRIGHT (c) 1989-2007.
    1010 *  On-Line Applications Research Corporation (OAR).
    1111 *
     
    135135
    136136/*
    137  *  _POSIX_Mutex_From_core_mutex_status
     137 *  _POSIX_Mutex_Translate_core_mutex_return_code
    138138 *
    139139 *  DESCRIPTION:
     
    143143 */
    144144
    145 int _POSIX_Mutex_From_core_mutex_status(
    146   CORE_mutex_Status  status
     145int _POSIX_Mutex_Translate_core_mutex_return_code(
     146  CORE_mutex_Status  the_mutex_status
    147147);
    148148
  • cpukit/posix/include/rtems/posix/semaphore.h

    r8da6d77d r860c34e  
    88 *  POSIX Semaphores.
    99 *
    10  *  COPYRIGHT (c) 1989-1999.
     10 *  COPYRIGHT (c) 1989-2007.
    1111 *  On-Line Applications Research Corporation (OAR).
    1212 *
     
    172172);
    173173
     174/*
     175 *  _POSIX_Semaphore_Translate_core_semaphore_return_code
     176 *
     177 *  DESCRIPTION:
     178 *
     179 *  A support routine which converts core semaphore status codes into the
     180 *  appropriate POSIX status values.
     181 */
     182
     183int _POSIX_Semaphore_Translate_core_semaphore_return_code(
     184  CORE_semaphore_Status  the_semaphore_status
     185);
     186
    174187#include <rtems/posix/semaphore.inl>
    175188#if defined(RTEMS_MULTIPROCESSING)
  • cpukit/posix/src/cancel.c

    r8da6d77d r860c34e  
    4141  the_thread = _POSIX_Threads_Get( thread, &location );
    4242  switch ( location ) {
    43 #if defined(RTEMS_MULTIPROCESSING)
    44     case OBJECTS_REMOTE:
    45 #endif
    46     case OBJECTS_ERROR:
    47       return EINVAL;
     43
    4844    case OBJECTS_LOCAL:
    4945      thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ];
     
    5147      thread_support->cancelation_requested = 1;
    5248
    53       if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
    54            thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS ) {
     49      if (thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
     50          thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS) {
    5551        _POSIX_Threads_cancel_run( the_thread );
    5652      }
     
    5854      _Thread_Enable_dispatch();
    5955      return 0;
     56
     57#if defined(RTEMS_MULTIPROCESSING)
     58    case OBJECTS_REMOTE:
     59#endif
     60    case OBJECTS_ERROR:
     61      break;
    6062  }
    6163
    62   return POSIX_BOTTOM_REACHED();
     64  return EINVAL;
    6365}
  • cpukit/posix/src/conddestroy.c

    r8da6d77d r860c34e  
    3333  the_cond = _POSIX_Condition_variables_Get( cond, &location );
    3434  switch ( location ) {
    35 #if defined(RTEMS_MULTIPROCESSING)
    36     case OBJECTS_REMOTE:
    37 #endif
    38     case OBJECTS_ERROR:
    39       return EINVAL;
    40 
    4135
    4236    case OBJECTS_LOCAL:
     
    7266      _Thread_Enable_dispatch();
    7367      return 0;
     68
     69#if defined(RTEMS_MULTIPROCESSING)
     70    case OBJECTS_REMOTE:
     71#endif
     72    case OBJECTS_ERROR:
     73      break;
    7474  }
    75   return POSIX_BOTTOM_REACHED();
     75
     76  return EINVAL;
    7677}
  • cpukit/posix/src/condsignalsupp.c

    r8da6d77d r860c34e  
    3737  the_cond = _POSIX_Condition_variables_Get( cond, &location );
    3838  switch ( location ) {
    39 #if defined(RTEMS_MULTIPROCESSING)
    40     case OBJECTS_REMOTE:
    41 #endif
    42     case OBJECTS_ERROR:
    43       return EINVAL;
    4439
    4540    case OBJECTS_LOCAL:
     
    5348
    5449      return 0;
     50
     51#if defined(RTEMS_MULTIPROCESSING)
     52    case OBJECTS_REMOTE:
     53#endif
     54    case OBJECTS_ERROR:
     55      break;
    5556  }
    56   return POSIX_BOTTOM_REACHED();
     57
     58  return EINVAL;
    5759}
  • cpukit/posix/src/condwaitsupp.c

    r8da6d77d r860c34e  
    4646  the_cond = _POSIX_Condition_variables_Get( cond, &location );
    4747  switch ( location ) {
    48 #if defined(RTEMS_MULTIPROCESSING)
    49     case OBJECTS_REMOTE:
    50 #endif
    51     case OBJECTS_ERROR:
    52       return EINVAL;
     48
    5349    case OBJECTS_LOCAL:
    5450
     
    10197
    10298      return status;
     99
     100#if defined(RTEMS_MULTIPROCESSING)
     101    case OBJECTS_REMOTE:
     102#endif
     103    case OBJECTS_ERROR:
     104      break;
    103105  }
    104   return POSIX_BOTTOM_REACHED();
     106
     107  return EINVAL;
    105108}
  • cpukit/posix/src/keydelete.c

    r8da6d77d r860c34e  
    3232  the_key = _POSIX_Keys_Get( key, &location );
    3333  switch ( location ) {
    34 #if defined(RTEMS_MULTIPROCESSING)
    35     case OBJECTS_REMOTE:   /* should never happen */
    36 #endif
    37     case OBJECTS_ERROR:
    38       return EINVAL;
     34
    3935    case OBJECTS_LOCAL:
    4036      _Objects_Close( &_POSIX_Keys_Information, &the_key->Object );
     
    5652      _Thread_Enable_dispatch();
    5753      return 0;
     54
     55#if defined(RTEMS_MULTIPROCESSING)
     56    case OBJECTS_REMOTE:   /* should never happen */
     57#endif
     58    case OBJECTS_ERROR:
     59      break;
    5860  }
    59   return POSIX_BOTTOM_REACHED();
     61
     62  return EINVAL;
    6063}
  • cpukit/posix/src/keygetspecific.c

    r8da6d77d r860c34e  
    3434  the_key = _POSIX_Keys_Get( key, &location );
    3535  switch ( location ) {
    36 #if defined(RTEMS_MULTIPROCESSING)
    37     case OBJECTS_REMOTE:   /* should never happen */
    38 #endif
    39     case OBJECTS_ERROR:
    40       return NULL;
     36
    4137    case OBJECTS_LOCAL:
    4238      api      = _Objects_Get_API( _Thread_Executing->Object.id );
     
    4541      _Thread_Enable_dispatch();
    4642      return key_data;
     43
     44#if defined(RTEMS_MULTIPROCESSING)
     45    case OBJECTS_REMOTE:   /* should never happen */
     46#endif
     47    case OBJECTS_ERROR:
     48      break;
    4749  }
    48   (void) POSIX_BOTTOM_REACHED();
    49   return (void *)NULL;
     50
     51  return NULL;
    5052}
  • cpukit/posix/src/keysetspecific.c

    r8da6d77d r860c34e  
    3434  the_key = _POSIX_Keys_Get( key, &location );
    3535  switch ( location ) {
    36 #if defined(RTEMS_MULTIPROCESSING)
    37     case OBJECTS_REMOTE:   /* should never happen */
    38 #endif
    39     case OBJECTS_ERROR:
    40       return EINVAL;
     36
    4137    case OBJECTS_LOCAL:
    4238      api   = _Objects_Get_API( _Thread_Executing->Object.id );
     
    4541      _Thread_Enable_dispatch();
    4642      return 0;
     43
     44#if defined(RTEMS_MULTIPROCESSING)
     45    case OBJECTS_REMOTE:   /* should never happen */
     46#endif
     47    case OBJECTS_ERROR:
     48      break;
    4749  }
    48   return POSIX_BOTTOM_REACHED();
     50
     51  return EINVAL;
    4952}
  • cpukit/posix/src/mqueueclose.c

    r8da6d77d r860c34e  
    4848  the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location );
    4949  switch ( location ) {
    50 #if defined(RTEMS_MULTIPROCESSING)
    51     case OBJECTS_REMOTE:
    52 #endif
    53     case OBJECTS_ERROR:
    54       rtems_set_errno_and_return_minus_one( EBADF );
    5550
    5651    case OBJECTS_LOCAL:
     
    7570      _Thread_Enable_dispatch();
    7671      return 0;
     72
     73#if defined(RTEMS_MULTIPROCESSING)
     74    case OBJECTS_REMOTE:
     75#endif
     76    case OBJECTS_ERROR:
     77      break;
    7778  }
    78   return POSIX_BOTTOM_REACHED();
     79
     80  rtems_set_errno_and_return_minus_one( EBADF );
    7981}
  • cpukit/posix/src/mqueuegetattr.c

    r8da6d77d r860c34e  
    5353  the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location );
    5454  switch ( location ) {
    55 #if defined(RTEMS_MULTIPROCESSING)
    56     case OBJECTS_REMOTE:
    57 #endif
    58     case OBJECTS_ERROR:
    59       rtems_set_errno_and_return_minus_one( EBADF );
     55
    6056    case OBJECTS_LOCAL:
    6157      the_mq = the_mq_fd->Queue;
     
    7470      _Thread_Enable_dispatch();
    7571      return 0;
     72
     73#if defined(RTEMS_MULTIPROCESSING)
     74    case OBJECTS_REMOTE:
     75#endif
     76    case OBJECTS_ERROR:
     77      break;
    7678  }
    77   return POSIX_BOTTOM_REACHED();
     79
     80  rtems_set_errno_and_return_minus_one( EBADF );
    7881}
  • cpukit/posix/src/mqueuenotify.c

    r8da6d77d r860c34e  
    7171  the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location );
    7272  switch ( location ) {
    73 #if defined(RTEMS_MULTIPROCESSING)
    74     case OBJECTS_REMOTE:
    75 #endif
    76     case OBJECTS_ERROR:
    77       rtems_set_errno_and_return_minus_one( EBADF );
     73
    7874    case OBJECTS_LOCAL:
    7975      the_mq = the_mq_fd->Queue;
     
    10298      _Thread_Enable_dispatch();
    10399      return 0;
     100
     101#if defined(RTEMS_MULTIPROCESSING)
     102    case OBJECTS_REMOTE:
     103#endif
     104    case OBJECTS_ERROR:
     105      break;
    104106  }
    105   return POSIX_BOTTOM_REACHED();
     107
     108  rtems_set_errno_and_return_minus_one( EBADF );
    106109}
  • cpukit/posix/src/mqueuerecvsupp.c

    r8da6d77d r860c34e  
    5656  the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location );
    5757  switch ( location ) {
    58 #if defined(RTEMS_MULTIPROCESSING)
    59     case OBJECTS_REMOTE:
    60 #endif
    61     case OBJECTS_ERROR:
    62       rtems_set_errno_and_return_minus_one( EBADF );
     58
    6359    case OBJECTS_LOCAL:
    6460      if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) {
     
    10298        )
    10399      );
     100
     101#if defined(RTEMS_MULTIPROCESSING)
     102    case OBJECTS_REMOTE:
     103#endif
     104    case OBJECTS_ERROR:
     105      break;
    104106  }
    105   return POSIX_BOTTOM_REACHED();
     107
     108  rtems_set_errno_and_return_minus_one( EBADF );
    106109}
  • cpukit/posix/src/mqueuesendsupp.c

    r8da6d77d r860c34e  
    6262  the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location );
    6363  switch ( location ) {
    64 #if defined(RTEMS_MULTIPROCESSING)
    65     case OBJECTS_REMOTE:
    66 #endif
    67     case OBJECTS_ERROR:
    68       rtems_set_errno_and_return_minus_one( EBADF );
    6964
    7065    case OBJECTS_LOCAL:
     
    107102        )
    108103      );
     104
     105#if defined(RTEMS_MULTIPROCESSING)
     106    case OBJECTS_REMOTE:
     107#endif
     108    case OBJECTS_ERROR:
     109      break;
    109110  }
    110   return POSIX_BOTTOM_REACHED();
     111
     112  rtems_set_errno_and_return_minus_one( EBADF );
    111113}
  • cpukit/posix/src/mqueuesetattr.c

    r8da6d77d r860c34e  
    5353  the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location );
    5454  switch ( location ) {
    55 #if defined(RTEMS_MULTIPROCESSING)
    56     case OBJECTS_REMOTE:
    57 #endif
    58     case OBJECTS_ERROR:
    59       rtems_set_errno_and_return_minus_one( EBADF );
     55
    6056    case OBJECTS_LOCAL:
    6157
     
    7672      _Thread_Enable_dispatch();
    7773      return 0;
     74
     75#if defined(RTEMS_MULTIPROCESSING)
     76    case OBJECTS_REMOTE:
     77#endif
     78    case OBJECTS_ERROR:
     79      break;
    7880  }
    79   return POSIX_BOTTOM_REACHED();
     81
     82  rtems_set_errno_and_return_minus_one( EBADF );
    8083}
  • cpukit/posix/src/mqueuetranslatereturncode.c

    r8da6d77d r860c34e  
    22 *  POSIX Message Queue Error Translation
    33 *
    4  *
    5  *  COPYRIGHT (c) 1989-1999.
     4 *  COPYRIGHT (c) 1989-2007.
    65 *  On-Line Applications Research Corporation (OAR).
    76 *
     
    1817
    1918#include <pthread.h>
    20 #include <limits.h>
    2119#include <errno.h>
    22 #include <fcntl.h>
    23 #include <mqueue.h>
    2420
    2521#include <rtems/system.h>
    26 #include <rtems/score/watchdog.h>
    27 #include <rtems/seterr.h>
    28 #include <rtems/posix/mqueue.h>
    29 #include <rtems/posix/time.h>
    30 #include <rtems/score/interr.h>
     22#include <rtems/score/coremsg.h>
    3123
    3224
     
    3931 *
    4032 *  Output parameters:
    41  *    rtems status code - translated POSIX status code
     33 *    status code - translated POSIX status code
    4234 *
    4335 */
     36
     37static
     38 int _POSIX_Message_queue_Return_codes[CORE_MESSAGE_QUEUE_STATUS_LAST + 1] = {
     39  0,                     /* CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL */
     40  EMSGSIZE,              /* CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE */
     41  EAGAIN,                /* CORE_MESSAGE_QUEUE_STATUS_TOO_MANY */
     42  ENOMEM,                /* CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED */
     43  EAGAIN,                /* CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT */
     44  EBADF,                 /* CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED */
     45  ETIMEDOUT,             /* CORE_MESSAGE_QUEUE_STATUS_TIMEOUT */
     46  ENOSYS                 /* CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT */
     47};
     48
    4449
    4550int _POSIX_Message_queue_Translate_core_message_queue_return_code(
     
    4752)
    4853{
    49   switch ( the_message_queue_status ) {
    50     case  CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL:
    51       return 0;
    52 
    53       /*
    54        *  Bad message size
    55        */
    56     case  CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE:
    57       return EMSGSIZE;
    58 
    59       /*
    60        *  Queue is full of pending messages.
    61        */
    62     case  CORE_MESSAGE_QUEUE_STATUS_TOO_MANY:
    63       return EAGAIN;
    64 
    65       /*
    66        *  Out of message buffers to queue pending message
    67        */
    68     case CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED:
    69       return ENOMEM;
    70 
    71       /*
    72        *  No message available on receive poll
    73        */
    74     case CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT:
    75       return EAGAIN;
    76 
    77       /*
    78        *  Queue was deleted while thread blocked on it.
    79        */
    80     case CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED:
    81       return EBADF;
    82 
    83       /*
    84        *  POSIX Real-Time Extensions add timeouts to send and receive.
    85        */
    86     case CORE_MESSAGE_QUEUE_STATUS_TIMEOUT:
    87       return ETIMEDOUT;
    88 
    89       /*
    90        *  RTEMS POSIX API implementation does not support multiprocessing.
    91        */
    92     case THREAD_STATUS_PROXY_BLOCKING:
    93       return ENOSYS;
    94   }
    95   _Internal_error_Occurred(
    96     INTERNAL_ERROR_POSIX_API,
    97     TRUE,
    98     the_message_queue_status
    99   );
    100   return POSIX_BOTTOM_REACHED();
     54  /*
     55   *  Internal consistency check for bad status from SuperCore
     56   */
     57  #if defined(RTEMS_DEBUG)
     58    if ( the_message_queue_status > CORE_MESSAGE_QUEUE_STATUS_LAST )
     59      return EINVAL;
     60  #endif
     61  return _POSIX_Message_queue_Return_codes[the_message_queue_status];
    10162}
  • cpukit/posix/src/mutexdestroy.c

    r8da6d77d r860c34e  
    3434  the_mutex = _POSIX_Mutex_Get( mutex, &location );
    3535  switch ( location ) {
    36 #if defined(RTEMS_MULTIPROCESSING)
    37     case OBJECTS_REMOTE:
    38 #endif
    39     case OBJECTS_ERROR:
    40       return EINVAL;
     36
    4137    case OBJECTS_LOCAL:
    4238       /*
     
    7975      _Thread_Enable_dispatch();
    8076      return 0;
     77
     78#if defined(RTEMS_MULTIPROCESSING)
     79    case OBJECTS_REMOTE:
     80#endif
     81    case OBJECTS_ERROR:
     82      break;
    8183  }
    82   return POSIX_BOTTOM_REACHED();
     84
     85  return EINVAL;
    8386}
  • cpukit/posix/src/mutexgetprioceiling.c

    r8da6d77d r860c34e  
    3838  the_mutex = _POSIX_Mutex_Get( mutex, &location );
    3939  switch ( location ) {
    40 #if defined(RTEMS_MULTIPROCESSING)
    41     case OBJECTS_REMOTE:
    42 #endif
    43     case OBJECTS_ERROR:
    44       return EINVAL;
     40
    4541    case OBJECTS_LOCAL:
    4642      *prioceiling = _POSIX_Priority_From_core(
     
    4945      _Thread_Enable_dispatch();
    5046      return 0;
     47
     48#if defined(RTEMS_MULTIPROCESSING)
     49    case OBJECTS_REMOTE:
     50#endif
     51    case OBJECTS_ERROR:
     52      break;
    5153  }
    52   return POSIX_BOTTOM_REACHED();
     54
     55  return EINVAL;
    5356}
  • cpukit/posix/src/mutexinit.c

    r8da6d77d r860c34e  
    7070   *  Joel Sherrill <joel@OARcorp.com>     14 May 1999
    7171   */
    72 
    73 
    7472#if 0
    7573  /* avoid infinite recursion on call to this routine in _POSIX_Mutex_Get */
     
    8179    mutex_in_use = _POSIX_Mutex_Get( mutex, &location );
    8280    switch ( location ) {
     81      case OBJECTS_LOCAL:
     82        _Thread_Enable_dispatch();
     83        return EBUSY;
    8384#if defined(RTEMS_MULTIPROCESSING)
    8485      case OBJECTS_REMOTE:
     
    8687      case OBJECTS_ERROR:
    8788        break;
    88       case OBJECTS_LOCAL:
    89         _Thread_Enable_dispatch();
    90         return EBUSY;
    9189    }
    9290  }
  • cpukit/posix/src/mutexlocksupp.c

    r8da6d77d r860c34e  
    4040  the_mutex = _POSIX_Mutex_Get_interrupt_disable( mutex, &location, &level );
    4141  switch ( location ) {
    42 #if defined(RTEMS_MULTIPROCESSING)
    43     case OBJECTS_REMOTE:
    44 #endif
    45     case OBJECTS_ERROR:
    46       return EINVAL;
     42
    4743    case OBJECTS_LOCAL:
    4844      _CORE_mutex_Seize(
     
    5349        level
    5450      );
    55       return _POSIX_Mutex_From_core_mutex_status(
     51      return _POSIX_Mutex_Translate_core_mutex_return_code(
    5652        (CORE_mutex_Status) _Thread_Executing->Wait.return_code
    5753      );
     54
     55#if defined(RTEMS_MULTIPROCESSING)
     56    case OBJECTS_REMOTE:
     57#endif
     58    case OBJECTS_ERROR:
     59      break;
    5860  }
    59   return POSIX_BOTTOM_REACHED();
     61
     62  return EINVAL;
    6063}
  • cpukit/posix/src/mutexsetprioceiling.c

    r8da6d77d r860c34e  
    5454  the_mutex = _POSIX_Mutex_Get( mutex, &location );
    5555  switch ( location ) {
    56 #if defined(RTEMS_MULTIPROCESSING)
    57     case OBJECTS_REMOTE:
    58 #endif
    59     case OBJECTS_ERROR:
    60       return EINVAL;        /* impossible to get here */
     56
    6157    case OBJECTS_LOCAL:
    6258      *old_ceiling = _POSIX_Priority_From_core(
     
    7571      _Thread_Enable_dispatch();
    7672      return 0;
     73
     74#if defined(RTEMS_MULTIPROCESSING)
     75    case OBJECTS_REMOTE:  /* impossible to get here */
     76#endif
     77    case OBJECTS_ERROR:
     78      break;
    7779  }
    78   return POSIX_BOTTOM_REACHED();
     80
     81  return EINVAL;
    7982}
  • cpukit/posix/src/mutexunlock.c

    r8da6d77d r860c34e  
    3737  the_mutex = _POSIX_Mutex_Get( mutex, &location );
    3838  switch ( location ) {
    39 #if defined(RTEMS_MULTIPROCESSING)
    40     case OBJECTS_REMOTE:
    41 #endif
    42     case OBJECTS_ERROR:
    43       return EINVAL;
     39
    4440    case OBJECTS_LOCAL:
    4541      status = _CORE_mutex_Surrender(
     
    5349      );
    5450      _Thread_Enable_dispatch();
    55       return _POSIX_Mutex_From_core_mutex_status( status );
     51      return _POSIX_Mutex_Translate_core_mutex_return_code( status );
     52
     53#if defined(RTEMS_MULTIPROCESSING)
     54    case OBJECTS_REMOTE:
     55#endif
     56    case OBJECTS_ERROR:
    5657      break;
    5758  }
    58   return POSIX_BOTTOM_REACHED();
     59
     60  return EINVAL;
    5961}
  • cpukit/posix/src/pbarrierdestroy.c

    r8da6d77d r860c34e  
    5050  switch ( location ) {
    5151
    52 #if defined(RTEMS_MULTIPROCESSING)
    53     case OBJECTS_REMOTE:
    54 #endif
    55     case OBJECTS_ERROR:
    56       return EINVAL;
    57 
    5852    case OBJECTS_LOCAL:
    5953      if ( the_barrier->Barrier.number_of_waiting_threads != 0 ) {
     
    6862      _Thread_Enable_dispatch();
    6963      return 0;
     64
     65#if defined(RTEMS_MULTIPROCESSING)
     66    case OBJECTS_REMOTE:
     67#endif
     68    case OBJECTS_ERROR:
     69      break;
    7070  }
    7171
    72   return POSIX_BOTTOM_REACHED();
     72  return EINVAL;
    7373}
  • cpukit/posix/src/pbarriertranslatereturncode.c

    r8da6d77d r860c34e  
    22 *  Barrier Manager -- Translate SuperCore Status
    33 *
    4  *  COPYRIGHT (c) 1989-2006.
     4 *  COPYRIGHT (c) 1989-2007.
    55 *  On-Line Applications Research Corporation (OAR).
    66 *
     
    3333 */
    3434
    35 static int _POSIX_Barrier_Return_codes[] = {
     35static int _POSIX_Barrier_Return_codes[CORE_BARRIER_STATUS_LAST + 1] = {
    3636  0,                        /* CORE_BARRIER_STATUS_SUCCESSFUL */
    3737  PTHREAD_BARRIER_SERIAL_THREAD,
     
    4646)
    4747{
    48   if ( the_barrier_status <= CORE_BARRIER_TIMEOUT )
    49     return _POSIX_Barrier_Return_codes[the_barrier_status];
    50   return POSIX_BOTTOM_REACHED();
     48  /*
     49   *  Internal consistency check for bad status from SuperCore
     50   */
     51  #if defined(RTEMS_DEBUG)
     52    if ( the_barrier_status > CORE_BARRIER_STATUS_LAST )
     53      return EINVAL;
     54  #endif
     55  return _POSIX_Barrier_Return_codes[the_barrier_status];
    5156}
  • cpukit/posix/src/pbarrierwait.c

    r8da6d77d r860c34e  
    4848  the_barrier = _POSIX_Barrier_Get( barrier, &location );
    4949  switch ( location ) {
    50 #if defined(RTEMS_MULTIPROCESSING)
    51     case OBJECTS_REMOTE:
    52 #endif
    53     case OBJECTS_ERROR:
    54       return EINVAL;
    5550
    5651    case OBJECTS_LOCAL:
     
    6661                _Thread_Executing->Wait.return_code );
    6762
     63#if defined(RTEMS_MULTIPROCESSING)
     64    case OBJECTS_REMOTE:
     65#endif
     66    case OBJECTS_ERROR:
     67      break;
    6868  }
    69   return POSIX_BOTTOM_REACHED();
     69
     70  return EINVAL;
    7071}
  • cpukit/posix/src/prwlockdestroy.c

    r8da6d77d r860c34e  
    5050  switch ( location ) {
    5151
    52 #if defined(RTEMS_MULTIPROCESSING)
    53     case OBJECTS_REMOTE:
    54 #endif
    55     case OBJECTS_ERROR:
    56       return EINVAL;
    57 
    5852    case OBJECTS_LOCAL:
    5953      /*
     
    7569      _Thread_Enable_dispatch();
    7670      return 0;
     71
     72#if defined(RTEMS_MULTIPROCESSING)
     73    case OBJECTS_REMOTE:
     74#endif
     75    case OBJECTS_ERROR:
     76      break;
    7777  }
    7878
    79   return POSIX_BOTTOM_REACHED();
     79  return EINVAL;
    8080}
  • cpukit/posix/src/prwlockrdlock.c

    r8da6d77d r860c34e  
    4848  switch ( location ) {
    4949
    50 #if defined(RTEMS_MULTIPROCESSING)
    51     case OBJECTS_REMOTE:
    52 #endif
    53     case OBJECTS_ERROR:
    54       return EINVAL;
    55 
    5650    case OBJECTS_LOCAL:
    5751
     
    6862        (CORE_RWLock_Status) _Thread_Executing->Wait.return_code
    6963      );
     64
     65#if defined(RTEMS_MULTIPROCESSING)
     66    case OBJECTS_REMOTE:
     67#endif
     68    case OBJECTS_ERROR:
     69      break;
    7070  }
    7171
    72   return POSIX_BOTTOM_REACHED();
     72  return EINVAL;
    7373}
  • cpukit/posix/src/prwlocktimedrdlock.c

    r8da6d77d r860c34e  
    5656  switch ( location ) {
    5757
    58 #if defined(RTEMS_MULTIPROCESSING)
    59     case OBJECTS_REMOTE:
    60 #endif
    61     case OBJECTS_ERROR:
    62       return EINVAL;
    63 
    6458    case OBJECTS_LOCAL:
    6559
     
    7670        (CORE_RWLock_Status) _Thread_Executing->Wait.return_code
    7771      );
     72
     73#if defined(RTEMS_MULTIPROCESSING)
     74    case OBJECTS_REMOTE:
     75#endif
     76    case OBJECTS_ERROR:
     77      break;
    7878  }
    7979
    80   return POSIX_BOTTOM_REACHED();
     80  return EINVAL;
    8181}
  • cpukit/posix/src/prwlocktimedwrlock.c

    r8da6d77d r860c34e  
    5656  switch ( location ) {
    5757
    58 #if defined(RTEMS_MULTIPROCESSING)
    59     case OBJECTS_REMOTE:
    60 #endif
    61     case OBJECTS_ERROR:
    62       return EINVAL;
    63 
    6458    case OBJECTS_LOCAL:
    6559
     
    7670        (CORE_RWLock_Status) _Thread_Executing->Wait.return_code
    7771      );
     72
     73#if defined(RTEMS_MULTIPROCESSING)
     74    case OBJECTS_REMOTE:
     75#endif
     76    case OBJECTS_ERROR:
     77      break;
    7878  }
    7979
    80   return POSIX_BOTTOM_REACHED();
     80  return EINVAL;
    8181}
  • cpukit/posix/src/prwlocktranslatereturncode.c

    r8da6d77d r860c34e  
    22 *  RWLock Manager -- Translate SuperCore Status
    33 *
    4  *  COPYRIGHT (c) 1989-2006.
     4 *  COPYRIGHT (c) 1989-2007.
    55 *  On-Line Applications Research Corporation (OAR).
    66 *
     
    3333 */
    3434
    35 /* XXX fix me */
    36 static int _POSIX_RWLock_Return_codes[] = {
     35static int _POSIX_RWLock_Return_codes[CORE_RWLOCK_STATUS_LAST + 1] = {
    3736  0,                        /* CORE_RWLOCK_SUCCESSFUL */
    3837  EINVAL,                   /* CORE_RWLOCK_DELETED */
     
    4645)
    4746{
    48   if ( the_rwlock_status <= CORE_RWLOCK_STATUS_LAST )
    49     return _POSIX_RWLock_Return_codes[the_rwlock_status];
    50   return POSIX_BOTTOM_REACHED();
     47  /*
     48   *  Internal consistency check for bad status from SuperCore
     49   */
     50  #if defined(RTEMS_DEBUG)
     51    if ( the_rwlock_status > CORE_RWLOCK_STATUS_LAST )
     52      return EINVAL;
     53  #endif
     54  return _POSIX_RWLock_Return_codes[the_rwlock_status];
    5155}
  • cpukit/posix/src/prwlocktryrdlock.c

    r8da6d77d r860c34e  
    4848  switch ( location ) {
    4949
    50 #if defined(RTEMS_MULTIPROCESSING)
    51     case OBJECTS_REMOTE:
    52 #endif
    53     case OBJECTS_ERROR:
    54       return EINVAL;
    55 
    5650    case OBJECTS_LOCAL:
    5751
     
    6963        (CORE_RWLock_Status) _Thread_Executing->Wait.return_code
    7064      );
     65
     66#if defined(RTEMS_MULTIPROCESSING)
     67    case OBJECTS_REMOTE:
     68#endif
     69    case OBJECTS_ERROR:
     70      break;
    7171  }
    7272
    73   return POSIX_BOTTOM_REACHED();
     73  return EINVAL;
    7474}
  • cpukit/posix/src/prwlocktrywrlock.c

    r8da6d77d r860c34e  
    4848  switch ( location ) {
    4949
    50 #if defined(RTEMS_MULTIPROCESSING)
    51     case OBJECTS_REMOTE:
    52 #endif
    53     case OBJECTS_ERROR:
    54       return EINVAL;
    55 
    5650    case OBJECTS_LOCAL:
    5751
     
    6862        (CORE_RWLock_Status) _Thread_Executing->Wait.return_code
    6963      );
     64
     65#if defined(RTEMS_MULTIPROCESSING)
     66    case OBJECTS_REMOTE:
     67#endif
     68    case OBJECTS_ERROR:
     69      break;
    7070  }
    7171
    72   return POSIX_BOTTOM_REACHED();
     72  return EINVAL;
    7373}
  • cpukit/posix/src/prwlockunlock.c

    r8da6d77d r860c34e  
    4949  switch ( location ) {
    5050
     51    case OBJECTS_LOCAL:
     52      status = _CORE_RWLock_Release( &the_rwlock->RWLock );
     53      _Thread_Enable_dispatch();
     54      return _POSIX_RWLock_Translate_core_RWLock_return_code( status );
     55
    5156#if defined(RTEMS_MULTIPROCESSING)
    5257    case OBJECTS_REMOTE:
    5358#endif
    5459    case OBJECTS_ERROR:
    55       return EINVAL;
    56 
    57     case OBJECTS_LOCAL:
    58       status = _CORE_RWLock_Release( &the_rwlock->RWLock );
    59       _Thread_Enable_dispatch();
    60       return _POSIX_RWLock_Translate_core_RWLock_return_code( status );
     60      break;
    6161  }
    6262
    63   return POSIX_BOTTOM_REACHED();
     63  return EINVAL;
    6464}
  • cpukit/posix/src/prwlockwrlock.c

    r8da6d77d r860c34e  
    4848  switch ( location ) {
    4949
    50 #if defined(RTEMS_MULTIPROCESSING)
    51     case OBJECTS_REMOTE:
    52 #endif
    53     case OBJECTS_ERROR:
    54       return EINVAL;
    55 
    5650    case OBJECTS_LOCAL:
    5751
     
    6862        (CORE_RWLock_Status) _Thread_Executing->Wait.return_code
    6963      );
     64
     65#if defined(RTEMS_MULTIPROCESSING)
     66    case OBJECTS_REMOTE:
     67#endif
     68    case OBJECTS_ERROR:
     69      break;
    7070  }
    7171
    72   return POSIX_BOTTOM_REACHED();
     72  return EINVAL;
    7373}
  • cpukit/posix/src/pspindestroy.c

    r8da6d77d r860c34e  
    5050  switch ( location ) {
    5151
    52 #if defined(RTEMS_MULTIPROCESSING)
    53     case OBJECTS_REMOTE:
    54 #endif
    55     case OBJECTS_ERROR:
    56       return EINVAL;
    57 
    5852    case OBJECTS_LOCAL:
    5953      if ( _CORE_spinlock_Is_busy( &the_spinlock->Spinlock ) ) {
     
    6862      _Thread_Enable_dispatch();
    6963      return 0;
     64
     65#if defined(RTEMS_MULTIPROCESSING)
     66    case OBJECTS_REMOTE:
     67#endif
     68    case OBJECTS_ERROR:
     69      break;
    7070  }
    7171
    72   return POSIX_BOTTOM_REACHED();
     72  return EINVAL;
    7373}
  • cpukit/posix/src/pspinlock.c

    r8da6d77d r860c34e  
    4848  the_spinlock = _POSIX_Spinlock_Get( spinlock, &location );
    4949  switch ( location ) {
    50 #if defined(RTEMS_MULTIPROCESSING)
    51     case OBJECTS_REMOTE:
    52 #endif
    53     case OBJECTS_ERROR:
    54       return EINVAL;
    5550
    5651    case OBJECTS_LOCAL:
     
    5853      _Thread_Enable_dispatch();
    5954      return _POSIX_Spinlock_Translate_core_spinlock_return_code( status );
     55
     56#if defined(RTEMS_MULTIPROCESSING)
     57    case OBJECTS_REMOTE:
     58#endif
     59    case OBJECTS_ERROR:
     60      break;
    6061  }
    61   return POSIX_BOTTOM_REACHED();
     62
     63  return EINVAL;
    6264}
  • cpukit/posix/src/pspinlocktranslatereturncode.c

    r8da6d77d r860c34e  
    22 *  Spinlock Manager -- Translate SuperCore Status
    33 *
    4  *  COPYRIGHT (c) 1989-2006.
     4 *  COPYRIGHT (c) 1989-2007.
    55 *  On-Line Applications Research Corporation (OAR).
    66 *
     
    2020
    2121#include <rtems/system.h>
    22 #include <rtems/posix/spinlock.h>
     22#include <rtems/score/corespinlock.h>
    2323
    2424/*
     
    3333 */
    3434
    35 /* XXX fix me */
    36 static int _POSIX_Spinlock_Return_codes[] = {
     35static int _POSIX_Spinlock_Return_codes[CORE_SPINLOCK_STATUS_LAST + 1] = {
    3736  0,                        /* CORE_SPINLOCK_SUCCESSFUL */
    3837  EDEADLK,                  /* CORE_SPINLOCK_HOLDER_RELOCKING */
     
    4948)
    5049{
    51   if ( the_spinlock_status <= CORE_SPINLOCK_STATUS_LAST )
    52     return _POSIX_Spinlock_Return_codes[the_spinlock_status];
    53   return POSIX_BOTTOM_REACHED();
     50  /*
     51   *  Internal consistency check for bad status from SuperCore
     52   */
     53  #if defined(RTEMS_DEBUG)
     54    if ( the_spinlock_status > CORE_SPINLOCK_STATUS_LAST )
     55      return EINVAL;
     56  #endif
     57  return _POSIX_Spinlock_Return_codes[the_spinlock_status];
    5458}
  • cpukit/posix/src/pspintrylock.c

    r8da6d77d r860c34e  
    4848  the_spinlock = _POSIX_Spinlock_Get( spinlock, &location );
    4949  switch ( location ) {
    50 #if defined(RTEMS_MULTIPROCESSING)
    51     case OBJECTS_REMOTE:
    52 #endif
    53     case OBJECTS_ERROR:
    54       return EINVAL;
    5550
    5651    case OBJECTS_LOCAL:
     
    5853      _Thread_Enable_dispatch();
    5954      return _POSIX_Spinlock_Translate_core_spinlock_return_code( status );
     55
     56#if defined(RTEMS_MULTIPROCESSING)
     57    case OBJECTS_REMOTE:
     58#endif
     59    case OBJECTS_ERROR:
     60      break;
    6061  }
    61   return POSIX_BOTTOM_REACHED();
     62
     63  return EINVAL;
    6264}
  • cpukit/posix/src/pspinunlock.c

    r8da6d77d r860c34e  
    4848  the_spinlock = _POSIX_Spinlock_Get( spinlock, &location );
    4949  switch ( location ) {
    50 #if defined(RTEMS_MULTIPROCESSING)
    51     case OBJECTS_REMOTE:
    52 #endif
    53     case OBJECTS_ERROR:
    54       return EINVAL;
    5550
    5651    case OBJECTS_LOCAL:
     
    5853      _Thread_Enable_dispatch();
    5954      return _POSIX_Spinlock_Translate_core_spinlock_return_code( status );
     55
     56#if defined(RTEMS_MULTIPROCESSING)
     57    case OBJECTS_REMOTE:
     58#endif
     59    case OBJECTS_ERROR:
     60      break;
    6061  }
    61   return POSIX_BOTTOM_REACHED();
     62
     63  return EINVAL;
    6264}
  • cpukit/posix/src/pthreaddetach.c

    r8da6d77d r860c34e  
    3333  the_thread = _POSIX_Threads_Get( thread, &location );
    3434  switch ( location ) {
    35 #if defined(RTEMS_MULTIPROCESSING)
    36     case OBJECTS_REMOTE:
    37 #endif
    38     case OBJECTS_ERROR:
    39       return ESRCH;
     35
    4036    case OBJECTS_LOCAL:
    4137
     
    4440      _Thread_Enable_dispatch();
    4541      return 0;
     42
     43#if defined(RTEMS_MULTIPROCESSING)
     44    case OBJECTS_REMOTE:
     45#endif
     46    case OBJECTS_ERROR:
     47      break;
    4648  }
    4749
    48   return POSIX_BOTTOM_REACHED();
     50  return ESRCH;
    4951}
  • cpukit/posix/src/pthreadequal.c

    r8da6d77d r860c34e  
    5454  (void) _POSIX_Threads_Get( t1, &location );
    5555  switch ( location ) {
    56 #if defined(RTEMS_MULTIPROCESSING)
    57     case OBJECTS_REMOTE:
    58 #endif
    59     case OBJECTS_ERROR:
    60       /* return status == 0 */
    61       break;
    6256
    6357    case OBJECTS_LOCAL:
     
    6963      (void) _POSIX_Threads_Get( t2, &location );
    7064      switch ( location ) {
     65
     66        case OBJECTS_LOCAL:
     67          status = _Objects_Are_ids_equal( t1, t2 );
     68          _Thread_Unnest_dispatch();
     69          _Thread_Enable_dispatch();
     70          break;
     71
    7172        case OBJECTS_ERROR:
    7273        case OBJECTS_REMOTE:
     
    7576          /* return status == 0 */
    7677          break;
    77         case OBJECTS_LOCAL:
    78           status = _Objects_Are_ids_equal( t1, t2 );
    79           _Thread_Unnest_dispatch();
    80           _Thread_Enable_dispatch();
    81           break;
    8278      }
    8379      break;
     80
     81#if defined(RTEMS_MULTIPROCESSING)
     82    case OBJECTS_REMOTE:
     83#endif
     84    case OBJECTS_ERROR:
     85      /* return status == 0 */
     86      break;
    8487  }
     88
    8589  return status;
    8690#endif
  • cpukit/posix/src/pthreadgetschedparam.c

    r8da6d77d r860c34e  
    3939  the_thread = _POSIX_Threads_Get( thread, &location );
    4040  switch ( location ) {
    41 #if defined(RTEMS_MULTIPROCESSING)
    42     case OBJECTS_REMOTE:
    43 #endif
    44     case OBJECTS_ERROR:
    45       return ESRCH;
     41
    4642    case OBJECTS_LOCAL:
    4743      api = the_thread->API_Extensions[ THREAD_API_POSIX ];
     
    5551      _Thread_Enable_dispatch();
    5652      return 0;
     53
     54#if defined(RTEMS_MULTIPROCESSING)
     55    case OBJECTS_REMOTE:
     56#endif
     57    case OBJECTS_ERROR:
     58      break;
    5759  }
    5860
    59   return POSIX_BOTTOM_REACHED();
     61  return ESRCH;
    6062
    6163}
  • cpukit/posix/src/pthreadjoin.c

    r8da6d77d r860c34e  
    3535  the_thread = _POSIX_Threads_Get( thread, &location );
    3636  switch ( location ) {
    37 #if defined(RTEMS_MULTIPROCESSING)
    38     case OBJECTS_REMOTE:
    39 #endif
    40     case OBJECTS_ERROR:
    41       return ESRCH;
     37
    4238    case OBJECTS_LOCAL:
    4339      api = the_thread->API_Extensions[ THREAD_API_POSIX ];
     
    6864        *value_ptr = return_pointer;
    6965      return 0;
     66
     67#if defined(RTEMS_MULTIPROCESSING)
     68    case OBJECTS_REMOTE:
     69#endif
     70    case OBJECTS_ERROR:
     71      break;
    7072  }
    7173
    72   return POSIX_BOTTOM_REACHED();
     74  return ESRCH;
    7375}
  • cpukit/posix/src/pthreadkill.c

    r8da6d77d r860c34e  
    4848  the_thread = _POSIX_Threads_Get( thread, &location );
    4949  switch ( location ) {
    50 #if defined(RTEMS_MULTIPROCESSING)
    51     case OBJECTS_REMOTE:
    52 #endif
    53     case OBJECTS_ERROR:
    54       rtems_set_errno_and_return_minus_one( ESRCH );
     50
    5551    case OBJECTS_LOCAL:
    5652      /*
     
    8076      _Thread_Enable_dispatch();
    8177      return 0;
     78
     79#if defined(RTEMS_MULTIPROCESSING)
     80    case OBJECTS_REMOTE:
     81#endif
     82    case OBJECTS_ERROR:
     83      break;
    8284  }
    8385
    84   return POSIX_BOTTOM_REACHED();
     86  rtems_set_errno_and_return_minus_one( ESRCH );
    8587}
  • cpukit/posix/src/pthreadsetschedparam.c

    r8da6d77d r860c34e  
    8787  the_thread = _POSIX_Threads_Get( thread, &location );
    8888  switch ( location ) {
    89 #if defined(RTEMS_MULTIPROCESSING)
    90     case OBJECTS_REMOTE:
    91 #endif
    92     case OBJECTS_ERROR:
    93       return ESRCH;
     89
    9490    case OBJECTS_LOCAL:
    9591      api = the_thread->API_Extensions[ THREAD_API_POSIX ];
     
    128124      _Thread_Enable_dispatch();
    129125      return 0;
     126
     127#if defined(RTEMS_MULTIPROCESSING)
     128    case OBJECTS_REMOTE:
     129#endif
     130    case OBJECTS_ERROR:
     131      break;
    130132  }
    131   return POSIX_BOTTOM_REACHED();
     133
     134  return ESRCH;
    132135}
  • cpukit/posix/src/ptimer1.c

    r8da6d77d r860c34e  
    229229  ptimer = _POSIX_Timer_Get( timerid, &location );
    230230  switch ( location ) {
    231 #if defined(RTEMS_MULTIPROCESSING)
    232     case OBJECTS_REMOTE:
    233       _Thread_Dispatch();
    234       rtems_set_errno_and_return_minus_one( EINVAL );
    235 #endif
    236 
    237     case OBJECTS_ERROR:
    238       rtems_set_errno_and_return_minus_one( EINVAL );
    239231
    240232    case OBJECTS_LOCAL:
     
    245237      _Thread_Enable_dispatch();
    246238      return 0;
    247   }
    248   return -1;   /* unreached - only to remove warnings */
     239
     240#if defined(RTEMS_MULTIPROCESSING)
     241    case OBJECTS_REMOTE:
     242#endif
     243    case OBJECTS_ERROR:
     244      break;
     245  }
     246
     247  rtems_set_errno_and_return_minus_one( EINVAL );
    249248}
    250249
     
    293292  ptimer = _POSIX_Timer_Get( timerid, &location );
    294293  switch ( location ) {
    295 #if defined(RTEMS_MULTIPROCESSING)
    296     case OBJECTS_REMOTE:
    297       _Thread_Dispatch();
    298       return -1;
    299      rtems_set_errno_and_return_minus_one( EINVAL );
    300 #endif
    301 
    302     case OBJECTS_ERROR:
    303       return -1;
    304294
    305295    case OBJECTS_LOCAL:
     
    377367      }
    378368      _Thread_Enable_dispatch();
    379       rtems_set_errno_and_return_minus_one( EINVAL );
    380   }
    381   return -1;   /* unreached - only to remove warnings */
     369      break;
     370
     371#if defined(RTEMS_MULTIPROCESSING)
     372    case OBJECTS_REMOTE:
     373#endif
     374    case OBJECTS_ERROR:
     375      break;
     376  }
     377
     378  rtems_set_errno_and_return_minus_one( EINVAL );
    382379}
    383380
     
    417414  ptimer = _POSIX_Timer_Get( timerid, &location );
    418415  switch ( location ) {
    419 #if defined(RTEMS_MULTIPROCESSING)
    420     case OBJECTS_REMOTE:
    421       _Thread_Dispatch();
    422       rtems_set_errno_and_return_minus_one( EINVAL );
    423 #endif
    424 
    425     case OBJECTS_ERROR:
    426       rtems_set_errno_and_return_minus_one( EINVAL );
    427416
    428417    case OBJECTS_LOCAL:
     
    440429      _Thread_Enable_dispatch();
    441430      return 0;
    442   }
    443   return -1;   /* unreached - only to remove warnings */
     431
     432#if defined(RTEMS_MULTIPROCESSING)
     433    case OBJECTS_REMOTE:
     434#endif
     435    case OBJECTS_ERROR:
     436      break;
     437  }
     438
     439  rtems_set_errno_and_return_minus_one( EINVAL );
    444440}
    445441
     
    466462  ptimer = _POSIX_Timer_Get( timerid, &location );
    467463  switch ( location ) {
    468 #if defined(RTEMS_MULTIPROCESSING)
    469     case OBJECTS_REMOTE:
    470       _Thread_Dispatch();
    471       rtems_set_errno_and_return_minus_one( EINVAL );
    472 #endif
    473 
    474     case OBJECTS_ERROR:
    475       rtems_set_errno_and_return_minus_one( EINVAL );
    476464
    477465    case OBJECTS_LOCAL:
     
    480468      _Thread_Enable_dispatch();
    481469      return overrun;
    482   }
    483   return -1;   /* unreached - only to remove warnings */
    484 }
     470
     471#if defined(RTEMS_MULTIPROCESSING)
     472    case OBJECTS_REMOTE:
     473#endif
     474    case OBJECTS_ERROR:
     475      break;
     476  }
     477
     478  rtems_set_errno_and_return_minus_one( EINVAL );
     479}
  • cpukit/posix/src/semaphorewaitsupp.c

    r8da6d77d r860c34e  
    3737  the_semaphore = _POSIX_Semaphore_Get( sem, &location );
    3838  switch ( location ) {
    39 #if defined(RTEMS_MULTIPROCESSING)
    40     case OBJECTS_REMOTE:
    41 #endif
    42     case OBJECTS_ERROR:
    43       rtems_set_errno_and_return_minus_one( EINVAL );
     39
    4440    case OBJECTS_LOCAL:
    4541      _CORE_semaphore_Seize(
     
    5046      );
    5147      _Thread_Enable_dispatch();
    52       switch ( _Thread_Executing->Wait.return_code ) {
    53         case CORE_SEMAPHORE_STATUS_SUCCESSFUL:
    54           break;
    55         case CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT:
    56           rtems_set_errno_and_return_minus_one( EAGAIN );
    57         case CORE_SEMAPHORE_WAS_DELETED:
    58           rtems_set_errno_and_return_minus_one( EAGAIN );
    59         case CORE_SEMAPHORE_TIMEOUT:
    60           rtems_set_errno_and_return_minus_one( ETIMEDOUT );
    61           break;
    62         case CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED:
    63           /*
    64            *  This error can not occur since we set the maximum
    65            *  count to the largest value the count can hold.
    66            */
    67           break;
    68         case CORE_SEMAPHORE_BAD_TIMEOUT_VALUE:
    69           rtems_set_errno_and_return_minus_one( EINVAL );
    70           break;
    71       }
     48
     49      if ( !_Thread_Executing->Wait.return_code )
     50        return 0;
     51
     52      rtems_set_errno_and_return_minus_one(
     53        _POSIX_Semaphore_Translate_core_semaphore_return_code(
     54          _Thread_Executing->Wait.return_code
     55        )
     56      );
     57
     58#if defined(RTEMS_MULTIPROCESSING)
     59    case OBJECTS_REMOTE:
     60#endif
     61    case OBJECTS_ERROR:
     62      break;
    7263  }
    73   return 0;
     64
     65  rtems_set_errno_and_return_minus_one( EINVAL );
    7466}
  • cpukit/posix/src/semclose.c

    r8da6d77d r860c34e  
    4040  the_semaphore = _POSIX_Semaphore_Get( sem, &location );
    4141  switch ( location ) {
    42 #if defined(RTEMS_MULTIPROCESSING)
    43     case OBJECTS_REMOTE:
    44 #endif
    45     case OBJECTS_ERROR:
    46       rtems_set_errno_and_return_minus_one( EINVAL );
     42
    4743    case OBJECTS_LOCAL:
    4844      the_semaphore->open_count -= 1;
     
    5046      _Thread_Enable_dispatch();
    5147      return 0;
     48
     49#if defined(RTEMS_MULTIPROCESSING)
     50    case OBJECTS_REMOTE:
     51#endif
     52    case OBJECTS_ERROR:
     53      break;
    5254  }
    53   return POSIX_BOTTOM_REACHED();
     55
     56  rtems_set_errno_and_return_minus_one( EINVAL );
    5457}
  • cpukit/posix/src/semdestroy.c

    r8da6d77d r860c34e  
    3535  the_semaphore = _POSIX_Semaphore_Get( sem, &location );
    3636  switch ( location ) {
    37 #if defined(RTEMS_MULTIPROCESSING)
    38     case OBJECTS_REMOTE:
    39 #endif
    40     case OBJECTS_ERROR:
    41       rtems_set_errno_and_return_minus_one( EINVAL );
     37
    4238    case OBJECTS_LOCAL:
    4339      /*
     
    5349      _Thread_Enable_dispatch();
    5450      return 0;
     51
     52#if defined(RTEMS_MULTIPROCESSING)
     53    case OBJECTS_REMOTE:
     54#endif
     55    case OBJECTS_ERROR:
     56      break;
    5557  }
    56   return POSIX_BOTTOM_REACHED();
     58
     59  rtems_set_errno_and_return_minus_one( EINVAL );
    5760}
  • cpukit/posix/src/semgetvalue.c

    r8da6d77d r860c34e  
    3636  the_semaphore = _POSIX_Semaphore_Get( sem, &location );
    3737  switch ( location ) {
     38
     39    case OBJECTS_LOCAL:
     40      *sval = _CORE_semaphore_Get_count( &the_semaphore->Semaphore );
     41      _Thread_Enable_dispatch();
     42      return 0;
     43
    3844#if defined(RTEMS_MULTIPROCESSING)
    3945    case OBJECTS_REMOTE:
    4046#endif
    4147    case OBJECTS_ERROR:
    42       rtems_set_errno_and_return_minus_one( EINVAL );
    43     case OBJECTS_LOCAL:
    44       *sval = _CORE_semaphore_Get_count( &the_semaphore->Semaphore );
    45       _Thread_Enable_dispatch();
    46       return 0;
     48      break;
    4749  }
    48   return POSIX_BOTTOM_REACHED();
     50
     51  rtems_set_errno_and_return_minus_one( EINVAL );
    4952}
  • cpukit/posix/src/sempost.c

    r8da6d77d r860c34e  
    3535  the_semaphore = _POSIX_Semaphore_Get( sem, &location );
    3636  switch ( location ) {
    37 #if defined(RTEMS_MULTIPROCESSING)
    38     case OBJECTS_REMOTE:
    39 #endif
    40     case OBJECTS_ERROR:
    41       rtems_set_errno_and_return_minus_one( EINVAL );
     37
    4238    case OBJECTS_LOCAL:
    4339      _CORE_semaphore_Surrender(
     
    5248      _Thread_Enable_dispatch();
    5349      return 0;
     50
     51#if defined(RTEMS_MULTIPROCESSING)
     52    case OBJECTS_REMOTE:
     53#endif
     54    case OBJECTS_ERROR:
     55      break;
    5456  }
    55   return POSIX_BOTTOM_REACHED();
     57
     58  rtems_set_errno_and_return_minus_one( EINVAL );
    5659}
  • cpukit/posix/src/types.c

    r8da6d77d r860c34e  
    2424#include <assert.h>
    2525
    26 int POSIX_BOTTOM_REACHED()
    27 {
    28   assert( 0 );
    29   return 0;
    30 }
    31 
    3226int POSIX_NOT_IMPLEMENTED()
    3327{
  • cpukit/rtems/src/msgqtranslatereturncode.c

    r8da6d77d r860c34e  
    33 *
    44 *
    5  *  COPYRIGHT (c) 1989-1999.
     5 *  COPYRIGHT (c) 1989-2007.
    66 *  On-Line Applications Research Corporation (OAR).
    77 *
     
    6161)
    6262{
    63 #if defined(RTEMS_MULTIPROCESSING)
    64   if ( status == THREAD_STATUS_PROXY_BLOCKING )
    65     return RTEMS_PROXY_BLOCKING;
    66   else
    67 #endif
    68   if ( status > CORE_MESSAGE_QUEUE_STATUS_TIMEOUT )
    69     return RTEMS_INTERNAL_ERROR;
    70   else
    71     return _Message_queue_Translate_core_return_code_[status];
     63  /*
     64   *  Check for proxy blocking first since it is out of range
     65   *  from the external status codes.
     66   */
     67  #if defined(RTEMS_MULTIPROCESSING)
     68    if ( status == THREAD_STATUS_PROXY_BLOCKING )
     69      return RTEMS_PROXY_BLOCKING;
     70  #endif
     71
     72  /*
     73   *  Internal consistency check for bad status from SuperCore
     74   */
     75  #if defined(RTEMS_DEBUG)
     76    if ( status > CORE_MESSAGE_QUEUE_STATUS_TIMEOUT )
     77      return RTEMS_INTERNAL_ERROR;
     78  #endif
     79
     80  return _Message_queue_Translate_core_return_code_[status];
    7281}
  • cpukit/rtems/src/semobtain.c

    r8da6d77d r860c34e  
    7878  the_semaphore = _Semaphore_Get_interrupt_disable( id, &location, &level );
    7979  switch ( location ) {
    80 #if defined(RTEMS_MULTIPROCESSING)
    81     case OBJECTS_REMOTE:
    82       return _Semaphore_MP_Send_request_packet(
    83           SEMAPHORE_MP_OBTAIN_REQUEST,
    84           id,
    85           option_set,
    86           timeout
    87       );
    88 #endif
    89 
    90     case OBJECTS_ERROR:
    91       return RTEMS_INVALID_ID;
    92 
    9380    case OBJECTS_LOCAL:
    9481      if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) {
     
    115102      return _Semaphore_Translate_core_semaphore_return_code(
    116103                  _Thread_Executing->Wait.return_code );
     104
     105#if defined(RTEMS_MULTIPROCESSING)
     106    case OBJECTS_REMOTE:
     107      return _Semaphore_MP_Send_request_packet(
     108          SEMAPHORE_MP_OBTAIN_REQUEST,
     109          id,
     110          option_set,
     111          timeout
     112      );
     113#endif
     114
     115    case OBJECTS_ERROR:
     116      break;
     117
    117118  }
    118119
    119   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     120  return RTEMS_INVALID_ID;
    120121}
  • cpukit/rtems/src/timerfireafter.c

    r8da6d77d r860c34e  
    6262  the_timer = _Timer_Get( id, &location );
    6363  switch ( location ) {
    64 #if defined(RTEMS_MULTIPROCESSING)
    65     case OBJECTS_REMOTE:            /* should never return this */
    66       return RTEMS_INTERNAL_ERROR;
    67 #endif
    68 
    69     case OBJECTS_ERROR:
    70       return RTEMS_INVALID_ID;
    7164
    7265    case OBJECTS_LOCAL:
     
    9992      _Thread_Enable_dispatch();
    10093      return RTEMS_SUCCESSFUL;
     94
     95#if defined(RTEMS_MULTIPROCESSING)
     96    case OBJECTS_REMOTE:            /* should never return this */
     97#endif
     98    case OBJECTS_ERROR:
     99      break;
    101100  }
    102101
    103   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     102  return RTEMS_INVALID_ID;
    104103}
  • cpukit/score/include/rtems/score/corebarrier.h

    r8da6d77d r860c34e  
    77
    88/*
    9  *  COPYRIGHT (c) 1989-2006.
     9 *  COPYRIGHT (c) 1989-2007.
    1010 *  On-Line Applications Research Corporation (OAR).
    1111 *
     
    8181  CORE_BARRIER_TIMEOUT
    8282}   CORE_barrier_Status;
     83
     84/**
     85 *  @brief Core Barrier Last Status
     86 *
     87 *  This is the last status value.
     88 */
     89#define CORE_BARRIER_STATUS_LAST CORE_BARRIER_TIMEOUT
    8390
    8491/**
  • cpukit/score/include/rtems/score/coremsg.h

    r8da6d77d r860c34e  
    77
    88/*
    9  *  COPYRIGHT (c) 1989-2006.
     9 *  COPYRIGHT (c) 1989-2007.
    1010 *  On-Line Applications Research Corporation (OAR).
    1111 *
     
    149149  CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT
    150150}   CORE_message_queue_Status;
     151
     152/**
     153 *  @brief Core Message Queue Last Status
     154 *
     155 *  This is the last status value.
     156 */
     157#define CORE_MESSAGE_QUEUE_STATUS_LAST CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT
    151158
    152159/**
  • cpukit/score/include/rtems/score/coremutex.h

    r8da6d77d r860c34e  
    99
    1010/*
    11  *  COPYRIGHT (c) 1989-2006.
     11 *  COPYRIGHT (c) 1989-2007.
    1212 *  On-Line Applications Research Corporation (OAR).
    1313 *
     
    107107  CORE_MUTEX_STATUS_CEILING_VIOLATED
    108108}   CORE_mutex_Status;
     109
     110/**
     111 *  @brief Core Mutex Last Status
     112 *
     113 *  This is the last status value.
     114 */
     115#define CORE_MUTEX_STATUS_LAST CORE_MUTEX_STATUS_CEILING_VIOLATED
    109116
    110117/**
  • cpukit/score/include/rtems/score/coresem.h

    r8da6d77d r860c34e  
    99
    1010/*
    11  *  COPYRIGHT (c) 1989-2006.
     11 *  COPYRIGHT (c) 1989-2007.
    1212 *  On-Line Applications Research Corporation (OAR).
    1313 *
     
    9292  CORE_SEMAPHORE_BAD_TIMEOUT_VALUE
    9393}   CORE_semaphore_Status;
     94
     95/**
     96 *  @brief Core Semaphore Last Status
     97 *
     98 *  This is the last status value.
     99 */
     100#define CORE_SEMAPHORE_STATUS_LAST CORE_SEMAPHORE_BAD_TIMEOUT_VALUE
    94101
    95102/**
  • cpukit/score/include/rtems/system.h

    r8da6d77d r860c34e  
    141141#ifdef RTEMS_POSIX_API
    142142/** The following is used by the POSIX implementation to catch bad paths.  */
    143 int POSIX_MP_NOT_IMPLEMENTED( void );
    144 
    145 /** The following is used by the POSIX implementation to catch bad paths.  */
    146143int POSIX_NOT_IMPLEMENTED( void );
    147 
    148 /** The following is used by the POSIX implementation to catch bad paths.  */
    149 int POSIX_BOTTOM_REACHED( void );
    150144#endif
    151145
Note: See TracChangeset for help on using the changeset viewer.