source: rtems/cpukit/rtems/src/schedulergetprocessorset.c @ e266d13

5
Last change on this file since e266d13 was d7a1863b, checked in by Sebastian Huber <sebastian.huber@…>, on 05/28/14 at 15:23:27

rtems: Coding style

  • Property mode set to 100644
File size: 1.1 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  const Scheduler_Control *scheduler;
32
33  if ( cpuset == NULL ) {
34    return RTEMS_INVALID_ADDRESS;
35  }
36
37  if ( !_Scheduler_Get_by_id( scheduler_id, &scheduler ) ) {
38    return RTEMS_INVALID_ID;
39  }
40
41  if ( !_CPU_set_Is_large_enough( cpusetsize ) ) {
42    return RTEMS_INVALID_NUMBER;
43  }
44
45  _Scheduler_Get_processor_set( scheduler, cpusetsize, cpuset );
46
47  return RTEMS_SUCCESSFUL;
48}
49
50#endif /* defined(__RTEMS_HAVE_SYS_CPUSET_H__) */
Note: See TracBrowser for help on using the repository browser.