source: rtems/cpukit/rtems/src/schedulergetprocessorset.c @ 66cb142

5
Last change on this file since 66cb142 was b2dbb634, checked in by Sebastian Huber <sebastian.huber@…>, on 10/10/17 at 09:36:23

score: Remove CPU_set_Control

Use Processor_mask instead.

Update #2514.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 * Copyright (c) 2014, 2017 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/rtems/tasks.h>
20#include <rtems/score/schedulerimpl.h>
21
22rtems_status_code rtems_scheduler_get_processor_set(
23  rtems_id   scheduler_id,
24  size_t     cpusetsize,
25  cpu_set_t *cpuset
26)
27{
28  const Scheduler_Control    *scheduler;
29  const Processor_mask       *processor_set;
30  Processor_mask_Copy_status  status;
31
32  if ( cpuset == NULL ) {
33    return RTEMS_INVALID_ADDRESS;
34  }
35
36  scheduler = _Scheduler_Get_by_id( scheduler_id );
37  if ( scheduler == NULL ) {
38    return RTEMS_INVALID_ID;
39  }
40
41  processor_set = _Scheduler_Get_processors( scheduler );
42  status = _Processor_mask_To_cpu_set_t( processor_set, cpusetsize, cpuset );
43  if ( status != PROCESSOR_MASK_COPY_LOSSLESS ) {
44    return RTEMS_INVALID_NUMBER;
45  }
46
47  return RTEMS_SUCCESSFUL;
48}
Note: See TracBrowser for help on using the repository browser.