1 | /* timer.inl |
---|
2 | * |
---|
3 | * This file contains the static inline implementation of the inlined routines |
---|
4 | * from the POSIX Timer Manager. |
---|
5 | * |
---|
6 | * COPYRIGHT (c) 1989-1999. |
---|
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.OARcorp.com/rtems/license.html. |
---|
12 | * |
---|
13 | * $Id$ |
---|
14 | */ |
---|
15 | |
---|
16 | #ifndef __POSIX_TIMER_inl |
---|
17 | #define __POSIX_TIMER_inl |
---|
18 | |
---|
19 | /*PAGE |
---|
20 | * |
---|
21 | * _POSIX_Timer_Allocate |
---|
22 | * |
---|
23 | * DESCRIPTION: |
---|
24 | * |
---|
25 | * This function allocates a timer control block from |
---|
26 | * the inactive chain of free timer control blocks. |
---|
27 | */ |
---|
28 | |
---|
29 | RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Allocate( void ) |
---|
30 | { |
---|
31 | return (POSIX_Timer_Control *) _Objects_Allocate( &_POSIX_Timer_Information ); |
---|
32 | } |
---|
33 | |
---|
34 | /*PAGE |
---|
35 | * |
---|
36 | * _POSIX_Timer_Free |
---|
37 | * |
---|
38 | * DESCRIPTION: |
---|
39 | * |
---|
40 | * This routine frees a timer control block to the |
---|
41 | * inactive chain of free timer control blocks. |
---|
42 | */ |
---|
43 | |
---|
44 | RTEMS_INLINE_ROUTINE void _POSIX_Timer_Free ( |
---|
45 | POSIX_Timer_Control *the_timer |
---|
46 | ) |
---|
47 | { |
---|
48 | _Objects_Free( &_POSIX_Timer_Information, &the_timer->Object ); |
---|
49 | } |
---|
50 | |
---|
51 | /*PAGE |
---|
52 | * |
---|
53 | * _POSIX_Timer_Get |
---|
54 | * |
---|
55 | * DESCRIPTION: |
---|
56 | * |
---|
57 | * This function maps timer IDs to timer control blocks. |
---|
58 | * If ID corresponds to a local timer, then it returns |
---|
59 | * the timer control pointer which maps to ID and location |
---|
60 | * is set to OBJECTS_LOCAL. Otherwise, location is set |
---|
61 | * to OBJECTS_ERROR and the returned value is undefined. |
---|
62 | */ |
---|
63 | |
---|
64 | RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Get ( |
---|
65 | Objects_Id id, |
---|
66 | Objects_Locations *location |
---|
67 | ) |
---|
68 | { |
---|
69 | return (POSIX_Timer_Control *) |
---|
70 | _Objects_Get( &_POSIX_Timer_Information, id, location ); |
---|
71 | } |
---|
72 | |
---|
73 | /*PAGE |
---|
74 | * |
---|
75 | * _POSIX_Timer_Is_null |
---|
76 | * |
---|
77 | * DESCRIPTION: |
---|
78 | * |
---|
79 | * This function returns TRUE if the_timer is NULL and FALSE otherwise. |
---|
80 | */ |
---|
81 | |
---|
82 | RTEMS_INLINE_ROUTINE boolean _POSIX_Timer_Is_null ( |
---|
83 | Timer_Control *the_timer |
---|
84 | ) |
---|
85 | { |
---|
86 | return (the_timer == NULL); |
---|
87 | } |
---|
88 | |
---|
89 | #endif |
---|
90 | /* end of include file */ |
---|