1 | /* |
---|
2 | * COPYRIGHT (c) 1989-1999. |
---|
3 | * On-Line Applications Research Corporation (OAR). |
---|
4 | * |
---|
5 | * The license and distribution terms for this file may be |
---|
6 | * found in the file LICENSE in this distribution or at |
---|
7 | * http://www.OARcorp.com/rtems/license.html. |
---|
8 | * |
---|
9 | * $Id$ |
---|
10 | */ |
---|
11 | |
---|
12 | #ifndef __ITRON_EVENTFLAGS_inl_ |
---|
13 | #define __ITRON_EVENTFLAGS_inl_ |
---|
14 | |
---|
15 | #ifdef __cplusplus |
---|
16 | extern "C" { |
---|
17 | #endif |
---|
18 | |
---|
19 | /* |
---|
20 | * _ITRON_Eventflags_Allocate |
---|
21 | * |
---|
22 | * DESCRIPTION: |
---|
23 | * |
---|
24 | * This routine allocates the eventflags associated with the specified |
---|
25 | * eventflags ID from the pool of inactive eventflagss. |
---|
26 | * |
---|
27 | * Input parameters: |
---|
28 | * flgid - id of eventflags to allocate |
---|
29 | * status - pointer to status variable |
---|
30 | * |
---|
31 | * Output parameters: |
---|
32 | * returns - pointer to the eventflags control block |
---|
33 | * *status - status |
---|
34 | */ |
---|
35 | |
---|
36 | RTEMS_INLINE_ROUTINE ITRON_Eventflags_Control *_ITRON_Eventflags_Allocate( |
---|
37 | ID flgid |
---|
38 | ) |
---|
39 | { |
---|
40 | return (ITRON_Eventflags_Control *)_ITRON_Objects_Allocate_by_index( |
---|
41 | &_ITRON_Eventflags_Information, |
---|
42 | flgid, |
---|
43 | sizeof(ITRON_Eventflags_Control) |
---|
44 | ); |
---|
45 | } |
---|
46 | |
---|
47 | /* |
---|
48 | * _ITRON_Eventflags_Clarify_allocation_id_error |
---|
49 | * |
---|
50 | * This function is invoked when an object allocation ID error |
---|
51 | * occurs to determine the specific ITRON error code to return. |
---|
52 | */ |
---|
53 | |
---|
54 | #define _ITRON_Eventflags_Clarify_allocation_id_error( _id ) \ |
---|
55 | _ITRON_Objects_Clarify_allocation_id_error( \ |
---|
56 | &_ITRON_Eventflags_Information, (_id) ) |
---|
57 | |
---|
58 | /* |
---|
59 | * _ITRON_Eventflags_Clarify_get_id_error |
---|
60 | * |
---|
61 | * This function is invoked when an object get ID error |
---|
62 | * occurs to determine the specific ITRON error code to return. |
---|
63 | */ |
---|
64 | |
---|
65 | #define _ITRON_Eventflags_Clarify_get_id_error( _id ) \ |
---|
66 | _ITRON_Objects_Clarify_get_id_error( &_ITRON_Eventflags_Information, (_id) ) |
---|
67 | |
---|
68 | /* |
---|
69 | * _ITRON_Eventflags_Free |
---|
70 | * |
---|
71 | * DESCRIPTION: |
---|
72 | * |
---|
73 | * This routine frees a eventflags control block to the |
---|
74 | * inactive chain of free eventflags control blocks. |
---|
75 | * |
---|
76 | * Input parameters: |
---|
77 | * the_eventflags - pointer to eventflags control block |
---|
78 | * |
---|
79 | * Output parameters: NONE |
---|
80 | */ |
---|
81 | |
---|
82 | RTEMS_INLINE_ROUTINE void _ITRON_Eventflags_Free ( |
---|
83 | ITRON_Eventflags_Control *the_eventflags |
---|
84 | ) |
---|
85 | { |
---|
86 | _ITRON_Objects_Free( &_ITRON_Eventflags_Information, &the_eventflags->Object ); |
---|
87 | } |
---|
88 | |
---|
89 | /*PAGE |
---|
90 | * |
---|
91 | * _ITRON_Eventflags_Get |
---|
92 | * |
---|
93 | * DESCRIPTION: |
---|
94 | * |
---|
95 | * This function maps eventflags IDs to eventflags control blocks. |
---|
96 | * If ID corresponds to a local eventflags, then it returns |
---|
97 | * the_eventflags control pointer which maps to ID and location |
---|
98 | * is set to OBJECTS_LOCAL. if the eventflags ID is global and |
---|
99 | * resides on a remote node, then location is set to OBJECTS_REMOTE, |
---|
100 | * and the_eventflags is undefined. Otherwise, location is set |
---|
101 | * to OBJECTS_ERROR and the_eventflags is undefined. |
---|
102 | * |
---|
103 | * Input parameters: |
---|
104 | * id - ITRON eventflags ID. |
---|
105 | * the_location - pointer to a location variable |
---|
106 | * |
---|
107 | * Output parameters: |
---|
108 | * *the_location - location of the object |
---|
109 | */ |
---|
110 | |
---|
111 | RTEMS_INLINE_ROUTINE ITRON_Eventflags_Control *_ITRON_Eventflags_Get ( |
---|
112 | ID id, |
---|
113 | Objects_Locations *location |
---|
114 | ) |
---|
115 | { |
---|
116 | return (ITRON_Eventflags_Control *) |
---|
117 | _ITRON_Objects_Get( &_ITRON_Eventflags_Information, id, location ); |
---|
118 | } |
---|
119 | |
---|
120 | /*PAGE |
---|
121 | * |
---|
122 | * _ITRON_Eventflags_Is_null |
---|
123 | * |
---|
124 | * This function returns TRUE if the_eventflags is NULL and FALSE otherwise. |
---|
125 | * |
---|
126 | * Input parameters: |
---|
127 | * the_eventflags - pointer to eventflags control block |
---|
128 | * |
---|
129 | * Output parameters: |
---|
130 | * TRUE - if the_eventflags is NULL |
---|
131 | * FALSE - otherwise |
---|
132 | */ |
---|
133 | |
---|
134 | RTEMS_INLINE_ROUTINE boolean _ITRON_Eventflags_Is_null ( |
---|
135 | ITRON_Eventflags_Control *the_eventflags |
---|
136 | ) |
---|
137 | { |
---|
138 | return ( the_eventflags == NULL ); |
---|
139 | } |
---|
140 | |
---|
141 | /* |
---|
142 | * XXX insert inline routines here |
---|
143 | */ |
---|
144 | |
---|
145 | #ifdef __cplusplus |
---|
146 | } |
---|
147 | #endif |
---|
148 | |
---|
149 | #endif |
---|
150 | /* end of include file */ |
---|
151 | |
---|