source: rtems/cpukit/score/src/schedulersetaffinity.c @ 25f5730f

4.11
Last change on this file since 25f5730f was 25f5730f, checked in by Sebastian Huber <sebastian.huber@…>, on May 28, 2014 at 4:11:51 PM

score: _Scheduler_Set_affinity()

Do not change the scheduler with this function. Documentation. Coding
style.

  • Property mode set to 100644
File size: 1.0 KB
Line 
1/*
2 * Copyright (c) 2014 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
15#if HAVE_CONFIG_H
16  #include "config.h"
17#endif
18
19#include <rtems/score/schedulerimpl.h>
20
21#if defined(__RTEMS_HAVE_SYS_CPUSET_H__)
22
23bool _Scheduler_Set_affinity(
24  Thread_Control          *the_thread,
25  size_t                   cpusetsize,
26  const cpu_set_t         *cpuset
27)
28{
29  const Scheduler_Control *scheduler = _Scheduler_Get( the_thread );
30
31  if ( !_CPU_set_Is_large_enough( cpusetsize ) ) {
32    return false;
33  }
34
35#if defined(RTEMS_SMP)
36  return ( *scheduler->Operations.set_affinity )(
37    scheduler,
38    the_thread,
39    cpusetsize,
40    cpuset
41  );
42#else
43  return _Scheduler_default_Set_affinity_body(
44    scheduler,
45    the_thread,
46    cpusetsize,
47    cpuset
48  );
49#endif
50}
51
52#endif /* defined(__RTEMS_HAVE_SYS_CPUSET_H__) */
Note: See TracBrowser for help on using the repository browser.