source: rtems/cpukit/rtems/inline/rtems/rtems/ratemon.inl @ 4d24fccb

4.104.114.95
Last change on this file since 4d24fccb was 4d24fccb, checked in by Ralf Corsepius <ralf.corsepius@…>, on 08/19/08 at 12:09:40

Add header guard to force indirect inclusion.

  • Property mode set to 100644
File size: 3.0 KB
Line 
1/**
2 * @file rtems/rtems/ratemon.inl
3 *
4 *  This file contains the static inline  implementation of the inlined
5 *  routines in the Rate Monotonic Manager.
6 */
7
8/*  COPYRIGHT (c) 1989-2008.
9 *  On-Line Applications Research Corporation (OAR).
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.com/license/LICENSE.
14 *
15 *  $Id$
16 */
17
18#ifndef _RTEMS_RTEMS_RATEMON_H
19# error "Never use <rtems/rtems/ratemon.inl> directly; include <rtems/rtems/ratemon.h> instead."
20#endif
21
22#ifndef _RTEMS_RTEMS_RATEMON_INL
23#define _RTEMS_RTEMS_RATEMON_INL
24
25/**
26 *  @addtogroup ClassicRateMon
27 *  @{
28 */
29
30/**
31 *  @brief Rate_monotonic_Allocate
32 *
33 *  This function allocates a period control block from
34 *  the inactive chain of free period control blocks.
35 */
36RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Allocate( void )
37{
38  return (Rate_monotonic_Control *)
39    _Objects_Allocate( &_Rate_monotonic_Information );
40}
41
42/**
43 *  @brief Rate_monotonic_Free
44 *
45 *  This routine allocates a period control block from
46 *  the inactive chain of free period control blocks.
47 */
48RTEMS_INLINE_ROUTINE void _Rate_monotonic_Free (
49  Rate_monotonic_Control *the_period
50)
51{
52  _Objects_Free( &_Rate_monotonic_Information, &the_period->Object );
53}
54
55/**
56 *  @brief Rate_monotonic_Get
57 *
58 *  This function maps period IDs to period control blocks.
59 *  If ID corresponds to a local period, then it returns
60 *  the_period control pointer which maps to ID and location
61 *  is set to OBJECTS_LOCAL.  Otherwise, location is set
62 *  to OBJECTS_ERROR and the_period is undefined.
63 */
64RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get (
65  Objects_Id         id,
66  Objects_Locations *location
67)
68{
69  return (Rate_monotonic_Control *)
70    _Objects_Get( &_Rate_monotonic_Information, id, location );
71}
72
73/**
74 *  @brief Rate_monotonic_Is_active
75 *
76 *  This function returns TRUE if the_period is in the ACTIVE state,
77 *  and FALSE otherwise.
78 */
79RTEMS_INLINE_ROUTINE boolean _Rate_monotonic_Is_active (
80  Rate_monotonic_Control *the_period
81)
82{
83  return (the_period->state == RATE_MONOTONIC_ACTIVE);
84}
85
86/**
87 *  @brief Rate_monotonic_Is_inactive
88 *
89 *  This function returns TRUE if the_period is in the ACTIVE state,
90 *  and FALSE otherwise.
91 */
92RTEMS_INLINE_ROUTINE boolean _Rate_monotonic_Is_inactive (
93  Rate_monotonic_Control *the_period
94)
95{
96  return (the_period->state == RATE_MONOTONIC_INACTIVE);
97}
98
99/**
100 *  @brief Rate_monotonic_Is_expired
101 *
102 *  This function returns TRUE if the_period is in the EXPIRED state,
103 *  and FALSE otherwise.
104 */
105RTEMS_INLINE_ROUTINE boolean _Rate_monotonic_Is_expired (
106  Rate_monotonic_Control *the_period
107)
108{
109  return (the_period->state == RATE_MONOTONIC_EXPIRED);
110}
111
112/**
113 *  @brief Rate_monotonic_Is_null
114 *
115 *  This function returns TRUE if the_period is NULL and FALSE otherwise.
116 */
117RTEMS_INLINE_ROUTINE boolean _Rate_monotonic_Is_null (
118  Rate_monotonic_Control *the_period
119)
120{
121  return (the_period == NULL);
122}
123
124/**@}*/
125
126#endif
127/* end of include file */
Note: See TracBrowser for help on using the repository browser.