source: rtems/cpukit/posix/inline/rtems/posix/priority.inl @ f8437c8

4.104.114.9
Last change on this file since f8437c8 was f8437c8, checked in by Ralf Corsepius <ralf.corsepius@…>, on Sep 4, 2008 at 3:23:12 PM

Convert to "bool".

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/**
2 * @file rtems/posix/priority.inl
3 */
4
5/* 
6 *  COPYRIGHT (c) 1989-2007.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.rtems.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15
16#ifndef _RTEMS_POSIX_PRIORITY_H
17# error "Never use <rtems/posix/priority.inl> directly; include <rtems/posix/priority.h> instead."
18#endif
19
20#ifndef _RTEMS_POSIX_PRIORITY_INL
21#define _RTEMS_POSIX_PRIORITY_INL
22
23/*
24 *  1003.1b-1993,2.2.2.80 definition of priority, p. 19
25 *
26 *  "Numerically higher values represent higher priorities."
27 *
28 *  Thus, RTEMS Core has priorities run in the opposite sense of the POSIX API.
29 */
30
31RTEMS_INLINE_ROUTINE bool _POSIX_Priority_Is_valid(
32  int priority
33)
34{
35  return (priority >= 1 && priority <= 254);
36}
37
38RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
39  int priority
40)
41{
42  return (Priority_Control) (255 - priority);
43}
44
45RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core(
46  Priority_Control priority
47)
48{
49  return 255 - priority;
50}
51
52#endif
Note: See TracBrowser for help on using the repository browser.