Changeset ebe61382 in rtems


Ignore:
Timestamp:
Nov 30, 2007, 9:49:41 PM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.9, master
Children:
a58ff1c
Parents:
393a1e05
Message:

2007-11-30 Joel Sherrill <joel.sherrill@…>

  • rtems/src/barrierdelete.c, rtems/src/barrierrelease.c, rtems/src/barriertranslatereturncode.c, rtems/src/barrierwait.c, rtems/src/clockget.c, rtems/src/dpmemdelete.c, rtems/src/dpmemexternal2internal.c, rtems/src/dpmeminternal2external.c, rtems/src/eventsend.c, rtems/src/eventtimeout.c, rtems/src/msgqbroadcast.c, rtems/src/msgqdelete.c, rtems/src/msgqflush.c, rtems/src/msgqgetnumberpending.c, rtems/src/msgqreceive.c, rtems/src/msgqsend.c, rtems/src/msgqurgent.c, rtems/src/partdelete.c, rtems/src/partgetbuffer.c, rtems/src/partreturnbuffer.c, rtems/src/ratemoncancel.c, rtems/src/ratemondelete.c, rtems/src/ratemongetstatistics.c, rtems/src/ratemongetstatus.c, rtems/src/ratemonperiod.c, rtems/src/ratemonresetstatistics.c, rtems/src/ratemontimeout.c, rtems/src/semdelete.c, rtems/src/semflush.c, rtems/src/semobtain.c, rtems/src/semrelease.c, rtems/src/semtranslatereturncode.c, rtems/src/signalsend.c, rtems/src/taskdelete.c, rtems/src/taskgetnote.c, rtems/src/taskissuspended.c, rtems/src/taskrestart.c, rtems/src/taskresume.c, rtems/src/tasksetnote.c, rtems/src/tasksetpriority.c, rtems/src/taskstart.c, rtems/src/tasksuspend.c, rtems/src/taskvariableadd.c, rtems/src/taskvariabledelete.c, rtems/src/taskvariableget.c, rtems/src/timercancel.c, rtems/src/timerdelete.c, rtems/src/timerfirewhen.c, rtems/src/timergetinfo.c, rtems/src/timerreset.c, rtems/src/timerserverfireafter.c, rtems/src/timerserverfirewhen.c: Restructured all code with the switch (location) pattern so that OBJECTS_LOCAL is first and we can fall into it and the OBJECTS_ERROR case breaks to a return RTEMS_INVALID_ID. This eliminates the return RTEMS_INTERNAL_ERROR at the bottom of each of these files which was unreachable and untestable code. This resulted in a code savings of approximately 20 bytes per file on the SPARC/ERC32.
