summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/schedulersmp.c
blob: 3bb2638139a3ed47d3e26ac1332ac5477f9d2dd0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
 * @file
 *
 * @ingroup RTEMSScoreScheduler
 *
 * @brief This source file contains the implementation of
 *   _Scheduler_Request_ask_for_help().
 */

/*
 * Copyright (c) 2014, 2017 embedded brains GmbH.
 *
 * The license and distribution terms for this file may be
 * found in the file LICENSE in this distribution or at
 * http://www.rtems.org/license/LICENSE.
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <rtems/score/schedulersmpimpl.h>

void _Scheduler_SMP_Remove_ask_for_help_from_processor(
  Thread_Control  *thread,
  Per_CPU_Control *cpu
)
{
  ISR_lock_Context lock_context;

  _Assert( _ISR_lock_Is_owner( &thread->Scheduler.Lock ) );

  _Per_CPU_Acquire( cpu, &lock_context );

  if ( thread->Scheduler.ask_for_help_cpu == cpu ) {
    _Chain_Extract_unprotected( &thread->Scheduler.Help_node );
    thread->Scheduler.ask_for_help_cpu = NULL;
  }

  _Per_CPU_Release( cpu, &lock_context );
}