Changeset 4d320062 in rtems


Ignore:
Timestamp:
Jan 9, 2008, 10:08:31 PM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.9, master
Children:
5b33dc80
Parents:
7fbe6805
Message:

2008-01-09 Joel Sherrill <joel.sherrill@…>

  • posix/Makefile.am, posix/include/rtems/posix/cond.h, posix/include/rtems/posix/mutex.h, posix/inline/rtems/posix/cond.inl, posix/inline/rtems/posix/mutex.inl: Do not include POSIX Mutex or Condition Variable object get helpers because they are more complicated than the norm. They can implicitly perform a create. They cross the line as being too complex and large to inline since they negatively impact size and binary test coverage.
  • posix/src/condget.c, posix/src/mutexget.c: New files.
Location:
cpukit
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r7fbe6805 r4d320062  
     12008-01-09      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * posix/Makefile.am, posix/include/rtems/posix/cond.h,
     4        posix/include/rtems/posix/mutex.h, posix/inline/rtems/posix/cond.inl,
     5        posix/inline/rtems/posix/mutex.inl: Do not include POSIX Mutex or
     6        Condition Variable object get helpers because they are more
     7        complicated than the norm. They can implicitly perform a create. They
     8        cross the line as being too complex and large to inline since they
     9        negatively impact size and binary test coverage.
     10        * posix/src/condget.c, posix/src/mutexget.c: New files.
     11
    1122008-01-09      Joel Sherrill <joel.sherrill@oarcorp.com>
    213
  • cpukit/posix/Makefile.am

    r7fbe6805 r4d320062  
    7878    src/condbroadcast.c src/conddefaultattributes.c src/conddestroy.c \
    7979    src/condinit.c src/condsignal.c src/condsignalsupp.c \
    80     src/condtimedwait.c src/condwait.c src/condwaitsupp.c
     80    src/condtimedwait.c src/condwait.c src/condwaitsupp.c src/condget.c
    8181
    8282## KEY_C_FILES
     
    106106    src/mutexlock.c src/mutexlocksupp.c src/mutexsetprioceiling.c \
    107107    src/mutextimedlock.c src/mutextranslatereturncode.c src/mutextrylock.c \
    108     src/mutexunlock.c
     108    src/mutexunlock.c src/mutexget.c
    109109
    110110## PTHREAD_C_FILES
  • cpukit/posix/include/rtems/posix/cond.h

    r7fbe6805 r4d320062  
    159159);
    160160
     161/*
     162 *  _POSIX_Condition_variables_Get
     163 *
     164 *  DESCRIPTION:
     165 *
     166 *  A support routine which translates the condition variable id into
     167 *  a local pointer.  As a side-effect, it may create the condition
     168 *  variable.
     169 */
     170
     171POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
     172  pthread_cond_t    *cond,
     173  Objects_Locations *location
     174);
     175
    161176#include <rtems/posix/cond.inl>
    162177
  • cpukit/posix/include/rtems/posix/mutex.h

    r7fbe6805 r4d320062  
    148148
    149149
     150/*
     151 *  _POSIX_Mutex_Get
     152 *
     153 *  DESCRIPTION:
     154 *
     155 *  A support routine which translates the mutex id into a local pointer.
     156 *  As a side-effect, it may create the mutex.
     157 *
     158 *  NOTE:
     159 *
     160 *  This version of the method uses a dispatching critical section.
     161 */
     162
     163POSIX_Mutex_Control *_POSIX_Mutex_Get (
     164  pthread_mutex_t   *mutex,
     165  Objects_Locations *location
     166);
     167
     168/*
     169 *  _POSIX_Mutex_Get
     170 *
     171 *  DESCRIPTION:
     172 *
     173 *  A support routine which translates the mutex id into a local pointer.
     174 *  As a side-effect, it may create the mutex.
     175 *
     176 *  NOTE:
     177 *
     178 *  This version of the method uses an interrupt critical section.
     179 */
     180
     181POSIX_Mutex_Control *_POSIX_Mutex_Get_interrupt_disable (
     182  pthread_mutex_t   *mutex,
     183  Objects_Locations *location,
     184  ISR_Level         *level
     185);
     186
    150187#include <rtems/posix/mutex.inl>
    151188
  • cpukit/posix/inline/rtems/posix/cond.inl

    r7fbe6805 r4d320062  
    5252/*PAGE
    5353 *
    54  *  _POSIX_Condition_variables_Get
    55  */
    56 
    57 RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control
    58 *_POSIX_Condition_variables_Get (
    59   pthread_cond_t    *cond,
    60   Objects_Locations *location
    61 )
    62 {
    63   Objects_Id        *id = (Objects_Id *)cond;
    64   int status;
    65 
    66   if ( !id ) {
    67     *location = OBJECTS_ERROR;
    68     return (POSIX_Condition_variables_Control *) 0;
    69   }
    70 
    71   if ( *id == PTHREAD_COND_INITIALIZER ) {
    72     /*
    73      *  Do an "auto-create" here.
    74      */
    75 
    76     status = pthread_cond_init( (pthread_cond_t *)id, 0 );
    77     if ( status ) {
    78       *location = OBJECTS_ERROR;
    79       return (POSIX_Condition_variables_Control *) 0;
    80     }
    81   }
    82 
    83   /*
    84    *  Now call Objects_Get()
    85    */
    86 
    87   return (POSIX_Condition_variables_Control *)
    88     _Objects_Get( &_POSIX_Condition_variables_Information, *id, location );
    89 }
    90  
    91 /*PAGE
    92  *
    9354 *  _POSIX_Condition_variables_Is_null
    9455 */
  • cpukit/posix/inline/rtems/posix/mutex.inl

    r7fbe6805 r4d320062  
    4545/*PAGE
    4646 *
    47  *  _POSIX_Mutex_Get_support
    48  *
    49  *  NOTE: The support macro makes it possible for both to use exactly
    50  *        the same code to check for NULL id pointer and
    51  *        PTHREAD_MUTEX_INITIALIZER without adding overhead.
    52  */
    53 
    54 #define ___POSIX_Mutex_Get_support( _id, _location ) \
    55   do { \
    56     int _status; \
    57     \
    58     if ( !_id ) { \
    59       *_location = OBJECTS_ERROR; \
    60       return (POSIX_Mutex_Control *) 0; \
    61     }  \
    62     \
    63     if ( *_id == PTHREAD_MUTEX_INITIALIZER ) { \
    64       /* \
    65        *  Do an "auto-create" here. \
    66        */ \
    67     \
    68       _status = pthread_mutex_init( (pthread_mutex_t *)_id, 0 ); \
    69       if ( _status ) { \
    70         *_location = OBJECTS_ERROR;  \
    71         return (POSIX_Mutex_Control *) 0; \
    72       } \
    73     } \
    74   } while (0)
    75  
    76 RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get (
    77   pthread_mutex_t   *mutex,
    78   Objects_Locations *location
    79 )
    80 {
    81   Objects_Id *id = (Objects_Id *)mutex;
    82 
    83   ___POSIX_Mutex_Get_support( id, location );
    84 
    85   return (POSIX_Mutex_Control *)
    86     _Objects_Get( &_POSIX_Mutex_Information, *id, location );
    87 }
    88 
    89 RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get_interrupt_disable (
    90   pthread_mutex_t   *mutex,
    91   Objects_Locations *location,
    92   ISR_Level         *level
    93 )
    94 {
    95   Objects_Id *id = (Objects_Id *)mutex;
    96 
    97   ___POSIX_Mutex_Get_support( id, location );
    98 
    99   return (POSIX_Mutex_Control *)
    100     _Objects_Get_isr_disable( &_POSIX_Mutex_Information, *id, location, level );
    101 }
    102 
    103  
    104 /*PAGE
    105  *
    10647 *  _POSIX_Mutex_Is_null
    10748 */
Note: See TracChangeset for help on using the changeset viewer.