source: rtems/cpukit/score/src/schedulercbssetparameters.c @ 21275b58

5
Last change on this file since 21275b58 was 50a56dff, checked in by Sebastian Huber <sebastian.huber@…>, on 06/24/16 at 09:16:35

score: Move SCHEDULER_EDF_PRIO_MSB

This is an implementation detail of the EDF scheduler.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/**
2 * @file
3 *
4 * @brief Set Parameters for CBS Scheduling
5 *
6 * @ingroup ScoreScheduler
7 */
8
9/*
10 *  Copyright (C) 2011 Petr Benes.
11 *  Copyright (C) 2011 On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.org/license/LICENSE.
16 */
17
18#if HAVE_CONFIG_H
19#include "config.h"
20#endif
21
22#include <rtems/score/schedulercbs.h>
23#include <rtems/score/scheduleredfimpl.h>
24
25int _Scheduler_CBS_Set_parameters (
26  Scheduler_CBS_Server_id   server_id,
27  Scheduler_CBS_Parameters *params
28)
29{
30  if ( server_id >= _Scheduler_CBS_Maximum_servers )
31    return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
32
33  if ( params->budget <= 0 ||
34       params->deadline <= 0 ||
35       params->budget >= SCHEDULER_EDF_PRIO_MSB ||
36       params->deadline >= SCHEDULER_EDF_PRIO_MSB )
37    return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
38
39  if ( !_Scheduler_CBS_Server_list[server_id].initialized )
40    return SCHEDULER_CBS_ERROR_NOSERVER;
41
42  _Scheduler_CBS_Server_list[server_id].parameters = *params;
43  return SCHEDULER_CBS_OK;
44}
Note: See TracBrowser for help on using the repository browser.