source: rtems/cpukit/posix/src/psxpriorityisvalid.c @ 127c20eb

5
Last change on this file since 127c20eb was 254dc82, checked in by Sebastian Huber <sebastian.huber@…>, on 06/24/16 at 09:22:03

score: Change Priority_Control to 64-bit

A 32-bit Priority_Control limits the uptime to 49 days with a 1ms clock
tick in case the EDF scheduler is used. Increase it to 64-bit to enable
proper operation of the EDF scheduler,

Close 2173.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/**
2 *  @file
3 *
4 *  @brief POSIX Is Priority Valid
5 *  @ingroup POSIX_PRIORITY
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2008.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.org/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/posix/priorityimpl.h>
22#include <rtems/score/schedulerimpl.h>
23
24Priority_Control _POSIX_Priority_To_core(
25  const Scheduler_Control *scheduler,
26  int                      posix_priority,
27  bool                    *valid
28)
29{
30  Priority_Control core_posix_priority;
31  Priority_Control core_priority;
32
33  core_posix_priority = (Priority_Control) posix_priority;
34  core_priority = scheduler->maximum_priority - core_posix_priority;
35
36  *valid = ( posix_priority >= POSIX_SCHEDULER_MINIMUM_PRIORITY
37    && core_posix_priority < scheduler->maximum_priority );
38
39  return _Scheduler_Map_priority( scheduler, core_priority );
40}
41
42int _POSIX_Priority_From_core(
43  const Scheduler_Control *scheduler,
44  Priority_Control         core_priority
45)
46{
47  core_priority = _Scheduler_Unmap_priority( scheduler, core_priority );
48
49  return (int) ( scheduler->maximum_priority - core_priority );
50}
Note: See TracBrowser for help on using the repository browser.