Changeset 77ff5599 in rtems
- Timestamp:
- 06/10/16 06:48:54 (7 years ago)
- Branches:
- 5, master
- Children:
- 7ec66e08
- Parents:
- b8f76fa
- git-author:
- Sebastian Huber <sebastian.huber@…> (06/10/16 06:48:54)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (06/22/16 12:36:40)
- Files:
-
- 5 added
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/libmisc/monitor/mon-sema.c
rb8f76fa r77ff5599 62 62 switch ( rtems_sema->variant ) { 63 63 case SEMAPHORE_VARIANT_MUTEX_PRIORITY_CEILING: 64 canonical_sema->priority_ceiling = 65 rtems_sema->Core_control.Mutex.priority_ceiling; 64 canonical_sema->priority_ceiling = _Scheduler_Unmap_priority( 65 _CORE_ceiling_mutex_Get_scheduler( &rtems_sema->Core_control.Mutex ), 66 _CORE_ceiling_mutex_Get_priority( &rtems_sema->Core_control.Mutex ) 67 ); 66 68 /* Fall through */ 67 69 case SEMAPHORE_VARIANT_MUTEX_INHERIT_PRIORITY: -
cpukit/posix/include/rtems/posix/priorityimpl.h
rb8f76fa r77ff5599 89 89 * @return The corresponding POSIX API priority. 90 90 */ 91 RTEMS_INLINE_ROUTINEint _POSIX_Priority_From_core(91 int _POSIX_Priority_From_core( 92 92 const Scheduler_Control *scheduler, 93 93 Priority_Control priority 94 ) 95 { 96 return (int) ( scheduler->maximum_priority - priority ); 97 } 94 ); 98 95 99 96 /** @} */ -
cpukit/posix/src/mutexgetprioceiling.c
rb8f76fa r77ff5599 46 46 _POSIX_Mutex_Acquire_critical( the_mutex, &queue_context ); 47 47 48 *prioceiling = _POSIX_Priority_From_core( 49 &_Scheduler_Table[ 0 ], 50 the_mutex->Mutex.priority_ceiling 51 ); 48 if ( the_mutex->protocol == POSIX_MUTEX_PRIORITY_CEILING ) { 49 *prioceiling = _POSIX_Priority_From_core( 50 _CORE_ceiling_mutex_Get_scheduler( &the_mutex->Mutex ), 51 _CORE_ceiling_mutex_Get_priority( &the_mutex->Mutex ) 52 ); 53 } else { 54 *prioceiling = 0; 55 } 52 56 53 57 _POSIX_Mutex_Release( the_mutex, &queue_context ); -
cpukit/posix/src/mutexinit.c
rb8f76fa r77ff5599 136 136 switch ( protocol ) { 137 137 case POSIX_MUTEX_PRIORITY_CEILING: 138 _CORE_ceiling_mutex_Initialize( 139 &the_mutex->Mutex, 140 priority 141 ); 138 _CORE_ceiling_mutex_Initialize( &the_mutex->Mutex, scheduler, priority ); 142 139 break; 143 140 default: … … 146 143 || the_mutex->protocol == POSIX_MUTEX_PRIORITY_INHERIT 147 144 ); 148 _CORE_recursive_mutex_Initialize( 149 &the_mutex->Mutex.Recursive 150 ); 145 _CORE_recursive_mutex_Initialize( &the_mutex->Mutex.Recursive ); 151 146 break; 152 147 } -
cpukit/posix/src/mutexsetprioceiling.c
rb8f76fa r77ff5599 32 32 ) 33 33 { 34 POSIX_Mutex_Control *the_mutex; 35 const Scheduler_Control *scheduler; 36 bool valid; 37 Priority_Control priority; 38 int error; 39 int unlock_error; 34 POSIX_Mutex_Control *the_mutex; 35 int error; 36 int unlock_error; 40 37 41 if ( !old_ceiling )38 if ( old_ceiling == NULL ) { 42 39 return EINVAL; 40 } 43 41 44 42 /* … … 55 53 _Assert( the_mutex != NULL ); 56 54 57 scheduler = &_Scheduler_Table[ 0 ]; 55 if ( the_mutex->protocol == POSIX_MUTEX_PRIORITY_CEILING ) { 56 const Scheduler_Control *scheduler; 57 bool valid; 58 Priority_Control new_priority; 59 Priority_Control old_priority; 58 60 59 *old_ceiling = _POSIX_Priority_From_core( 60 scheduler, 61 the_mutex->Mutex.priority_ceiling 62 ); 61 scheduler = _CORE_ceiling_mutex_Get_scheduler( &the_mutex->Mutex ); 62 old_priority = _CORE_ceiling_mutex_Get_priority( &the_mutex->Mutex ); 63 *old_ceiling = _POSIX_Priority_From_core( scheduler, old_priority ); 63 64 64 priority = _POSIX_Priority_To_core( scheduler, prioceiling, &valid ); 65 if ( valid ) { 66 the_mutex->Mutex.priority_ceiling = priority; 65 new_priority = _POSIX_Priority_To_core( scheduler, prioceiling, &valid ); 66 if ( valid ) { 67 _CORE_ceiling_mutex_Set_priority( &the_mutex->Mutex, new_priority ); 68 error = 0; 69 } else { 70 error = EINVAL; 71 } 72 } else { 73 *old_ceiling = 0; 67 74 error = 0; 68 } else {69 error = EINVAL;70 75 } 71 76 -
cpukit/posix/src/psxpriorityisvalid.c
rb8f76fa r77ff5599 20 20 21 21 #include <rtems/posix/priorityimpl.h> 22 #include <rtems/score/schedulerimpl.h> 22 23 23 24 int _POSIX_Priority_Get_maximum( const Scheduler_Control *scheduler ) … … 45 46 && core_posix_priority < scheduler->maximum_priority ); 46 47 47 return core_priority;48 return _Scheduler_Map_priority( scheduler, core_priority ); 48 49 } 50 51 int _POSIX_Priority_From_core( 52 const Scheduler_Control *scheduler, 53 Priority_Control core_priority 54 ) 55 { 56 core_priority = _Scheduler_Unmap_priority( scheduler, core_priority ); 57 58 return (int) ( scheduler->maximum_priority - core_priority ); 59 } -
cpukit/posix/src/pthreadcreate.c
rb8f76fa r77ff5599 104 104 105 105 executing = _Thread_Get_executing(); 106 scheduler = _Scheduler_Get_own( executing ); 106 107 107 108 /* … … 198 199 &_POSIX_Threads_Information, 199 200 the_thread, 200 _Scheduler_Get( executing ),201 scheduler, 201 202 the_attr->stackaddr, 202 203 _POSIX_Threads_Ensure_minimum_stack(the_attr->stacksize), -
cpukit/rtems/include/rtems/rtems/tasksimpl.h
rb8f76fa r77ff5599 20 20 #include <rtems/rtems/tasks.h> 21 21 #include <rtems/score/objectimpl.h> 22 #include <rtems/score/scheduler .h>22 #include <rtems/score/schedulerimpl.h> 23 23 #include <rtems/score/threadimpl.h> 24 24 … … 97 97 *valid = ( priority <= scheduler->maximum_priority ); 98 98 99 return (Priority_Control) priority;99 return _Scheduler_Map_priority( scheduler, (Priority_Control) priority ); 100 100 } 101 101 … … 114 114 ) 115 115 { 116 return (rtems_task_priority) priority; 116 return (rtems_task_priority) 117 _Scheduler_Unmap_priority( scheduler, priority ); 117 118 } 118 119 -
cpukit/rtems/src/semcreate.c
rb8f76fa r77ff5599 164 164 _CORE_ceiling_mutex_Initialize( 165 165 &the_semaphore->Core_control.Mutex, 166 scheduler, 166 167 priority 167 168 ); … … 201 202 status = _MRSP_Initialize( 202 203 &the_semaphore->Core_control.MRSP, 204 scheduler, 203 205 priority, 204 206 executing, -
cpukit/rtems/src/semsetpriority.c
rb8f76fa r77ff5599 21 21 #include <rtems/score/schedulerimpl.h> 22 22 23 static rtems_status_code _Semaphore_Is_scheduler_valid( 24 const CORE_ceiling_mutex_Control *the_mutex, 25 const Scheduler_Control *scheduler 26 ) 27 { 28 #if defined(RTEMS_SMP) 29 if ( scheduler != _CORE_ceiling_mutex_Get_scheduler( the_mutex ) ) { 30 return RTEMS_NOT_DEFINED; 31 } 32 #endif 33 34 return RTEMS_SUCCESSFUL; 35 } 36 23 37 static rtems_status_code _Semaphore_Set_priority( 24 38 Semaphore_Control *the_semaphore, … … 33 47 Priority_Control core_priority; 34 48 Priority_Control old_priority; 35 #if defined(RTEMS_SMP)36 MRSP_Control *mrsp;37 uint32_t scheduler_index;38 #endif39 49 40 50 core_priority = _RTEMS_Priority_To_core( scheduler, new_priority, &valid ); … … 43 53 } 44 54 55 _Thread_queue_Acquire_critical( 56 &the_semaphore->Core_control.Wait_queue, 57 &queue_context->Lock_context 58 ); 59 45 60 switch ( the_semaphore->variant ) { 46 61 case SEMAPHORE_VARIANT_MUTEX_PRIORITY_CEILING: 47 _CORE_mutex_Acquire_critical(48 &the_semaphore->Core_control.Mutex .Recursive.Mutex,49 queue_context62 sc = _Semaphore_Is_scheduler_valid( 63 &the_semaphore->Core_control.Mutex, 64 scheduler 50 65 ); 51 66 52 old_priority = the_semaphore->Core_control.Mutex.priority_ceiling; 67 old_priority = _CORE_ceiling_mutex_Get_priority( 68 &the_semaphore->Core_control.Mutex 69 ); 53 70 54 if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 55 the_semaphore->Core_control.Mutex.priority_ceiling = core_priority; 71 if ( sc == RTEMS_SUCCESSFUL && new_priority != RTEMS_CURRENT_PRIORITY ) { 72 _CORE_ceiling_mutex_Set_priority( 73 &the_semaphore->Core_control.Mutex, 74 core_priority 75 ); 56 76 } 57 77 58 _CORE_mutex_Release(59 &the_semaphore->Core_control.Mutex.Recursive.Mutex,60 queue_context61 );62 sc = RTEMS_SUCCESSFUL;63 78 break; 64 79 #if defined(RTEMS_SMP) 65 80 case SEMAPHORE_VARIANT_MRSP: 66 mrsp = &the_semaphore->Core_control.MRSP; 67 scheduler_index = _Scheduler_Get_index( scheduler ); 68 69 _MRSP_Acquire_critical( mrsp, queue_context ); 70 71 old_priority = _MRSP_Get_ceiling_priority( mrsp, scheduler_index ); 81 old_priority = _MRSP_Get_priority( 82 &the_semaphore->Core_control.MRSP, 83 scheduler 84 ); 72 85 73 86 if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 74 _MRSP_Set_ceiling_priority( mrsp, scheduler_index, core_priority ); 87 _MRSP_Set_priority( 88 &the_semaphore->Core_control.MRSP, 89 scheduler, 90 core_priority 91 ); 75 92 } 76 93 77 _MRSP_Release( mrsp, queue_context );78 94 sc = RTEMS_SUCCESSFUL; 79 95 break; … … 86 102 || the_semaphore->variant == SEMAPHORE_VARIANT_COUNTING 87 103 ); 88 _ISR_lock_ISR_enable( &queue_context->Lock_context );89 104 old_priority = 0; 90 105 sc = RTEMS_NOT_DEFINED; … … 92 107 } 93 108 109 _Thread_queue_Release( 110 &the_semaphore->Core_control.Wait_queue, 111 &queue_context->Lock_context 112 ); 113 94 114 *old_priority_p = _RTEMS_Priority_From_core( scheduler, old_priority ); 95 96 115 return sc; 97 116 } -
cpukit/score/Makefile.am
rb8f76fa r77ff5599 228 228 libscore_a_SOURCES += src/schedulergetaffinity.c 229 229 libscore_a_SOURCES += src/schedulersetaffinity.c 230 libscore_a_SOURCES += src/schedulerdefaultmappriority.c 230 231 libscore_a_SOURCES += src/schedulerdefaultnodedestroy.c 231 232 libscore_a_SOURCES += src/schedulerdefaultnodeinit.c -
cpukit/score/include/rtems/score/coremutex.h
rb8f76fa r77ff5599 27 27 #include <rtems/score/watchdog.h> 28 28 #include <rtems/score/interr.h> 29 30 struct Scheduler_Control; 29 31 30 32 #ifdef __cplusplus … … 84 86 */ 85 87 Priority_Control priority_ceiling; 88 89 #if defined(RTEMS_SMP) 90 /** 91 * @brief The scheduler instance for this priority ceiling mutex. 92 */ 93 const struct Scheduler_Control *scheduler; 94 #endif 86 95 } CORE_ceiling_mutex_Control; 87 96 -
cpukit/score/include/rtems/score/coremuteximpl.h
rb8f76fa r77ff5599 21 21 #include <rtems/score/coremutex.h> 22 22 #include <rtems/score/chainimpl.h> 23 #include <rtems/score/schedulerimpl.h> 23 24 #include <rtems/score/status.h> 24 25 #include <rtems/score/threadimpl.h> … … 359 360 RTEMS_INLINE_ROUTINE void _CORE_ceiling_mutex_Initialize( 360 361 CORE_ceiling_mutex_Control *the_mutex, 362 const Scheduler_Control *scheduler, 361 363 Priority_Control priority_ceiling 362 364 ) … … 364 366 _CORE_recursive_mutex_Initialize( &the_mutex->Recursive ); 365 367 the_mutex->priority_ceiling = priority_ceiling; 368 #if defined(RTEMS_SMP) 369 the_mutex->scheduler = scheduler; 370 #endif 371 } 372 373 RTEMS_INLINE_ROUTINE const Scheduler_Control * 374 _CORE_ceiling_mutex_Get_scheduler( 375 const CORE_ceiling_mutex_Control *the_mutex 376 ) 377 { 378 #if defined(RTEMS_SMP) 379 return the_mutex->scheduler; 380 #else 381 return _Scheduler_Get_by_CPU_index( 0 ); 382 #endif 383 } 384 385 RTEMS_INLINE_ROUTINE void _CORE_ceiling_mutex_Set_priority( 386 CORE_ceiling_mutex_Control *the_mutex, 387 Priority_Control priority_ceiling 388 ) 389 { 390 the_mutex->priority_ceiling = priority_ceiling; 391 } 392 393 RTEMS_INLINE_ROUTINE Priority_Control _CORE_ceiling_mutex_Get_priority( 394 const CORE_ceiling_mutex_Control *the_mutex 395 ) 396 { 397 return the_mutex->priority_ceiling; 366 398 } 367 399 … … 415 447 416 448 if ( owner == NULL ) { 449 #if defined(RTEMS_SMP) 450 if ( 451 _Scheduler_Get_own( executing ) 452 != _CORE_ceiling_mutex_Get_scheduler( the_mutex ) 453 ) { 454 _CORE_mutex_Release( &the_mutex->Recursive.Mutex, queue_context ); 455 return STATUS_NOT_DEFINED; 456 } 457 #endif 458 417 459 return _CORE_ceiling_mutex_Set_owner( 418 460 the_mutex, -
cpukit/score/include/rtems/score/mrspimpl.h
rb8f76fa r77ff5599 139 139 140 140 RTEMS_INLINE_ROUTINE Status_Control _MRSP_Initialize( 141 MRSP_Control *mrsp, 142 Priority_Control ceiling_priority, 143 Thread_Control *executing, 144 bool initially_locked 141 MRSP_Control *mrsp, 142 const Scheduler_Control *scheduler, 143 Priority_Control ceiling_priority, 144 Thread_Control *executing, 145 bool initially_locked 145 146 ) 146 147 { … … 160 161 161 162 for ( i = 0 ; i < scheduler_count ; ++i ) { 162 mrsp->ceiling_priorities[ i ] = ceiling_priority; 163 const Scheduler_Control *scheduler_of_cpu; 164 165 scheduler_of_cpu = _Scheduler_Get_by_CPU_index( i ); 166 167 if ( scheduler != scheduler_of_cpu ) { 168 mrsp->ceiling_priorities[ i ] = 169 _Scheduler_Map_priority( scheduler_of_cpu, 0 ); 170 } else { 171 mrsp->ceiling_priorities[ i ] = ceiling_priority; 172 } 163 173 } 164 174 … … 170 180 } 171 181 172 RTEMS_INLINE_ROUTINE Priority_Control _MRSP_Get_ceiling_priority( 173 MRSP_Control *mrsp, 174 uint32_t scheduler_index 175 ) 176 { 182 RTEMS_INLINE_ROUTINE Priority_Control _MRSP_Get_priority( 183 const MRSP_Control *mrsp, 184 const Scheduler_Control *scheduler 185 ) 186 { 187 uint32_t scheduler_index; 188 189 scheduler_index = _Scheduler_Get_index( scheduler ); 177 190 return mrsp->ceiling_priorities[ scheduler_index ]; 178 191 } 179 192 180 RTEMS_INLINE_ROUTINE void _MRSP_Set_ceiling_priority( 181 MRSP_Control *mrsp, 182 uint32_t scheduler_index, 183 Priority_Control ceiling_priority 184 ) 185 { 186 mrsp->ceiling_priorities[ scheduler_index ] = ceiling_priority; 193 RTEMS_INLINE_ROUTINE void _MRSP_Set_priority( 194 MRSP_Control *mrsp, 195 const Scheduler_Control *scheduler, 196 Priority_Control new_priority 197 ) 198 { 199 uint32_t scheduler_index; 200 201 scheduler_index = _Scheduler_Get_index( scheduler ); 202 mrsp->ceiling_priorities[ scheduler_index ] = new_priority; 187 203 } 188 204 … … 308 324 Status_Control status; 309 325 const Scheduler_Control *scheduler = _Scheduler_Get_own( executing ); 310 uint32_t scheduler_index = _Scheduler_Get_index( scheduler );311 326 Priority_Control initial_priority = executing->current_priority; 312 Priority_Control ceiling_priority = 313 _MRSP_Get_ceiling_priority( mrsp, scheduler_index ); 327 Priority_Control ceiling_priority = _MRSP_Get_priority( mrsp, scheduler ); 314 328 bool priority_ok = !_Thread_Priority_less_than( 315 329 ceiling_priority, -
cpukit/score/include/rtems/score/scheduler.h
rb8f76fa r77ff5599 90 90 Priority_Control, 91 91 bool 92 ); 93 94 /** @see _Scheduler_Map_priority() */ 95 Priority_Control ( *map_priority )( 96 const Scheduler_Control *, 97 Priority_Control 98 ); 99 100 /** @see _Scheduler_Unmap_priority() */ 101 Priority_Control ( *unmap_priority )( 102 const Scheduler_Control *, 103 Priority_Control 92 104 ); 93 105 … … 404 416 #endif 405 417 418 /** 419 * @brief Returns the thread priority. 420 * 421 * @param[in] scheduler Unused. 422 * @param[in] priority The thread priority. 423 * 424 * @return priority The thread priority. 425 */ 426 Priority_Control _Scheduler_default_Map_priority( 427 const Scheduler_Control *scheduler, 428 Priority_Control priority 429 ); 430 431 #define _Scheduler_default_Unmap_priority _Scheduler_default_Map_priority 432 406 433 #if defined(RTEMS_SMP) 407 434 /** -
cpukit/score/include/rtems/score/schedulercbs.h
rb8f76fa r77ff5599 56 56 _Scheduler_CBS_Unblock, /* unblock entry point */ \ 57 57 _Scheduler_EDF_Change_priority, /* change priority entry point */ \ 58 _Scheduler_EDF_Map_priority, /* map priority entry point */ \ 59 _Scheduler_EDF_Unmap_priority, /* unmap priority entry point */ \ 58 60 SCHEDULER_OPERATION_DEFAULT_ASK_FOR_HELP \ 59 61 _Scheduler_CBS_Node_initialize, /* node initialize entry point */ \ -
cpukit/score/include/rtems/score/scheduleredf.h
rb8f76fa r77ff5599 49 49 _Scheduler_EDF_Unblock, /* unblock entry point */ \ 50 50 _Scheduler_EDF_Change_priority, /* change priority entry point */ \ 51 _Scheduler_EDF_Map_priority, /* map priority entry point */ \ 52 _Scheduler_EDF_Unmap_priority, /* unmap priority entry point */ \ 51 53 SCHEDULER_OPERATION_DEFAULT_ASK_FOR_HELP \ 52 54 _Scheduler_EDF_Node_initialize, /* node initialize entry point */ \ … … 204 206 ); 205 207 208 Priority_Control _Scheduler_EDF_Map_priority( 209 const Scheduler_Control *scheduler, 210 Priority_Control priority 211 ); 212 213 Priority_Control _Scheduler_EDF_Unmap_priority( 214 const Scheduler_Control *scheduler, 215 Priority_Control priority 216 ); 217 206 218 /** 207 219 * @brief invoked when a thread wishes to voluntarily -
cpukit/score/include/rtems/score/schedulerimpl.h
rb8f76fa r77ff5599 418 418 419 419 _Scheduler_Release_critical( own_scheduler, &lock_context ); 420 } 421 422 /** 423 * @brief Maps a thread priority from the user domain to the scheduler domain. 424 * 425 * Let M be the maximum scheduler priority. The mapping must be bijective in 426 * the closed interval [0, M], e.g. _Scheduler_Unmap_priority( scheduler, 427 * _Scheduler_Map_priority( scheduler, p ) ) == p for all p in [0, M]. For 428 * other values the mapping is undefined. 429 * 430 * @param[in] scheduler The scheduler instance. 431 * @param[in] priority The user domain thread priority. 432 * 433 * @return The corresponding thread priority of the scheduler domain is returned. 434 */ 435 RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Map_priority( 436 const Scheduler_Control *scheduler, 437 Priority_Control priority 438 ) 439 { 440 return ( *scheduler->Operations.map_priority )( scheduler, priority ); 441 } 442 443 /** 444 * @brief Unmaps a thread priority from the scheduler domain to the user domain. 445 * 446 * @param[in] scheduler The scheduler instance. 447 * @param[in] priority The scheduler domain thread priority. 448 * 449 * @return The corresponding thread priority of the user domain is returned. 450 */ 451 RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Unmap_priority( 452 const Scheduler_Control *scheduler, 453 Priority_Control priority 454 ) 455 { 456 return ( *scheduler->Operations.unmap_priority )( scheduler, priority ); 420 457 } 421 458 -
cpukit/score/include/rtems/score/schedulerpriority.h
rb8f76fa r77ff5599 46 46 _Scheduler_priority_Unblock, /* unblock entry point */ \ 47 47 _Scheduler_priority_Change_priority, /* change priority entry point */ \ 48 _Scheduler_default_Map_priority, /* map priority entry point */ \ 49 _Scheduler_default_Unmap_priority, /* unmap priority entry point */ \ 48 50 SCHEDULER_OPERATION_DEFAULT_ASK_FOR_HELP \ 49 51 _Scheduler_default_Node_initialize, /* node initialize entry point */ \ -
cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h
rb8f76fa r77ff5599 56 56 _Scheduler_priority_affinity_SMP_Unblock, \ 57 57 _Scheduler_priority_affinity_SMP_Change_priority, \ 58 _Scheduler_default_Map_priority, \ 59 _Scheduler_default_Unmap_priority, \ 58 60 _Scheduler_priority_affinity_SMP_Ask_for_help, \ 59 61 _Scheduler_priority_affinity_SMP_Node_initialize, \ -
cpukit/score/include/rtems/score/schedulerprioritysmp.h
rb8f76fa r77ff5599 85 85 _Scheduler_priority_SMP_Unblock, \ 86 86 _Scheduler_priority_SMP_Change_priority, \ 87 _Scheduler_default_Map_priority, \ 88 _Scheduler_default_Unmap_priority, \ 87 89 _Scheduler_priority_SMP_Ask_for_help, \ 88 90 _Scheduler_priority_SMP_Node_initialize, \ -
cpukit/score/include/rtems/score/schedulersimple.h
rb8f76fa r77ff5599 46 46 _Scheduler_simple_Unblock, /* unblock entry point */ \ 47 47 _Scheduler_simple_Change_priority, /* change priority entry point */ \ 48 _Scheduler_default_Map_priority, /* map priority entry point */ \ 49 _Scheduler_default_Unmap_priority, /* unmap priority entry point */ \ 48 50 SCHEDULER_OPERATION_DEFAULT_ASK_FOR_HELP \ 49 51 _Scheduler_default_Node_initialize, /* node initialize entry point */ \ -
cpukit/score/include/rtems/score/schedulersimplesmp.h
rb8f76fa r77ff5599 68 68 _Scheduler_simple_SMP_Unblock, \ 69 69 _Scheduler_simple_SMP_Change_priority, \ 70 _Scheduler_default_Map_priority, \ 71 _Scheduler_default_Unmap_priority, \ 70 72 _Scheduler_simple_SMP_Ask_for_help, \ 71 73 _Scheduler_simple_SMP_Node_initialize, \ -
cpukit/score/include/rtems/score/schedulerstrongapa.h
rb8f76fa r77ff5599 85 85 _Scheduler_strong_APA_Unblock, \ 86 86 _Scheduler_strong_APA_Change_priority, \ 87 _Scheduler_default_Map_priority, \ 88 _Scheduler_default_Unmap_priority, \ 87 89 _Scheduler_strong_APA_Ask_for_help, \ 88 90 _Scheduler_strong_APA_Node_initialize, \ -
cpukit/score/include/rtems/score/status.h
rb8f76fa r77ff5599 39 39 STATUS_CLASSIC_INVALID_SIZE = 8, 40 40 STATUS_CLASSIC_NO_MEMORY = 26, 41 STATUS_CLASSIC_NOT_DEFINED = 11, 41 42 STATUS_CLASSIC_NOT_OWNER_OF_RESOURCE = 23, 42 43 STATUS_CLASSIC_OBJECT_WAS_DELETED = 7, … … 105 106 STATUS_NO_MEMORY = 106 107 STATUS_BUILD( STATUS_CLASSIC_NO_MEMORY, EINVAL ), 108 STATUS_NOT_DEFINED = 109 STATUS_BUILD( STATUS_CLASSIC_NOT_DEFINED, EINVAL ), 107 110 STATUS_NOT_OWNER = 108 111 STATUS_BUILD( STATUS_CLASSIC_NOT_OWNER_OF_RESOURCE, EPERM ), -
cpukit/score/src/scheduleredfchangepriority.c
rb8f76fa r77ff5599 20 20 21 21 #include <rtems/score/scheduleredfimpl.h> 22 23 Priority_Control _Scheduler_EDF_Map_priority( 24 const Scheduler_Control *scheduler, 25 Priority_Control priority 26 ) 27 { 28 return SCHEDULER_EDF_PRIO_MSB | priority; 29 } 30 31 Priority_Control _Scheduler_EDF_Unmap_priority( 32 const Scheduler_Control *scheduler, 33 Priority_Control priority 34 ) 35 { 36 return priority & ~SCHEDULER_EDF_PRIO_MSB; 37 } 22 38 23 39 Scheduler_Void_or_thread _Scheduler_EDF_Change_priority( -
cpukit/score/src/threadcreateidle.c
rb8f76fa r77ff5599 20 20 21 21 #include <rtems/score/threadimpl.h> 22 #include <rtems/score/assert.h> 22 23 #include <rtems/score/schedulerimpl.h> 23 24 #include <rtems/score/stackimpl.h> … … 48 49 */ 49 50 idle = _Thread_Internal_allocate(); 51 _Assert( idle != NULL ); 50 52 51 53 _Thread_Initialize( … … 56 58 _Stack_Ensure_minimum( rtems_configuration_get_idle_task_stack_size() ), 57 59 CPU_IDLE_TASK_IS_FP, 58 scheduler->maximum_priority,60 _Scheduler_Map_priority( scheduler, scheduler->maximum_priority ), 59 61 true, /* preemptable */ 60 62 THREAD_CPU_BUDGET_ALGORITHM_NONE, -
testsuites/psxtests/psxautoinit01/init.c
rb8f76fa r77ff5599 55 55 mutex2 = PTHREAD_MUTEX_INITIALIZER; 56 56 puts( "Init - pthread_mutex_getprioceiling - auto initialize - OK" ); 57 prioceiling = 1; 57 58 sc = pthread_mutex_getprioceiling( &mutex1, &prioceiling ); 58 59 fatal_posix_service_status( sc, 0, "mutex getprioceiling OK" ); 60 rtems_test_assert( prioceiling == 0 ); 59 61 60 62 puts( "Init - pthread_mutex_getprioceiling - auto initialize - EINVAL" ); 63 prioceiling = 1; 61 64 sc = pthread_mutex_getprioceiling( &mutex2, &prioceiling ); 62 65 fatal_posix_service_status( sc, EINVAL, "mutex getprioceiling EINVAL" ); 66 rtems_test_assert( prioceiling == 1 ); 63 67 64 68 puts( "Init - pthread_mutex_destroy - OK" ); -
testsuites/smptests/Makefile.am
rb8f76fa r77ff5599 46 46 SUBDIRS += smppsxaffinity01 47 47 SUBDIRS += smppsxaffinity02 48 SUBDIRS += smppsxmutex01 48 49 SUBDIRS += smppsxsignal01 49 50 endif -
testsuites/smptests/configure.ac
rb8f76fa r77ff5599 58 58 # Explicitly list all Makefiles here 59 59 AC_CONFIG_FILES([Makefile 60 smppsxmutex01/Makefile 60 61 smpstrongapa01/Makefile 61 62 smp01/Makefile -
testsuites/smptests/smpscheduler02/init.c
rb8f76fa r77ff5599 36 36 static rtems_id main_task_id; 37 37 38 static rtems_id sema_id; 39 38 40 static void task(rtems_task_argument arg) 39 41 { … … 45 47 rtems_test_assert(sched_get_priority_min(SCHED_RR) == 1); 46 48 rtems_test_assert(sched_get_priority_max(SCHED_RR) == 126); 49 50 sc = rtems_semaphore_obtain(sema_id, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 51 rtems_test_assert(sc == RTEMS_NOT_DEFINED); 47 52 48 53 sc = rtems_event_transient_send(main_task_id); … … 62 67 rtems_id scheduler_b_id; 63 68 rtems_id scheduler_c_id; 69 rtems_task_priority prio; 64 70 cpu_set_t cpuset; 65 71 cpu_set_t first_cpu; … … 95 101 sc = rtems_scheduler_ident(SCHED_C, &scheduler_c_id); 96 102 rtems_test_assert(sc == RTEMS_UNSATISFIED); 103 104 sc = rtems_semaphore_create( 105 SCHED_A, 106 1, 107 RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY | RTEMS_PRIORITY_CEILING, 108 1, 109 &sema_id 110 ); 111 rtems_test_assert(sc == RTEMS_SUCCESSFUL); 112 113 prio = 2; 114 sc = rtems_semaphore_set_priority(sema_id, scheduler_a_id, prio, &prio); 115 rtems_test_assert(sc == RTEMS_SUCCESSFUL); 116 rtems_test_assert(prio == 1); 117 118 if (cpu_count > 1) { 119 prio = 1; 120 sc = rtems_semaphore_set_priority(sema_id, scheduler_b_id, prio, &prio); 121 rtems_test_assert(sc == RTEMS_NOT_DEFINED); 122 rtems_test_assert(prio == 2); 123 } 97 124 98 125 CPU_ZERO(&cpuset); … … 183 210 sc = rtems_task_delete(task_id); 184 211 rtems_test_assert(sc == RTEMS_SUCCESSFUL); 212 213 sc = rtems_semaphore_delete(sema_id); 214 rtems_test_assert(sc == RTEMS_SUCCESSFUL); 185 215 } 186 216 … … 213 243 #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER 214 244 245 #define CONFIGURE_MAXIMUM_TASKS 2 246 #define CONFIGURE_MAXIMUM_SEMAPHORES 1 247 215 248 #define CONFIGURE_SMP_APPLICATION 216 249 … … 270 303 RTEMS_SCHEDULER_ASSIGN(2, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL) 271 304 272 #define CONFIGURE_MAXIMUM_TASKS 2273 274 305 #define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION 275 306
Note: See TracChangeset
for help on using the changeset viewer.