Changeset 2df7fcf in rtems
- Timestamp:
- 06/14/16 09:45:22 (7 years ago)
- Branches:
- 5, master
- Children:
- 4da078a8
- Parents:
- ce6e9ec2
- git-author:
- Sebastian Huber <sebastian.huber@…> (06/14/16 09:45:22)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (06/22/16 12:00:27)
- Location:
- cpukit/posix
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/posix/Makefile.am
rce6e9ec2 r2df7fcf 21 21 include_rtems_posix_HEADERS += include/rtems/posix/config.h 22 22 include_rtems_posix_HEADERS += include/rtems/posix/posixapi.h 23 include_rtems_posix_HEADERS += include/rtems/posix/priorityimpl.h 23 24 24 25 if HAS_PTHREADS … … 38 39 include_rtems_posix_HEADERS += include/rtems/posix/mutex.h 39 40 include_rtems_posix_HEADERS += include/rtems/posix/muteximpl.h 40 include_rtems_posix_HEADERS += include/rtems/posix/priorityimpl.h41 41 include_rtems_posix_HEADERS += include/rtems/posix/psignal.h 42 42 include_rtems_posix_HEADERS += include/rtems/posix/psignalimpl.h -
cpukit/posix/include/rtems/posix/muteximpl.h
rce6e9ec2 r2df7fcf 51 51 * The default mutex attributes structure. 52 52 */ 53 extern pthread_mutexattr_t _POSIX_Mutex_Default_attributes;53 extern const pthread_mutexattr_t _POSIX_Mutex_Default_attributes; 54 54 55 55 RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Acquire_critical( -
cpukit/posix/include/rtems/posix/priorityimpl.h
rce6e9ec2 r2df7fcf 61 61 62 62 /** 63 * @brief Gets the maximum POSIX API priority for this scheduler instance. 64 * 65 * Such a priority is valid. A scheduler instance may support priority values 66 * that are not representable as an integer. 67 * 68 * @return The maximum POSIX API priority for this scheduler instance. 69 */ 70 int _POSIX_Priority_Get_maximum( const Scheduler_Control *scheduler ); 71 72 /** 63 73 * @brief Check if POSIX priority is valid. 64 74 * -
cpukit/posix/preinstall.am
rce6e9ec2 r2df7fcf 44 44 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/posix/posixapi.h 45 45 46 $(PROJECT_INCLUDE)/rtems/posix/priorityimpl.h: include/rtems/posix/priorityimpl.h $(PROJECT_INCLUDE)/rtems/posix/$(dirstamp) 47 $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/posix/priorityimpl.h 48 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/posix/priorityimpl.h 49 46 50 if HAS_PTHREADS 47 51 $(PROJECT_INCLUDE)/aio.h: include/aio.h $(PROJECT_INCLUDE)/$(dirstamp) … … 85 89 $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/posix/muteximpl.h 86 90 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/posix/muteximpl.h 87 88 $(PROJECT_INCLUDE)/rtems/posix/priorityimpl.h: include/rtems/posix/priorityimpl.h $(PROJECT_INCLUDE)/rtems/posix/$(dirstamp)89 $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/posix/priorityimpl.h90 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/posix/priorityimpl.h91 91 92 92 $(PROJECT_INCLUDE)/rtems/posix/psignal.h: include/rtems/posix/psignal.h $(PROJECT_INCLUDE)/rtems/posix/$(dirstamp) -
cpukit/posix/src/mutex.c
rce6e9ec2 r2df7fcf 19 19 #endif 20 20 21 #include <errno.h>22 #include <pthread.h>23 21 #include <limits.h> 24 22 25 #include <rtems/system.h>26 23 #include <rtems/config.h> 27 24 #include <rtems/sysinit.h> 28 #include <rtems/score/coremuteximpl.h>29 #include <rtems/score/watchdog.h>30 25 #include <rtems/posix/muteximpl.h> 31 #include <rtems/ posix/priorityimpl.h>26 #include <rtems/score/objectimpl.h> 32 27 33 28 Objects_Information _POSIX_Mutex_Information; 34 29 35 pthread_mutexattr_t _POSIX_Mutex_Default_attributes; 30 const pthread_mutexattr_t _POSIX_Mutex_Default_attributes = { 31 #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) 32 .type = PTHREAD_MUTEX_DEFAULT, 33 #endif 34 .is_initialized = true, 35 .process_shared = PTHREAD_PROCESS_PRIVATE, 36 .prio_ceiling = INT_MAX, 37 .protocol = PTHREAD_PRIO_NONE, 38 .recursive = false 39 }; 36 40 37 41 /* … … 48 52 static void _POSIX_Mutex_Manager_initialization(void) 49 53 { 50 pthread_mutexattr_t *default_attr = &_POSIX_Mutex_Default_attributes;51 52 /*53 * Since the maximum priority is run-time configured, this54 * structure cannot be initialized statically.55 */56 default_attr->is_initialized = true;57 default_attr->process_shared = PTHREAD_PROCESS_PRIVATE;58 default_attr->prio_ceiling = POSIX_SCHEDULER_MAXIMUM_PRIORITY;59 default_attr->protocol = PTHREAD_PRIO_NONE;60 default_attr->recursive = false;61 #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES)62 default_attr->type = PTHREAD_MUTEX_DEFAULT;63 #endif64 65 54 /* 66 55 * Initialize the POSIX mutex object class information structure. -
cpukit/posix/src/mutexinit.c
rce6e9ec2 r2df7fcf 37 37 const pthread_mutexattr_t *the_attr; 38 38 POSIX_Mutex_Protocol protocol; 39 const Scheduler_Control *scheduler; 39 40 Priority_Control priority; 40 41 … … 106 107 107 108 if ( protocol == POSIX_MUTEX_PRIORITY_CEILING ) { 108 if ( !_POSIX_Priority_Is_valid( the_attr->prio_ceiling ) ) { 109 int prio_ceiling; 110 111 scheduler = _Scheduler_Get_own( _Thread_Get_executing() ); 112 prio_ceiling = the_attr->prio_ceiling; 113 114 if ( prio_ceiling == INT_MAX ) { 115 prio_ceiling = _POSIX_Priority_Get_maximum( scheduler ); 116 } 117 118 if ( !_POSIX_Priority_Is_valid( prio_ceiling ) ) { 109 119 return EINVAL; 110 120 } 111 121 112 priority = _POSIX_Priority_To_core( the_attr->prio_ceiling );122 priority = _POSIX_Priority_To_core( prio_ceiling ); 113 123 } 114 124 -
cpukit/posix/src/psxpriorityisvalid.c
rce6e9ec2 r2df7fcf 19 19 #endif 20 20 21 #include <rtems/system.h>22 21 #include <rtems/posix/priorityimpl.h> 22 23 int _POSIX_Priority_Get_maximum( const Scheduler_Control *scheduler ) 24 { 25 if ( scheduler->maximum_priority < INT_MAX ) { 26 return (int) scheduler->maximum_priority - 1; 27 } else { 28 return INT_MAX; 29 } 30 } 23 31 24 32 bool _POSIX_Priority_Is_valid( -
cpukit/posix/src/sched_getprioritymax.c
rce6e9ec2 r2df7fcf 22 22 23 23 #include <sched.h> 24 #include <errno.h>25 24 26 #include <rtems/system.h>27 25 #include <rtems/seterr.h> 26 #include <rtems/posix/priorityimpl.h> 28 27 #include <rtems/score/schedulerimpl.h> 29 28 … … 46 45 47 46 scheduler = _Scheduler_Get_own( _Thread_Get_executing() ); 48 49 if ( scheduler->maximum_priority > INT_MAX ) { 50 return INT_MAX; 51 } 52 53 return (int) scheduler->maximum_priority - 1; 47 return _POSIX_Priority_Get_maximum( scheduler ); 54 48 }
Note: See TracChangeset
for help on using the changeset viewer.