source: rtems/cpukit/rtems/src/schedulergetprocessorset.c @ 1b67535d

4.115
Last change on this file since 1b67535d was 1b67535d, checked in by Sebastian Huber <sebastian.huber@…>, on 04/09/14 at 08:09:57

rtems: Add scheduler get processors

  • Property mode set to 100644
File size: 1.2 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#if defined(__RTEMS_HAVE_SYS_CPUSET_H__)
20
21#include <rtems/rtems/tasks.h>
22#include <rtems/score/cpusetimpl.h>
23#include <rtems/score/schedulerimpl.h>
24
25rtems_status_code rtems_scheduler_get_processor_set(
26  rtems_id   scheduler_id,
27  size_t     cpusetsize,
28  cpu_set_t *cpuset
29)
30{
31  rtems_status_code sc;
32
33  if ( cpuset != NULL ) {
34    const Scheduler_Control *scheduler;
35
36    if ( _Scheduler_Get_by_id( scheduler_id, &scheduler ) ) {
37      if ( _CPU_set_Is_large_enough( cpusetsize ) ) {
38        _Scheduler_Get_processor_set( scheduler, cpusetsize, cpuset );
39
40        sc = RTEMS_SUCCESSFUL;
41      } else {
42        sc = RTEMS_INVALID_NUMBER;
43      }
44    } else {
45      sc = RTEMS_INVALID_ID;
46    }
47  } else {
48    sc = RTEMS_INVALID_ADDRESS;
49  }
50
51  return sc;
52}
53
54#endif /* defined(__RTEMS_HAVE_SYS_CPUSET_H__) */
Note: See TracBrowser for help on using the repository browser.