Location:
cpukit
Files:
53 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r393a1e05 rebe61382  
     12007-11-30      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * rtems/src/barrierdelete.c, rtems/src/barrierrelease.c,
     4        rtems/src/barriertranslatereturncode.c, rtems/src/barrierwait.c,
     5        rtems/src/clockget.c, rtems/src/dpmemdelete.c,
     6        rtems/src/dpmemexternal2internal.c,
     7        rtems/src/dpmeminternal2external.c, rtems/src/eventsend.c,
     8        rtems/src/eventtimeout.c, rtems/src/msgqbroadcast.c,
     9        rtems/src/msgqdelete.c, rtems/src/msgqflush.c,
     10        rtems/src/msgqgetnumberpending.c, rtems/src/msgqreceive.c,
     11        rtems/src/msgqsend.c, rtems/src/msgqurgent.c, rtems/src/partdelete.c,
     12        rtems/src/partgetbuffer.c, rtems/src/partreturnbuffer.c,
     13        rtems/src/ratemoncancel.c, rtems/src/ratemondelete.c,
     14        rtems/src/ratemongetstatistics.c, rtems/src/ratemongetstatus.c,
     15        rtems/src/ratemonperiod.c, rtems/src/ratemonresetstatistics.c,
     16        rtems/src/ratemontimeout.c, rtems/src/semdelete.c,
     17        rtems/src/semflush.c, rtems/src/semobtain.c, rtems/src/semrelease.c,
     18        rtems/src/semtranslatereturncode.c, rtems/src/signalsend.c,
     19        rtems/src/taskdelete.c, rtems/src/taskgetnote.c,
     20        rtems/src/taskissuspended.c, rtems/src/taskrestart.c,
     21        rtems/src/taskresume.c, rtems/src/tasksetnote.c,
     22        rtems/src/tasksetpriority.c, rtems/src/taskstart.c,
     23        rtems/src/tasksuspend.c, rtems/src/taskvariableadd.c,
     24        rtems/src/taskvariabledelete.c, rtems/src/taskvariableget.c,
     25        rtems/src/timercancel.c, rtems/src/timerdelete.c,
     26        rtems/src/timerfirewhen.c, rtems/src/timergetinfo.c,
     27        rtems/src/timerreset.c, rtems/src/timerserverfireafter.c,
     28        rtems/src/timerserverfirewhen.c: Restructured all code with
     29        the switch (location) pattern so that OBJECTS_LOCAL is first
     30        and we can fall into it and the OBJECTS_ERROR case breaks
     31        to a return RTEMS_INVALID_ID.  This eliminates the return
     32        RTEMS_INTERNAL_ERROR at the bottom of each of these files which
     33        was unreachable and untestable code.  This resulted in a code
     34        savings of approximately 20 bytes per file on the SPARC/ERC32.
     35
    1362007-11-30      Glenn Humphrey <glenn.humphrey@OARcorp.com>
    237
  • cpukit/rtems/src/barrierdelete.c

    r393a1e05 rebe61382  
    4949  switch ( location ) {
    5050
    51 #if defined(RTEMS_MULTIPROCESSING)
    52     case OBJECTS_REMOTE:
    53 #endif
    54     case OBJECTS_ERROR:
    55       return RTEMS_INVALID_ID;
    56 
    5751    case OBJECTS_LOCAL:
    5852      _CORE_barrier_Flush(
     
    6862      _Thread_Enable_dispatch();
    6963      return RTEMS_SUCCESSFUL;
     64
     65#if defined(RTEMS_MULTIPROCESSING)
     66    case OBJECTS_REMOTE:
     67#endif
     68    case OBJECTS_ERROR:
     69      break;
    7070  }
    7171
    72   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     72  return RTEMS_INVALID_ID;
    7373}
  • cpukit/rtems/src/barrierrelease.c

    r393a1e05 rebe61382  
    5151  the_barrier = _Barrier_Get( id, &location );
    5252  switch ( location ) {
    53 #if defined(RTEMS_MULTIPROCESSING)
    54     case OBJECTS_REMOTE:
    55 #endif
    56     case OBJECTS_ERROR:
    57       return RTEMS_INVALID_ID;
    5853
    5954    case OBJECTS_LOCAL:
     
    6257      return RTEMS_SUCCESSFUL;
    6358
     59#if defined(RTEMS_MULTIPROCESSING)
     60    case OBJECTS_REMOTE:
     61#endif
     62    case OBJECTS_ERROR:
     63      break;
    6464  }
    6565
    66   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     66  return RTEMS_INVALID_ID;
    6767}
  • cpukit/rtems/src/barriertranslatereturncode.c

    r393a1e05 rebe61382  
    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 *
     
    3939};
    4040
    41 
    4241rtems_status_code _Barrier_Translate_core_barrier_return_code (
    4342  CORE_barrier_Status  the_barrier_status
    4443)
    4544{
    46   if ( the_barrier_status > CORE_BARRIER_TIMEOUT )
    47     return RTEMS_INTERNAL_ERROR;
     45  /*
     46   *  Internal consistency check for bad status from SuperCore
     47   */
     48  #if defined(RTEMS_DEBUG)
     49    if ( the_barrier_status > CORE_BARRIER_STATUS_LAST )
     50      return RTEMS_INTERNAL_ERROR;
     51  #endif
    4852  return _Barrier_Translate_core_barrier_return_code_[the_barrier_status];
    4953}
  • cpukit/rtems/src/barrierwait.c

    r393a1e05 rebe61382  
    4747  the_barrier = _Barrier_Get( id, &location );
    4848  switch ( location ) {
    49 #if defined(RTEMS_MULTIPROCESSING)
    50     case OBJECTS_REMOTE:
    51 #endif
    52     case OBJECTS_ERROR:
    53       return RTEMS_INVALID_ID;
    5449
    5550    case OBJECTS_LOCAL:
     
    6560                _Thread_Executing->Wait.return_code );
    6661
     62#if defined(RTEMS_MULTIPROCESSING)
     63    case OBJECTS_REMOTE:
     64#endif
     65    case OBJECTS_ERROR:
     66      break;
    6767  }
    6868
    69   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     69  return RTEMS_INVALID_ID;
    7070}
  • cpukit/rtems/src/clockget.c

    r393a1e05 rebe61382  
    22 *  Clock Manager
    33 *
    4  *  COPYRIGHT (c) 1989-1999.
     4 *  COPYRIGHT (c) 1989-2007.
    55 *  On-Line Applications Research Corporation (OAR).
    66 *
     
    112112  }
    113113
    114   return RTEMS_INTERNAL_ERROR;   /* should never get here */
     114  return RTEMS_INVALID_NUMBER;
    115115
    116116}
  • cpukit/rtems/src/dpmemdelete.c

    r393a1e05 rebe61382  
    4949  the_port = _Dual_ported_memory_Get( id, &location );
    5050  switch ( location ) {
    51 #if defined(RTEMS_MULTIPROCESSING)
    52     case OBJECTS_REMOTE:        /* this error cannot be returned */
    53       return RTEMS_INTERNAL_ERROR;
    54 #endif
    55 
    56     case OBJECTS_ERROR:
    57       return RTEMS_INVALID_ID;
    5851
    5952    case OBJECTS_LOCAL:
     
    6255      _Thread_Enable_dispatch();
    6356      return RTEMS_SUCCESSFUL;
     57
     58#if defined(RTEMS_MULTIPROCESSING)
     59    case OBJECTS_REMOTE:        /* this error cannot be returned */
     60#endif
     61    case OBJECTS_ERROR:
     62      break;
    6463  }
    6564
    66   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     65  return RTEMS_INVALID_ID;
    6766}
  • cpukit/rtems/src/dpmemexternal2internal.c

    r393a1e05 rebe61382  
    5959  the_port = _Dual_ported_memory_Get( id, &location );
    6060  switch ( location ) {
    61 #if defined(RTEMS_MULTIPROCESSING)
    62     case OBJECTS_REMOTE:        /* this error cannot be returned */
    63       return RTEMS_INTERNAL_ERROR;
    64 #endif
    65 
    66     case OBJECTS_ERROR:
    67       return RTEMS_INVALID_ID;
    68 
    6961    case OBJECTS_LOCAL:
    7062      ending = _Addresses_Subtract( external, the_port->external_base );
     
    7668      _Thread_Enable_dispatch();
    7769      return RTEMS_SUCCESSFUL;
     70
     71#if defined(RTEMS_MULTIPROCESSING)
     72    case OBJECTS_REMOTE:        /* this error cannot be returned */
     73#endif
     74    case OBJECTS_ERROR:
     75      break;
    7876  }
    7977
    80   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     78  return RTEMS_INVALID_ID;
    8179}
  • cpukit/rtems/src/dpmeminternal2external.c

    r393a1e05 rebe61382  
    5959  the_port = _Dual_ported_memory_Get( id, &location );
    6060  switch ( location ) {
    61 #if defined(RTEMS_MULTIPROCESSING)
    62     case OBJECTS_REMOTE:        /* this error cannot be returned */
    63       return RTEMS_INTERNAL_ERROR;
    64 #endif
    65 
    66     case OBJECTS_ERROR:
    67       return RTEMS_INVALID_ID;
    6861
    6962    case OBJECTS_LOCAL:
     
    7669      _Thread_Enable_dispatch();
    7770      return RTEMS_SUCCESSFUL;
     71
     72#if defined(RTEMS_MULTIPROCESSING)
     73    case OBJECTS_REMOTE:        /* this error cannot be returned */
     74#endif
     75    case OBJECTS_ERROR:
     76      break;
    7877  }
    7978
    80   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     79  return RTEMS_INVALID_ID;
    8180}
  • cpukit/rtems/src/eventsend.c

    r393a1e05 rebe61382  
    5252  the_thread = _Thread_Get( id, &location );
    5353  switch ( location ) {
     54
     55    case OBJECTS_LOCAL:
     56      api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
     57      _Event_sets_Post( event_in, &api->pending_events );
     58      _Event_Surrender( the_thread );
     59      _Thread_Enable_dispatch();
     60      return RTEMS_SUCCESSFUL;
     61
    5462#if defined(RTEMS_MULTIPROCESSING)
    5563    case OBJECTS_REMOTE:
     
    6270      );
    6371#endif
     72
    6473    case OBJECTS_ERROR:
    65       return RTEMS_INVALID_ID;
    66     case OBJECTS_LOCAL:
    67       api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
    68       _Event_sets_Post( event_in, &api->pending_events );
    69       _Event_Surrender( the_thread );
    70       _Thread_Enable_dispatch();
    71       return RTEMS_SUCCESSFUL;
     74      break;
    7275  }
    7376
    74   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     77  return RTEMS_INVALID_ID;
    7578}
  • cpukit/rtems/src/eventtimeout.c

    r393a1e05 rebe61382  
    5050  the_thread = _Thread_Get( id, &location );
    5151  switch ( location ) {
    52 #if defined(RTEMS_MULTIPROCESSING)
    53     case OBJECTS_REMOTE:  /* impossible */
    54 #endif
    55     case OBJECTS_ERROR:
    56       break;
     52
    5753    case OBJECTS_LOCAL:
    5854
     
    9086      _Thread_Unnest_dispatch();
    9187      break;
     88
     89#if defined(RTEMS_MULTIPROCESSING)
     90    case OBJECTS_REMOTE:  /* impossible */
     91#endif
     92    case OBJECTS_ERROR:
     93      break;
    9294  }
    9395}
  • cpukit/rtems/src/msgqbroadcast.c

    r393a1e05 rebe61382  
    7373  the_message_queue = _Message_queue_Get( id, &location );
    7474  switch ( location ) {
     75
     76    case OBJECTS_LOCAL:
     77      core_status = _CORE_message_queue_Broadcast(
     78                      &the_message_queue->message_queue,
     79                      buffer,
     80                      size,
     81                      id,
     82                      #if defined(RTEMS_MULTIPROCESSING)
     83                        _Message_queue_Core_message_queue_mp_support,
     84                      #else
     85                        NULL,
     86                      #endif
     87                      count
     88                    );
     89
     90      _Thread_Enable_dispatch();
     91      return
     92        _Message_queue_Translate_core_message_queue_return_code( core_status );
     93
    7594#if defined(RTEMS_MULTIPROCESSING)
    7695    case OBJECTS_REMOTE:
     
    89108
    90109    case OBJECTS_ERROR:
    91       return RTEMS_INVALID_ID;
    92 
    93     case OBJECTS_LOCAL:
    94       core_status = _CORE_message_queue_Broadcast(
    95                       &the_message_queue->message_queue,
    96                       buffer,
    97                       size,
    98                       id,
    99 #if defined(RTEMS_MULTIPROCESSING)
    100                       _Message_queue_Core_message_queue_mp_support,
    101 #else
    102                       NULL,
    103 #endif
    104                       count
    105                     );
    106 
    107       _Thread_Enable_dispatch();
    108       return
    109         _Message_queue_Translate_core_message_queue_return_code( core_status );
    110 
     110      break;
    111111  }
    112   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     112  return RTEMS_INVALID_ID;
    113113}
  • cpukit/rtems/src/msgqdelete.c

    r393a1e05 rebe61382  
    6060  switch ( location ) {
    6161
    62 #if defined(RTEMS_MULTIPROCESSING)
    63     case OBJECTS_REMOTE:
    64       _Thread_Dispatch();
    65       return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
    66 #endif
    67 
    68     case OBJECTS_ERROR:
    69       return RTEMS_INVALID_ID;
    70 
    7162    case OBJECTS_LOCAL:
    7263      _Objects_Close( &_Message_queue_Information,
     
    7566      _CORE_message_queue_Close(
    7667        &the_message_queue->message_queue,
    77 #if defined(RTEMS_MULTIPROCESSING)
    78         _Message_queue_MP_Send_object_was_deleted,
    79 #else
    80         NULL,
    81 #endif
     68        #if defined(RTEMS_MULTIPROCESSING)
     69          _Message_queue_MP_Send_object_was_deleted,
     70        #else
     71          NULL,
     72        #endif
    8273        CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED
    8374      );
     
    10091      }
    10192#endif
    102 
    10393      _Thread_Enable_dispatch();
    10494      return RTEMS_SUCCESSFUL;
     95
     96#if defined(RTEMS_MULTIPROCESSING)
     97    case OBJECTS_REMOTE:
     98      _Thread_Dispatch();
     99      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
     100#endif
     101
     102    case OBJECTS_ERROR:
     103      break;
    105104  }
    106105
    107   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     106  return RTEMS_INVALID_ID;
    108107}
  • cpukit/rtems/src/msgqflush.c

    r393a1e05 rebe61382  
    6666  the_message_queue = _Message_queue_Get( id, &location );
    6767  switch ( location ) {
     68
     69    case OBJECTS_LOCAL:
     70      *count = _CORE_message_queue_Flush( &the_message_queue->message_queue );
     71      _Thread_Enable_dispatch();
     72      return RTEMS_SUCCESSFUL;
     73
    6874#if defined(RTEMS_MULTIPROCESSING)
    6975    case OBJECTS_REMOTE:
     
    8288
    8389    case OBJECTS_ERROR:
    84       return RTEMS_INVALID_ID;
    85 
    86     case OBJECTS_LOCAL:
    87       *count = _CORE_message_queue_Flush( &the_message_queue->message_queue );
    88       _Thread_Enable_dispatch();
    89       return RTEMS_SUCCESSFUL;
     90      break;
    9091  }
    9192
    92   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     93  return RTEMS_INVALID_ID;
    9394}
  • cpukit/rtems/src/msgqgetnumberpending.c

    r393a1e05 rebe61382  
    6464  the_message_queue = _Message_queue_Get( id, &location );
    6565  switch ( location ) {
     66
     67    case OBJECTS_LOCAL:
     68      *count = the_message_queue->message_queue.number_of_pending_messages;
     69      _Thread_Enable_dispatch();
     70      return RTEMS_SUCCESSFUL;
     71
    6672#if defined(RTEMS_MULTIPROCESSING)
    6773    case OBJECTS_REMOTE:
     
    7985
    8086    case OBJECTS_ERROR:
    81       return RTEMS_INVALID_ID;
    82 
    83     case OBJECTS_LOCAL:
    84       *count = the_message_queue->message_queue.number_of_pending_messages;
    85       _Thread_Enable_dispatch();
    86       return RTEMS_SUCCESSFUL;
     87      break;
    8788  }
    8889
    89   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     90  return RTEMS_INVALID_ID;
    9091}
  • cpukit/rtems/src/msgqreceive.c

    r393a1e05 rebe61382  
    7575  switch ( location ) {
    7676
    77 #if defined(RTEMS_MULTIPROCESSING)
    78     case OBJECTS_REMOTE:
    79       return _Message_queue_MP_Send_request_packet(
    80           MESSAGE_QUEUE_MP_RECEIVE_REQUEST,
    81           id,
    82           buffer,
    83           size,
    84           option_set,
    85           timeout
    86         );
    87 #endif
    88 
    89     case OBJECTS_ERROR:
    90       return RTEMS_INVALID_ID;
    91 
    9277    case OBJECTS_LOCAL:
    9378      if ( _Options_Is_no_wait( option_set ) )
     
    10994      );
    11095
     96#if defined(RTEMS_MULTIPROCESSING)
     97    case OBJECTS_REMOTE:
     98      return _Message_queue_MP_Send_request_packet(
     99          MESSAGE_QUEUE_MP_RECEIVE_REQUEST,
     100          id,
     101          buffer,
     102          size,
     103          option_set,
     104          timeout
     105        );
     106#endif
     107
     108    case OBJECTS_ERROR:
     109      break;
    111110  }
    112111
    113   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     112  return RTEMS_INVALID_ID;
    114113}
  • cpukit/rtems/src/msgqsend.c

    r393a1e05 rebe61382  
    7171
    7272  the_message_queue = _Message_queue_Get( id, &location );
    73   switch ( location )
    74   {
    75 #if defined(RTEMS_MULTIPROCESSING)
    76     case OBJECTS_REMOTE:
    77       return _Message_queue_MP_Send_request_packet(
    78         MESSAGE_QUEUE_MP_SEND_REQUEST,
    79         id,
    80         buffer,
    81         &size,
    82         0,                               /* option_set */
    83         MPCI_DEFAULT_TIMEOUT
    84       );
    85       break;
    86 #endif
    87 
    88     case OBJECTS_ERROR:
    89       return RTEMS_INVALID_ID;
     73  switch ( location ) {
    9074
    9175    case OBJECTS_LOCAL:
     
    10993      return _Message_queue_Translate_core_message_queue_return_code(status);
    11094
     95#if defined(RTEMS_MULTIPROCESSING)
     96    case OBJECTS_REMOTE:
     97      return _Message_queue_MP_Send_request_packet(
     98        MESSAGE_QUEUE_MP_SEND_REQUEST,
     99        id,
     100        buffer,
     101        &size,
     102        0,                               /* option_set */
     103        MPCI_DEFAULT_TIMEOUT
     104      );
     105      break;
     106#endif
     107
     108    case OBJECTS_ERROR:
     109      break;
    111110  }
    112   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     111  return RTEMS_INVALID_ID;
    113112}
  • cpukit/rtems/src/msgqurgent.c

    r393a1e05 rebe61382  
    7171
    7272  the_message_queue = _Message_queue_Get( id, &location );
    73   switch ( location )
    74   {
    75 #if defined(RTEMS_MULTIPROCESSING)
    76     case OBJECTS_REMOTE:
    77       return _Message_queue_MP_Send_request_packet(
    78         MESSAGE_QUEUE_MP_URGENT_REQUEST,
    79         id,
    80         buffer,
    81         &size,
    82         0,                               /* option_set */
    83         MPCI_DEFAULT_TIMEOUT
    84       );
    85 #endif
    86 
    87     case OBJECTS_ERROR:
    88       return RTEMS_INVALID_ID;
     73  switch ( location ) {
    8974
    9075    case OBJECTS_LOCAL:
     
    10792      return _Message_queue_Translate_core_message_queue_return_code(status);
    10893
     94#if defined(RTEMS_MULTIPROCESSING)
     95    case OBJECTS_REMOTE:
     96      return _Message_queue_MP_Send_request_packet(
     97        MESSAGE_QUEUE_MP_URGENT_REQUEST,
     98        id,
     99        buffer,
     100        &size,
     101        0,                               /* option_set */
     102        MPCI_DEFAULT_TIMEOUT
     103      );
     104#endif
     105
     106    case OBJECTS_ERROR:
     107      break;
    109108  }
    110   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     109
     110  return RTEMS_INVALID_ID;
    111111}
  • cpukit/rtems/src/partdelete.c

    r393a1e05 rebe61382  
    5151  the_partition = _Partition_Get( id, &location );
    5252  switch ( location ) {
    53 #if defined(RTEMS_MULTIPROCESSING)
    54     case OBJECTS_REMOTE:
    55       _Thread_Dispatch();
    56       return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
    57 #endif
    58 
    59     case OBJECTS_ERROR:
    60       return RTEMS_INVALID_ID;
    6153
    6254    case OBJECTS_LOCAL:
     
    8678      _Thread_Enable_dispatch();
    8779      return RTEMS_RESOURCE_IN_USE;
     80
     81#if defined(RTEMS_MULTIPROCESSING)
     82    case OBJECTS_REMOTE:
     83      _Thread_Dispatch();
     84      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
     85#endif
     86
     87    case OBJECTS_ERROR:
     88      break;
    8889  }
    8990
    90   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     91  return RTEMS_INVALID_ID;
    9192}
  • cpukit/rtems/src/partgetbuffer.c

    r393a1e05 rebe61382  
    5656  the_partition = _Partition_Get( id, &location );
    5757  switch ( location ) {
     58
     59    case OBJECTS_LOCAL:
     60      the_buffer = _Partition_Allocate_buffer( the_partition );
     61      if ( the_buffer ) {
     62        the_partition->number_of_used_blocks += 1;
     63        _Thread_Enable_dispatch();
     64        *buffer = the_buffer;
     65        return RTEMS_SUCCESSFUL;
     66      }
     67      _Thread_Enable_dispatch();
     68      return RTEMS_UNSATISFIED;
     69
    5870#if defined(RTEMS_MULTIPROCESSING)
    5971    case OBJECTS_REMOTE:
     
    6981
    7082    case OBJECTS_ERROR:
    71       return RTEMS_INVALID_ID;
    72 
    73     case OBJECTS_LOCAL:
    74       the_buffer = _Partition_Allocate_buffer( the_partition );
    75       if ( the_buffer ) {
    76         the_partition->number_of_used_blocks += 1;
    77         _Thread_Enable_dispatch();
    78         *buffer = the_buffer;
    79         return RTEMS_SUCCESSFUL;
    80       }
    81       _Thread_Enable_dispatch();
    82       return RTEMS_UNSATISFIED;
     83      break;
    8384  }
    8485
    85   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     86  return RTEMS_INVALID_ID;
    8687}
  • cpukit/rtems/src/partreturnbuffer.c

    r393a1e05 rebe61382  
    5353  switch ( location ) {
    5454
     55    case OBJECTS_LOCAL:
     56      if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) {
     57        _Partition_Free_buffer( the_partition, buffer );
     58        the_partition->number_of_used_blocks -= 1;
     59        _Thread_Enable_dispatch();
     60        return RTEMS_SUCCESSFUL;
     61      }
     62      _Thread_Enable_dispatch();
     63      return RTEMS_INVALID_ADDRESS;
     64
    5565#if defined(RTEMS_MULTIPROCESSING)
    5666    case OBJECTS_REMOTE:
     
    6373
    6474    case OBJECTS_ERROR:
    65       return RTEMS_INVALID_ID;
    66 
    67     case OBJECTS_LOCAL:
    68       if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) {
    69         _Partition_Free_buffer( the_partition, buffer );
    70         the_partition->number_of_used_blocks -= 1;
    71         _Thread_Enable_dispatch();
    72         return RTEMS_SUCCESSFUL;
    73       }
    74       _Thread_Enable_dispatch();
    75       return RTEMS_INVALID_ADDRESS;
     75      break;
    7676  }
    7777
    78   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     78  return RTEMS_INVALID_ID;
    7979}
  • cpukit/rtems/src/ratemoncancel.c

    r393a1e05 rebe61382  
    4747  the_period = _Rate_monotonic_Get( id, &location );
    4848  switch ( location ) {
    49 #if defined(RTEMS_MULTIPROCESSING)
    50     case OBJECTS_REMOTE:
    51       return RTEMS_INTERNAL_ERROR;  /* should never return this */
    52 #endif
    53 
    54     case OBJECTS_ERROR:
    55       return RTEMS_INVALID_ID;
    5649
    5750    case OBJECTS_LOCAL:
     
    6457      _Thread_Enable_dispatch();
    6558      return RTEMS_SUCCESSFUL;
     59
     60#if defined(RTEMS_MULTIPROCESSING)
     61    case OBJECTS_REMOTE:
     62#endif
     63    case OBJECTS_ERROR:
     64      break;
    6665  }
    6766
    68   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     67  return RTEMS_INVALID_ID;
    6968}
  • cpukit/rtems/src/ratemondelete.c

    r393a1e05 rebe61382  
    4747  the_period = _Rate_monotonic_Get( id, &location );
    4848  switch ( location ) {
    49 #if defined(RTEMS_MULTIPROCESSING)
    50     case OBJECTS_REMOTE:            /* should never return this */
    51       return RTEMS_INTERNAL_ERROR;
    52 #endif
    53 
    54     case OBJECTS_ERROR:
    55       return RTEMS_INVALID_ID;
    5649
    5750    case OBJECTS_LOCAL:
     
    6255      _Thread_Enable_dispatch();
    6356      return RTEMS_SUCCESSFUL;
     57
     58#if defined(RTEMS_MULTIPROCESSING)
     59    case OBJECTS_REMOTE:            /* should never return this */
     60#endif
     61    case OBJECTS_ERROR:
     62      break;
    6463  }
    6564
    66   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     65  return RTEMS_INVALID_ID;
    6766}
  • cpukit/rtems/src/ratemongetstatistics.c

    r393a1e05 rebe61382  
    5454  the_period = _Rate_monotonic_Get( id, &location );
    5555  switch ( location ) {
     56
     57    case OBJECTS_LOCAL:
     58      *statistics = the_period->Statistics;
     59      _Thread_Enable_dispatch();
     60      return RTEMS_SUCCESSFUL;
     61
    5662#if defined(RTEMS_MULTIPROCESSING)
    5763    case OBJECTS_REMOTE:            /* should never return this */
    58       return RTEMS_INTERNAL_ERROR;
    5964#endif
    60 
    6165    case OBJECTS_ERROR:
    62       return RTEMS_INVALID_ID;
    63 
    64     case OBJECTS_LOCAL:
    65 
    66       *statistics = the_period->Statistics;
    67 
    68       _Thread_Enable_dispatch();
    69       return RTEMS_SUCCESSFUL;
     66      break;
    7067  }
    7168
    72   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     69  return RTEMS_INVALID_ID;
    7370}
  • cpukit/rtems/src/ratemongetstatus.c

    r393a1e05 rebe61382  
    5959  the_period = _Rate_monotonic_Get( id, &location );
    6060  switch ( location ) {
    61 #if defined(RTEMS_MULTIPROCESSING)
    62     case OBJECTS_REMOTE:            /* should never return this */
    63       return RTEMS_INTERNAL_ERROR;
    64 #endif
    65 
    66     case OBJECTS_ERROR:
    67       return RTEMS_INVALID_ID;
    6861
    6962    case OBJECTS_LOCAL:
     
    121114      _Thread_Enable_dispatch();
    122115      return RTEMS_SUCCESSFUL;
     116
     117#if defined(RTEMS_MULTIPROCESSING)
     118    case OBJECTS_REMOTE:            /* should never return this */
     119#endif
     120    case OBJECTS_ERROR:
     121      break;
    123122  }
    124123
    125   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     124  return RTEMS_INVALID_ID;
    126125}
  • cpukit/rtems/src/ratemonperiod.c

    r393a1e05 rebe61382  
    185185  the_period = _Rate_monotonic_Get( id, &location );
    186186  switch ( location ) {
    187 #if defined(RTEMS_MULTIPROCESSING)
    188     case OBJECTS_REMOTE:            /* should never return this */
    189       return RTEMS_INTERNAL_ERROR;
    190 #endif
    191 
    192     case OBJECTS_ERROR:
    193       return RTEMS_INVALID_ID;
    194187
    195188    case OBJECTS_LOCAL:
     
    204197            return_value = RTEMS_NOT_DEFINED;
    205198            break;
    206           case RATE_MONOTONIC_ACTIVE:
    207             return_value = RTEMS_SUCCESSFUL;
    208             break;
    209199          case RATE_MONOTONIC_EXPIRED:
    210200            return_value = RTEMS_TIMEOUT;
    211201            break;
     202          case RATE_MONOTONIC_ACTIVE:
    212203          default:              /* unreached -- only to remove warnings */
    213             return_value = RTEMS_INTERNAL_ERROR;
     204            return_value = RTEMS_SUCCESSFUL;
    214205            break;
    215206        }
     
    352343          break;
    353344      }
     345
     346#if defined(RTEMS_MULTIPROCESSING)
     347    case OBJECTS_REMOTE:            /* should never return this */
     348#endif
     349    case OBJECTS_ERROR:
     350      break;
    354351  }
    355352
    356   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     353  return RTEMS_INVALID_ID;
    357354}
  • cpukit/rtems/src/ratemonresetstatistics.c

    r393a1e05 rebe61382  
    4949  the_period = _Rate_monotonic_Get( id, &location );
    5050  switch ( location ) {
     51
     52    case OBJECTS_LOCAL:
     53      _Rate_monotonic_Reset_statistics( the_period );
     54      _Thread_Enable_dispatch();
     55      return RTEMS_SUCCESSFUL;
     56
    5157#if defined(RTEMS_MULTIPROCESSING)
    5258    case OBJECTS_REMOTE:            /* should never return this */
    53       return RTEMS_INTERNAL_ERROR;
    5459#endif
    55 
    5660    case OBJECTS_ERROR:
    57       return RTEMS_INVALID_ID;
    58 
    59     case OBJECTS_LOCAL:
    60 
    61       _Rate_monotonic_Reset_statistics( the_period );
    62 
    63       _Thread_Enable_dispatch();
    64       return RTEMS_SUCCESSFUL;
     61      break;
    6562  }
    6663
    67   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     64  return RTEMS_INVALID_ID;
    6865}
  • cpukit/rtems/src/ratemontimeout.c

    r393a1e05 rebe61382  
    5555  the_period = _Rate_monotonic_Get( id, &location );
    5656  switch ( location ) {
    57 #if defined(RTEMS_MULTIPROCESSING)
    58     case OBJECTS_REMOTE:  /* impossible */
    59 #endif
    60     case OBJECTS_ERROR:
    61       break;
    6257
    6358    case OBJECTS_LOCAL:
     
    7671      _Thread_Unnest_dispatch();
    7772      break;
     73
     74#if defined(RTEMS_MULTIPROCESSING)
     75    case OBJECTS_REMOTE:  /* impossible */
     76#endif
     77    case OBJECTS_ERROR:
     78      break;
    7879  }
    7980}
  • cpukit/rtems/src/semdelete.c

    r393a1e05 rebe61382  
    8282  switch ( location ) {
    8383
    84 #if defined(RTEMS_MULTIPROCESSING)
    85     case OBJECTS_REMOTE:
    86       _Thread_Dispatch();
    87       return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
    88 #endif
    89 
    90     case OBJECTS_ERROR:
    91       return RTEMS_INVALID_ID;
    92 
    9384    case OBJECTS_LOCAL:
    9485      if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) {
     
    131122      _Thread_Enable_dispatch();
    132123      return RTEMS_SUCCESSFUL;
     124
     125#if defined(RTEMS_MULTIPROCESSING)
     126    case OBJECTS_REMOTE:
     127      _Thread_Dispatch();
     128      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
     129#endif
     130
     131    case OBJECTS_ERROR:
     132      break;
    133133  }
    134134
    135   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     135  return RTEMS_INVALID_ID;
    136136}
  • cpukit/rtems/src/semflush.c

    r393a1e05 rebe61382  
    7272  switch ( location ) {
    7373
    74 #if defined(RTEMS_MULTIPROCESSING)
    75     case OBJECTS_REMOTE:
    76       _Thread_Dispatch();
    77       return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
    78 #endif
    79 
    80     case OBJECTS_ERROR:
    81       return RTEMS_INVALID_ID;
    82 
    8374    case OBJECTS_LOCAL:
    8475      if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) {
     
    9788      _Thread_Enable_dispatch();
    9889      return RTEMS_SUCCESSFUL;
     90
     91#if defined(RTEMS_MULTIPROCESSING)
     92    case OBJECTS_REMOTE:
     93      _Thread_Dispatch();
     94      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
     95#endif
     96
     97    case OBJECTS_ERROR:
     98      break;
    9999  }
    100100
    101   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     101  return RTEMS_INVALID_ID;
    102102}
  • cpukit/rtems/src/semobtain.c

    r393a1e05 rebe61382  
    7878  the_semaphore = _Semaphore_Get_interrupt_disable( id, &location, &level );
    7979  switch ( location ) {
     80
    8081    case OBJECTS_LOCAL:
    8182      if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) {
  • cpukit/rtems/src/semrelease.c

    r393a1e05 rebe61382  
    8282  switch ( location ) {
    8383
    84 #if defined(RTEMS_MULTIPROCESSING)
    85     case OBJECTS_REMOTE:
    86       return _Semaphore_MP_Send_request_packet(
    87         SEMAPHORE_MP_RELEASE_REQUEST,
    88         id,
    89         0,                               /* Not used */
    90         MPCI_DEFAULT_TIMEOUT
    91       );
    92 #endif
    93 
    94     case OBJECTS_ERROR:
    95       return RTEMS_INVALID_ID;
    96 
    9784    case OBJECTS_LOCAL:
    9885      if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) {
     
    114101          _Semaphore_Translate_core_semaphore_return_code( semaphore_status );
    115102      }
     103
     104#if defined(RTEMS_MULTIPROCESSING)
     105    case OBJECTS_REMOTE:
     106      return _Semaphore_MP_Send_request_packet(
     107        SEMAPHORE_MP_RELEASE_REQUEST,
     108        id,
     109        0,                               /* Not used */
     110        MPCI_DEFAULT_TIMEOUT
     111      );
     112#endif
     113
     114    case OBJECTS_ERROR:
     115      break;
    116116  }
    117117
    118   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     118  return RTEMS_INVALID_ID;
    119119}
  • cpukit/rtems/src/semtranslatereturncode.c

    r393a1e05 rebe61382  
    1616 *     + release a semaphore
    1717 *
    18  *  COPYRIGHT (c) 1989-1999.
     18 *  COPYRIGHT (c) 1989-2007.
    1919 *  On-Line Applications Research Corporation (OAR).
    2020 *
     
    7777)
    7878{
    79 #if defined(RTEMS_MULTIPROCESSING)
    80   if ( status == THREAD_STATUS_PROXY_BLOCKING )
    81     return RTEMS_PROXY_BLOCKING;
    82 #endif
    83   if ( status > CORE_MUTEX_STATUS_CEILING_VIOLATED )
    84     return RTEMS_INTERNAL_ERROR;
     79  /*
     80   *  If this thread is blocking waiting for a result on a remote operation.
     81   */
     82  #if defined(RTEMS_MULTIPROCESSING)
     83    if ( status == THREAD_STATUS_PROXY_BLOCKING )
     84      return RTEMS_PROXY_BLOCKING;
     85  #endif
     86
     87  /*
     88   *  Internal consistency check for bad status from SuperCore
     89   */
     90  #if defined(RTEMS_DEBUG)
     91    if ( status > CORE_MUTEX_STATUS_LAST )
     92      return RTEMS_INTERNAL_ERROR;
     93  #endif
    8594  return _Semaphore_Translate_core_mutex_return_code_[status];
    8695}
     
    111120)
    112121{
    113 #if defined(RTEMS_MULTIPROCESSING)
    114   if ( status == THREAD_STATUS_PROXY_BLOCKING )
    115     return RTEMS_PROXY_BLOCKING;
    116 #endif
    117   if ( status > CORE_MUTEX_STATUS_CEILING_VIOLATED )
    118     return RTEMS_INTERNAL_ERROR;
     122  #if defined(RTEMS_MULTIPROCESSING)
     123    if ( status == THREAD_STATUS_PROXY_BLOCKING )
     124      return RTEMS_PROXY_BLOCKING;
     125  #endif
     126  /*
     127   *  Internal consistency check for bad status from SuperCore
     128   */
     129  #if defined(RTEMS_DEBUG)
     130    if ( the_semaphore_status > CORE_SEMAPHORE_STATUS_LAST )
     131      return RTEMS_INTERNAL_ERROR;
     132  #endif
    119133  return _Semaphore_Translate_core_semaphore_return_code_[status];
    120134}
  • cpukit/rtems/src/signalsend.c

    r393a1e05 rebe61382  
    5757  switch ( location ) {
    5858
    59 #if defined(RTEMS_MULTIPROCESSING)
    60     case OBJECTS_REMOTE:
    61       return _Signal_MP_Send_request_packet(
    62         SIGNAL_MP_SEND_REQUEST,
    63         id,
    64         signal_set
    65       );
    66 #endif
    67 
    68     case OBJECTS_ERROR:
    69       return RTEMS_INVALID_ID;
    70 
    7159    case OBJECTS_LOCAL:
    7260      api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
     
    8977      _Thread_Enable_dispatch();
    9078      return RTEMS_NOT_DEFINED;
     79
     80#if defined(RTEMS_MULTIPROCESSING)
     81    case OBJECTS_REMOTE:
     82      return _Signal_MP_Send_request_packet(
     83        SIGNAL_MP_SEND_REQUEST,
     84        id,
     85        signal_set
     86      );
     87#endif
     88
     89    case OBJECTS_ERROR:
     90      break;
    9191  }
    9292
    93   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     93  return RTEMS_INVALID_ID;
    9494}
  • cpukit/rtems/src/taskdelete.c

    r393a1e05 rebe61382  
    6262  switch ( location ) {
    6363
    64 #if defined(RTEMS_MULTIPROCESSING)
    65     case OBJECTS_REMOTE:
    66       _Thread_Dispatch();
    67       return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
    68 #endif
    69 
    70     case OBJECTS_ERROR:
    71       return RTEMS_INVALID_ID;
    72 
    7364    case OBJECTS_LOCAL:
    7465      the_information = _Objects_Get_information( the_thread->Object.id );
     
    10192      _Thread_Enable_dispatch();
    10293      return RTEMS_SUCCESSFUL;
     94
     95#if defined(RTEMS_MULTIPROCESSING)
     96    case OBJECTS_REMOTE:
     97      _Thread_Dispatch();
     98      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
     99#endif
     100
     101    case OBJECTS_ERROR:
     102      break;
    103103  }
    104104
    105   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     105  return RTEMS_INVALID_ID;
    106106}
  • cpukit/rtems/src/taskgetnote.c

    r393a1e05 rebe61382  
    8686  switch ( location ) {
    8787
     88    case OBJECTS_LOCAL:
     89      api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
     90      *note = api->Notepads[ notepad ];
     91      _Thread_Enable_dispatch();
     92      return RTEMS_SUCCESSFUL;
     93
    8894#if defined(RTEMS_MULTIPROCESSING)
    8995    case OBJECTS_REMOTE:
     
    100106
    101107    case OBJECTS_ERROR:
    102       return RTEMS_INVALID_ID;
    103 
    104     case OBJECTS_LOCAL:
    105       api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
    106       *note = api->Notepads[ notepad ];
    107       _Thread_Enable_dispatch();
    108       return RTEMS_SUCCESSFUL;
     108      break;
    109109  }
    110110
    111   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     111  return RTEMS_INVALID_ID;
    112112}
  • cpukit/rtems/src/taskissuspended.c

    r393a1e05 rebe61382  
    5959  switch ( location ) {
    6060
     61    case OBJECTS_LOCAL:
     62      if ( !_States_Is_suspended( the_thread->current_state ) ) {
     63        _Thread_Enable_dispatch();
     64        return RTEMS_SUCCESSFUL;
     65      }
     66      _Thread_Enable_dispatch();
     67      return RTEMS_ALREADY_SUSPENDED;
     68
    6169#if defined(RTEMS_MULTIPROCESSING)
    6270    case OBJECTS_REMOTE:
     
    6674
    6775    case OBJECTS_ERROR:
    68       return RTEMS_INVALID_ID;
    69 
    70     case OBJECTS_LOCAL:
    71       if ( !_States_Is_suspended( the_thread->current_state ) ) {
    72         _Thread_Enable_dispatch();
    73         return RTEMS_SUCCESSFUL;
    74       }
    75       _Thread_Enable_dispatch();
    76       return RTEMS_ALREADY_SUSPENDED;
     76      break;
    7777  }
    7878
    79   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     79  return RTEMS_INVALID_ID;
    8080}
  • cpukit/rtems/src/taskrestart.c

    r393a1e05 rebe61382  
    6262  switch ( location ) {
    6363
     64    case OBJECTS_LOCAL:
     65      if ( _Thread_Restart( the_thread, NULL, argument ) ) {
     66        _Thread_Enable_dispatch();
     67        return RTEMS_SUCCESSFUL;
     68      }
     69      _Thread_Enable_dispatch();
     70      return RTEMS_INCORRECT_STATE;
     71
    6472#if defined(RTEMS_MULTIPROCESSING)
    6573    case OBJECTS_REMOTE:
     
    6977
    7078    case OBJECTS_ERROR:
    71       return RTEMS_INVALID_ID;
    72 
    73     case OBJECTS_LOCAL:
    74       if ( _Thread_Restart( the_thread, NULL, argument ) ) {
    75         _Thread_Enable_dispatch();
    76         return RTEMS_SUCCESSFUL;
    77       }
    78       _Thread_Enable_dispatch();
    79       return RTEMS_INCORRECT_STATE;
     79      break;
    8080  }
    8181
    82   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     82  return RTEMS_INVALID_ID;
    8383}
  • cpukit/rtems/src/taskresume.c

    r393a1e05 rebe61382  
    5858  switch ( location ) {
    5959
     60    case OBJECTS_LOCAL:
     61      if ( _States_Is_suspended( the_thread->current_state ) ) {
     62        _Thread_Resume( the_thread, TRUE );
     63        _Thread_Enable_dispatch();
     64        return RTEMS_SUCCESSFUL;
     65      }
     66      _Thread_Enable_dispatch();
     67      return RTEMS_INCORRECT_STATE;
     68
    6069#if defined(RTEMS_MULTIPROCESSING)
    6170    case OBJECTS_REMOTE:
     
    7079
    7180    case OBJECTS_ERROR:
    72       return RTEMS_INVALID_ID;
    73 
    74     case OBJECTS_LOCAL:
    75       if ( _States_Is_suspended( the_thread->current_state ) ) {
    76         _Thread_Resume( the_thread, TRUE );
    77         _Thread_Enable_dispatch();
    78         return RTEMS_SUCCESSFUL;
    79       }
    80       _Thread_Enable_dispatch();
    81       return RTEMS_INCORRECT_STATE;
     81      break;
    8282  }
    8383
    84   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     84  return RTEMS_INVALID_ID;
    8585}
  • cpukit/rtems/src/tasksetnote.c

    r393a1e05 rebe61382  
    8282  switch ( location ) {
    8383
     84    case OBJECTS_LOCAL:
     85      api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
     86      api->Notepads[ notepad ] = note;
     87      _Thread_Enable_dispatch();
     88      return RTEMS_SUCCESSFUL;
     89
    8490#if defined(RTEMS_MULTIPROCESSING)
    8591    case OBJECTS_REMOTE:
     
    94100
    95101    case OBJECTS_ERROR:
    96       return RTEMS_INVALID_ID;
    97 
    98     case OBJECTS_LOCAL:
    99       api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
    100       api->Notepads[ notepad ] = note;
    101       _Thread_Enable_dispatch();
    102       return RTEMS_SUCCESSFUL;
     102      break;
    103103  }
    104104
    105   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     105  return RTEMS_INVALID_ID;
    106106}
  • cpukit/rtems/src/tasksetpriority.c

    r393a1e05 rebe61382  
    7171  switch ( location ) {
    7272
     73    case OBJECTS_LOCAL:
     74      /* XXX convert from core priority */
     75      *old_priority = the_thread->current_priority;
     76      if ( new_priority != RTEMS_CURRENT_PRIORITY ) {
     77        the_thread->real_priority = new_priority;
     78        if ( the_thread->resource_count == 0 ||
     79             the_thread->current_priority > new_priority )
     80          _Thread_Change_priority( the_thread, new_priority, FALSE );
     81      }
     82      _Thread_Enable_dispatch();
     83      return RTEMS_SUCCESSFUL;
     84
    7385#if defined(RTEMS_MULTIPROCESSING)
    7486    case OBJECTS_REMOTE:
     
    8496
    8597    case OBJECTS_ERROR:
    86       return RTEMS_INVALID_ID;
    87 
    88     case OBJECTS_LOCAL:
    89       /* XXX convert from core priority */
    90       *old_priority = the_thread->current_priority;
    91       if ( new_priority != RTEMS_CURRENT_PRIORITY ) {
    92         the_thread->real_priority = new_priority;
    93         if ( the_thread->resource_count == 0 ||
    94              the_thread->current_priority > new_priority )
    95           _Thread_Change_priority( the_thread, new_priority, FALSE );
    96       }
    97       _Thread_Enable_dispatch();
    98       return RTEMS_SUCCESSFUL;
     98      break;
    9999  }
    100100
    101   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     101  return RTEMS_INVALID_ID;
    102102}
  • cpukit/rtems/src/taskstart.c

    r393a1e05 rebe61382  
    6666  switch ( location ) {
    6767
    68 #if defined(RTEMS_MULTIPROCESSING)
    69     case OBJECTS_REMOTE:
    70       _Thread_Dispatch();
    71       return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
    72 #endif
    73 
    74     case OBJECTS_ERROR:
    75       return RTEMS_INVALID_ID;
    76 
    7768    case OBJECTS_LOCAL:
    7869      if ( _Thread_Start(
     
    8374      _Thread_Enable_dispatch();
    8475      return RTEMS_INCORRECT_STATE;
     76
     77#if defined(RTEMS_MULTIPROCESSING)
     78    case OBJECTS_REMOTE:
     79      _Thread_Dispatch();
     80      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
     81#endif
     82
     83    case OBJECTS_ERROR:
     84      break;
    8585  }
    8686
    87   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     87  return RTEMS_INVALID_ID;
    8888}
  • cpukit/rtems/src/tasksuspend.c

    r393a1e05 rebe61382  
    5959  switch ( location ) {
    6060
     61    case OBJECTS_LOCAL:
     62      if ( !_States_Is_suspended( the_thread->current_state ) ) {
     63        _Thread_Suspend( the_thread );
     64        _Thread_Enable_dispatch();
     65        return RTEMS_SUCCESSFUL;
     66      }
     67      _Thread_Enable_dispatch();
     68      return RTEMS_ALREADY_SUSPENDED;
     69
    6170#if defined(RTEMS_MULTIPROCESSING)
    6271    case OBJECTS_REMOTE:
     
    7180
    7281    case OBJECTS_ERROR:
    73       return RTEMS_INVALID_ID;
    74 
    75     case OBJECTS_LOCAL:
    76       if ( !_States_Is_suspended( the_thread->current_state ) ) {
    77         _Thread_Suspend( the_thread );
    78         _Thread_Enable_dispatch();
    79         return RTEMS_SUCCESSFUL;
    80       }
    81       _Thread_Enable_dispatch();
    82       return RTEMS_ALREADY_SUSPENDED;
     82      break;
    8383  }
    8484
    85   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     85  return RTEMS_INVALID_ID;
    8686}
  • cpukit/rtems/src/taskvariableadd.c

    r393a1e05 rebe61382  
    4242  the_thread = _Thread_Get (tid, &location);
    4343  switch (location) {
     44
     45    case OBJECTS_LOCAL:
     46      /*
     47       *  Figure out if the variable is already in this task's list.
     48       */
     49      tvp = the_thread->task_variables;
     50      while (tvp) {
     51        if (tvp->ptr == ptr) {
     52          tvp->dtor = dtor;
     53          _Thread_Enable_dispatch();
     54          return RTEMS_SUCCESSFUL;
     55        }
     56        tvp = (rtems_task_variable_t *)tvp->next;
     57      }
     58
     59      /*
     60       *  Now allocate memory for this task variable.
     61       */
     62      new = (rtems_task_variable_t *)
     63         _Workspace_Allocate(sizeof(rtems_task_variable_t));
     64      if (new == NULL) {
     65        _Thread_Enable_dispatch();
     66        return RTEMS_NO_MEMORY;
     67      }
     68      new->gval = *ptr;
     69      new->ptr = ptr;
     70      new->dtor = dtor;
     71
     72      new->next = (struct rtems_task_variable_tt *)the_thread->task_variables;
     73      the_thread->task_variables = new;
     74      _Thread_Enable_dispatch();
     75      return RTEMS_SUCCESSFUL;
     76
    4477#if defined(RTEMS_MULTIPROCESSING)
    45   case OBJECTS_REMOTE:
    46     _Thread_Dispatch();
    47     return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
     78    case OBJECTS_REMOTE:
     79      _Thread_Dispatch();
     80      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
    4881#endif
    4982
    50   case OBJECTS_ERROR:
    51   default:
    52     return RTEMS_INVALID_ID;
    53 
    54   case OBJECTS_LOCAL:
    55 
    56     /*
    57      *  Figure out if the variable is already in this task's list.
    58      */
    59 
    60     tvp = the_thread->task_variables;
    61     while (tvp) {
    62       if (tvp->ptr == ptr) {
    63         tvp->dtor = dtor;
    64         _Thread_Enable_dispatch();
    65         return RTEMS_SUCCESSFUL;
    66       }
    67       tvp = (rtems_task_variable_t *)tvp->next;
    68     }
    69 
    70     /*
    71      *  Now allocate memory for this task variable.
    72      */
    73 
    74     new = (rtems_task_variable_t *)
    75        _Workspace_Allocate(sizeof(rtems_task_variable_t));
    76     if (new == NULL) {
    77       _Thread_Enable_dispatch();
    78       return RTEMS_NO_MEMORY;
    79     }
    80     new->gval = *ptr;
    81     new->ptr = ptr;
    82     new->dtor = dtor;
    83 
    84     new->next = (struct rtems_task_variable_tt *)the_thread->task_variables;
    85     the_thread->task_variables = new;
    86     _Thread_Enable_dispatch();
    87     return RTEMS_SUCCESSFUL;
     83    case OBJECTS_ERROR:
     84      break;
    8885  }
    89   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     86  return RTEMS_INVALID_ID;
    9087}
  • cpukit/rtems/src/taskvariabledelete.c

    r393a1e05 rebe61382  
    4343  the_thread = _Thread_Get (tid, &location);
    4444  switch (location) {
     45
     46    case OBJECTS_LOCAL:
     47      tvp = the_thread->task_variables;
     48      while (tvp) {
     49        if (tvp->ptr == ptr) {
     50          if (prev)
     51            prev->next = tvp->next;
     52          else     
     53            the_thread->task_variables = (rtems_task_variable_t *)tvp->next;
     54          if (_Thread_Is_executing(the_thread)) {
     55            if (tvp->dtor)
     56              (*tvp->dtor)(*tvp->ptr);
     57            *tvp->ptr = tvp->gval;
     58          } else {
     59            if (tvp->dtor)
     60              (*tvp->dtor)(tvp->tval);
     61          }
     62          _Workspace_Free(tvp);
     63          _Thread_Enable_dispatch();
     64          return RTEMS_SUCCESSFUL;
     65        }
     66        prev = tvp;
     67        tvp = (rtems_task_variable_t *)tvp->next;
     68      }
     69      _Thread_Enable_dispatch();
     70      return RTEMS_INVALID_ADDRESS;
     71
    4572#if defined(RTEMS_MULTIPROCESSING)
    46   case OBJECTS_REMOTE:
    47     _Thread_Dispatch();
    48     return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
     73    case OBJECTS_REMOTE:
     74      _Thread_Dispatch();
     75      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
    4976#endif
    5077
    51 
    52   case OBJECTS_ERROR:
    53   default:
    54     return RTEMS_INVALID_ID;
    55 
    56   case OBJECTS_LOCAL:
    57     tvp = the_thread->task_variables;
    58     while (tvp) {
    59       if (tvp->ptr == ptr) {
    60         if (prev)
    61           prev->next = tvp->next;
    62         else     
    63           the_thread->task_variables = (rtems_task_variable_t *)tvp->next;
    64         if (_Thread_Is_executing(the_thread)) {
    65           if (tvp->dtor)
    66             (*tvp->dtor)(*tvp->ptr);
    67           *tvp->ptr = tvp->gval;
    68         } else {
    69           if (tvp->dtor)
    70             (*tvp->dtor)(tvp->tval);
    71         }
    72         _Workspace_Free(tvp);
    73         _Thread_Enable_dispatch();
    74         return RTEMS_SUCCESSFUL;
    75       }
    76       prev = tvp;
    77       tvp = (rtems_task_variable_t *)tvp->next;
    78     }
    79     _Thread_Enable_dispatch();
    80     return RTEMS_INVALID_ADDRESS;
     78    case OBJECTS_ERROR:
     79        break;
    8180  }
    8281
    83   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     82  return RTEMS_INVALID_ID;
    8483}
  • cpukit/rtems/src/taskvariableget.c

    r393a1e05 rebe61382  
    4545  the_thread = _Thread_Get (tid, &location);
    4646  switch (location) {
     47
     48    case OBJECTS_LOCAL:
     49      /*
     50       *  Figure out if the variable is in this task's list.
     51       */
     52      tvp = the_thread->task_variables;
     53      while (tvp) {
     54        if (tvp->ptr == ptr) {
     55          /*
     56           * Should this return the current (i.e not the
     57           * saved) value if `tid' is the current task?
     58           */
     59          *result = tvp->tval;
     60          _Thread_Enable_dispatch();
     61          return RTEMS_SUCCESSFUL;
     62        }
     63        tvp = (rtems_task_variable_t *)tvp->next;
     64      }
     65      _Thread_Enable_dispatch();
     66      return RTEMS_INVALID_ADDRESS;
     67
    4768#if defined(RTEMS_MULTIPROCESSING)
    48   case OBJECTS_REMOTE:
    49     _Thread_Dispatch();
    50     return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
     69    case OBJECTS_REMOTE:
     70      _Thread_Dispatch();
     71      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
    5172#endif
    5273
    53   case OBJECTS_ERROR:
    54   default:
    55     return RTEMS_INVALID_ID;
    56 
    57   case OBJECTS_LOCAL:
    58 
    59     /*
    60      *  Figure out if the variable is in this task's list.
    61      */
    62 
    63     tvp = the_thread->task_variables;
    64     while (tvp) {
    65       if (tvp->ptr == ptr) {
    66         /*
    67          * Should this return the current (i.e not the
    68          * saved) value if `tid' is the current task?
    69          */
    70         *result = tvp->tval;
    71         _Thread_Enable_dispatch();
    72         return RTEMS_SUCCESSFUL;
    73       }
    74       tvp = (rtems_task_variable_t *)tvp->next;
    75     }
    76     _Thread_Enable_dispatch();
    77     return RTEMS_INVALID_ADDRESS;
     74    case OBJECTS_ERROR:
     75      break;
    7876  }
    79   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     77  return RTEMS_INVALID_ID;
    8078}
  • cpukit/rtems/src/timercancel.c

    r393a1e05 rebe61382  
    4949  the_timer = _Timer_Get( id, &location );
    5050  switch ( location ) {
    51 #if defined(RTEMS_MULTIPROCESSING)
    52     case OBJECTS_REMOTE:            /* should never return this */
    53       return RTEMS_INTERNAL_ERROR;
    54 #endif
    55 
    56     case OBJECTS_ERROR:
    57       return RTEMS_INVALID_ID;
    5851
    5952    case OBJECTS_LOCAL:
     
    6255      _Thread_Enable_dispatch();
    6356      return RTEMS_SUCCESSFUL;
     57
     58#if defined(RTEMS_MULTIPROCESSING)
     59    case OBJECTS_REMOTE:            /* should never return this */
     60#endif
     61    case OBJECTS_ERROR:
     62      break;
    6463  }
    6564
    66   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     65  return RTEMS_INVALID_ID;
    6766}
  • cpukit/rtems/src/timerdelete.c

    r393a1e05 rebe61382  
    4949  the_timer = _Timer_Get( id, &location );
    5050  switch ( location ) {
    51 #if defined(RTEMS_MULTIPROCESSING)
    52     case OBJECTS_REMOTE:            /* should never return this */
    53       return RTEMS_INTERNAL_ERROR;
    54 #endif
    55 
    56     case OBJECTS_ERROR:
    57       return RTEMS_INVALID_ID;
    5851
    5952    case OBJECTS_LOCAL:
     
    6356      _Thread_Enable_dispatch();
    6457      return RTEMS_SUCCESSFUL;
     58
     59#if defined(RTEMS_MULTIPROCESSING)
     60    case OBJECTS_REMOTE:            /* should never return this */
     61#endif
     62    case OBJECTS_ERROR:
     63      break;
    6564  }
    6665
    67   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     66  return RTEMS_INVALID_ID;
    6867}
  • cpukit/rtems/src/timerfirewhen.c

    r393a1e05 rebe61382  
    6969  the_timer = _Timer_Get( id, &location );
    7070  switch ( location ) {
    71 #if defined(RTEMS_MULTIPROCESSING)
    72     case OBJECTS_REMOTE:            /* should never return this */
    73       return RTEMS_INTERNAL_ERROR;
    74 #endif
    75 
    76     case OBJECTS_ERROR:
    77       return RTEMS_INVALID_ID;
    7871
    7972    case OBJECTS_LOCAL:
     
    8780      _Thread_Enable_dispatch();
    8881      return RTEMS_SUCCESSFUL;
     82
     83#if defined(RTEMS_MULTIPROCESSING)
     84    case OBJECTS_REMOTE:            /* should never return this */
     85#endif
     86    case OBJECTS_ERROR:
     87      break;
    8988  }
    9089
    91   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     90  return RTEMS_INVALID_ID;
    9291}
  • cpukit/rtems/src/timergetinfo.c

    r393a1e05 rebe61382  
    5656  the_timer = _Timer_Get( id, &location );
    5757  switch ( location ) {
    58 #if defined(RTEMS_MULTIPROCESSING)
    59     case OBJECTS_REMOTE:            /* should never return this */
    60       return RTEMS_INTERNAL_ERROR;
    61 #endif
    62 
    63     case OBJECTS_ERROR:
    64       return RTEMS_INVALID_ID;
    6558
    6659    case OBJECTS_LOCAL:
     
    7164      _Thread_Enable_dispatch();
    7265      return RTEMS_SUCCESSFUL;
     66
     67#if defined(RTEMS_MULTIPROCESSING)
     68    case OBJECTS_REMOTE:            /* should never return this */
     69#endif
     70    case OBJECTS_ERROR:
     71      break;
    7372  }
    7473
    75   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     74  return RTEMS_INVALID_ID;
    7675}
  • cpukit/rtems/src/timerreset.c

    r393a1e05 rebe61382  
    4949  the_timer = _Timer_Get( id, &location );
    5050  switch ( location ) {
    51 #if defined(RTEMS_MULTIPROCESSING)
    52     case OBJECTS_REMOTE:            /* should never return this */
    53       return RTEMS_INTERNAL_ERROR;
    54 #endif
    55 
    56     case OBJECTS_ERROR:
    57       return RTEMS_INVALID_ID;
    5851
    5952    case OBJECTS_LOCAL:
     
    7871      _Thread_Enable_dispatch();
    7972      return RTEMS_SUCCESSFUL;
     73
     74#if defined(RTEMS_MULTIPROCESSING)
     75    case OBJECTS_REMOTE:            /* should never return this */
     76#endif
     77    case OBJECTS_ERROR:
     78      break;
    8079  }
    8180
    82   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     81  return RTEMS_INVALID_ID;
    8382}
  • cpukit/rtems/src/timerserverfireafter.c

    r393a1e05 rebe61382  
    6666  the_timer = _Timer_Get( id, &location );
    6767  switch ( location ) {
    68 #if defined(RTEMS_MULTIPROCESSING)
    69     case OBJECTS_REMOTE:            /* should never return this */
    70       return RTEMS_INTERNAL_ERROR;
    71 #endif
    72 
    73     case OBJECTS_ERROR:
    74       return RTEMS_INVALID_ID;
    7568
    7669    case OBJECTS_LOCAL:
     
    107100      _Thread_Enable_dispatch();
    108101      return RTEMS_SUCCESSFUL;
     102
     103#if defined(RTEMS_MULTIPROCESSING)
     104    case OBJECTS_REMOTE:            /* should never return this */
     105#endif
     106    case OBJECTS_ERROR:
     107      break;
    109108  }
    110109
    111   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     110  return RTEMS_INVALID_ID;
    112111}
  • cpukit/rtems/src/timerserverfirewhen.c

    r393a1e05 rebe61382  
    7373  the_timer = _Timer_Get( id, &location );
    7474  switch ( location ) {
    75 #if defined(RTEMS_MULTIPROCESSING)
    76     case OBJECTS_REMOTE:            /* should never return this */
    77       return RTEMS_INTERNAL_ERROR;
    78 #endif
    79 
    80     case OBJECTS_ERROR:
    81       return RTEMS_INVALID_ID;
    8275
    8376    case OBJECTS_LOCAL:
     
    9487      _Thread_Enable_dispatch();
    9588      return RTEMS_SUCCESSFUL;
     89
     90#if defined(RTEMS_MULTIPROCESSING)
     91    case OBJECTS_REMOTE:            /* should never return this */
     92#endif
     93    case OBJECTS_ERROR:
     94      break;
    9695  }
    9796
    98   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
     97  return RTEMS_INVALID_ID;
    9998}
Note: See TracChangeset for help on using the changeset viewer.