Ignore:
Timestamp:
Oct 21, 2016, 12:41:19 PM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
6771359f
Parents:
9c238e1
git-author:
Sebastian Huber <sebastian.huber@…> (10/21/16 12:41:19)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/02/16 09:05:44)
Message:

score: Delete unused scheduler ask for help X op

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/include/rtems/score/schedulerimpl.h

    r9c238e1 r0e754fac  
    12981298  return unblock;
    12991299}
    1300 
    1301 /**
    1302  * @brief Asks a ready scheduler node for help.
    1303  *
    1304  * @param[in] node The ready node offering help.
    1305  * @param[in] needs_help The thread needing help.
    1306  *
    1307  * @retval needs_help The thread needing help.
    1308  */
    1309 RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Ask_ready_node_for_help(
    1310   Scheduler_Node *node,
    1311   Thread_Control *needs_help
    1312 )
    1313 {
    1314   _Scheduler_Node_set_user( node, needs_help );
    1315 
    1316   return needs_help;
    1317 }
    1318 
    1319 /**
    1320  * @brief Asks a scheduled scheduler node for help.
    1321  *
    1322  * @param[in] context The scheduler instance context.
    1323  * @param[in] node The scheduled node offering help.
    1324  * @param[in] offers_help The thread offering help.
    1325  * @param[in] needs_help The thread needing help.
    1326  * @param[in] previous_accepts_help The previous thread accepting help by this
    1327  *   scheduler node.
    1328  * @param[in] release_idle_thread Function to release an idle thread.
    1329  *
    1330  * @retval needs_help The previous thread accepting help by this scheduler node
    1331  *   which was displaced by the thread needing help.
    1332  * @retval NULL There are no more threads needing help.
    1333  */
    1334 RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Ask_scheduled_node_for_help(
    1335   Scheduler_Context             *context,
    1336   Scheduler_Node                *node,
    1337   Thread_Control                *offers_help,
    1338   Thread_Control                *needs_help,
    1339   Thread_Control                *previous_accepts_help,
    1340   Scheduler_Release_idle_thread  release_idle_thread
    1341 )
    1342 {
    1343   Thread_Control *next_needs_help = NULL;
    1344   Thread_Control *old_user = NULL;
    1345   Thread_Control *new_user = NULL;
    1346 
    1347   if (
    1348     previous_accepts_help != needs_help
    1349       && _Scheduler_Thread_get_node( previous_accepts_help ) == node
    1350   ) {
    1351     Thread_Control *idle = _Scheduler_Release_idle_thread(
    1352       context,
    1353       node,
    1354       release_idle_thread
    1355     );
    1356 
    1357     if ( idle != NULL ) {
    1358       old_user = idle;
    1359     } else {
    1360       _Assert( _Scheduler_Node_get_user( node ) == previous_accepts_help );
    1361       old_user = previous_accepts_help;
    1362     }
    1363 
    1364     if ( needs_help->Scheduler.state == THREAD_SCHEDULER_READY ) {
    1365       new_user = needs_help;
    1366     } else {
    1367       _Assert(
    1368         node->help_state == SCHEDULER_HELP_ACTIVE_OWNER
    1369           || node->help_state == SCHEDULER_HELP_ACTIVE_RIVAL
    1370       );
    1371       _Assert( offers_help->Scheduler.node == offers_help->Scheduler.own_node );
    1372 
    1373       new_user = offers_help;
    1374     }
    1375 
    1376     if ( previous_accepts_help != offers_help ) {
    1377       next_needs_help = previous_accepts_help;
    1378     }
    1379   } else if ( needs_help->Scheduler.state == THREAD_SCHEDULER_READY ) {
    1380     Thread_Control *idle = _Scheduler_Release_idle_thread(
    1381       context,
    1382       node,
    1383       release_idle_thread
    1384     );
    1385 
    1386     if ( idle != NULL ) {
    1387       old_user = idle;
    1388     } else {
    1389       old_user = _Scheduler_Node_get_user( node );
    1390     }
    1391 
    1392     new_user = needs_help;
    1393   } else {
    1394     _Assert( needs_help->Scheduler.state == THREAD_SCHEDULER_SCHEDULED );
    1395   }
    1396 
    1397   if ( new_user != old_user ) {
    1398     Per_CPU_Control *cpu_self = _Per_CPU_Get();
    1399     Per_CPU_Control *cpu = _Thread_Get_CPU( old_user );
    1400 
    1401     _Scheduler_Thread_change_state( old_user, THREAD_SCHEDULER_READY );
    1402     _Scheduler_Thread_set_scheduler_and_node(
    1403       old_user,
    1404       _Thread_Scheduler_get_own_node( old_user ),
    1405       old_user
    1406     );
    1407 
    1408     _Scheduler_Thread_change_state( new_user, THREAD_SCHEDULER_SCHEDULED );
    1409     _Scheduler_Thread_set_scheduler_and_node( new_user, node, offers_help );
    1410 
    1411     _Scheduler_Node_set_user( node, new_user );
    1412     _Thread_Set_CPU( new_user, cpu );
    1413     _Thread_Dispatch_update_heir( cpu_self, cpu, new_user );
    1414   }
    1415 
    1416   return next_needs_help;
    1417 }
    1418 
    1419 /**
    1420  * @brief Asks a blocked scheduler node for help.
    1421  *
    1422  * @param[in] context The scheduler instance context.
    1423  * @param[in] node The scheduled node offering help.
    1424  * @param[in] offers_help The thread offering help.
    1425  * @param[in] needs_help The thread needing help.
    1426  *
    1427  * @retval true Enqueue this scheduler node.
    1428  * @retval false Otherwise.
    1429  */
    1430 RTEMS_INLINE_ROUTINE bool _Scheduler_Ask_blocked_node_for_help(
    1431   Scheduler_Context *context,
    1432   Scheduler_Node    *node,
    1433   Thread_Control    *offers_help,
    1434   Thread_Control    *needs_help
    1435 )
    1436 {
    1437   bool enqueue;
    1438 
    1439   _Assert( node->help_state == SCHEDULER_HELP_PASSIVE );
    1440 
    1441   if ( needs_help->Scheduler.state == THREAD_SCHEDULER_READY ) {
    1442     _Scheduler_Node_set_user( node, needs_help );
    1443     _Scheduler_Thread_set_scheduler_and_node( needs_help, node, offers_help );
    1444 
    1445     enqueue = true;
    1446   } else {
    1447     enqueue = false;
    1448   }
    1449 
    1450   return enqueue;
    1451 }
    14521300#endif
    14531301
Note: See TracChangeset for help on using the changeset viewer.