SysLink API Reference  2.21.03.11
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
IGateProvider.h
Go to the documentation of this file.
1 
37 /*
38  * ============================================================================
39  *
40  * Copyright (c) 2008-2012, Texas Instruments Incorporated
41  *
42  * Redistribution and use in source and binary forms, with or without
43  * modification, are permitted provided that the following conditions
44  * are met:
45  *
46  * * Redistributions of source code must retain the above copyright
47  * notice, this list of conditions and the following disclaimer.
48  *
49  * * Redistributions in binary form must reproduce the above copyright
50  * notice, this list of conditions and the following disclaimer in the
51  * documentation and/or other materials provided with the distribution.
52  *
53  * * Neither the name of Texas Instruments Incorporated nor the names of
54  * its contributors may be used to endorse or promote products derived
55  * from this software without specific prior written permission.
56  *
57  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
58  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
59  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
60  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
61  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
62  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
63  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
64  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
65  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
66  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
67  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
68  * Contact information for paper mail:
69  * Texas Instruments
70  * Post Office Box 655303
71  * Dallas, Texas 75265
72  * Contact information:
73  * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
74  * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
75  * ============================================================================
76  *
77  */
78 
79 
80 
81 #ifndef __IGATEPROVIDER_H__
82 #define __IGATEPROVIDER_H__
83 
84 #include <ti/syslink/utils/Trace.h>
85 
86 #if defined (__cplusplus)
87 extern "C" {
88 #endif
89 
90 
91 /* -----------------------------------------------------------------------------
92  * Macros
93  * -----------------------------------------------------------------------------
94  */
96 #define IGateProvider_NULL (IGateProvider_Handle)0xFFFFFFFF
97 
105 #define IGateProvider_Q_BLOCKING 1
106 
114 #define IGateProvider_Q_PREEMPTING 2
115 
120 #define IGateProvider_SuperObject \
121  IGateProvider_ENTER enter; \
122  IGateProvider_LEAVE leave
123 
124 
128 #define IGateProvider_ObjectInitializer(x,y) \
129  ((IGateProvider_Handle)(x))->enter = (IGateProvider_ENTER)y##_enter; \
130  ((IGateProvider_Handle)(x))->leave = (IGateProvider_LEAVE)y##_leave;
131 
132 /* -----------------------------------------------------------------------------
133  * Defines
134  * -----------------------------------------------------------------------------
135  */
138 
141 
142 
143 /* -----------------------------------------------------------------------------
144  * Structs & Enums
145  * -----------------------------------------------------------------------------
146  */
150 typedef struct IGateProvider_Object {
153 
154 
155 /* -----------------------------------------------------------------------------
156  * APIs
157  * -----------------------------------------------------------------------------
158  */
179 static inline IArg IGateProvider_enter (IGateProvider_Handle handle)
180 {
181  IArg key = 0;
182 
183  GT_assert (curTrace, ((IGateProvider_Object *) handle != NULL));
184  if (handle != 0x0 && handle != IGateProvider_NULL) { //fix
185  key = (handle->enter) ((void *)handle);
186  }
187  return key;
188 }
189 
190 
207 static inline Void IGateProvider_leave (IGateProvider_Handle handle, IArg key)
208 {
209  GT_assert (curTrace, ((IGateProvider_Object *) handle != NULL));
210  if (handle != 0x0 && handle != IGateProvider_NULL) //fix
211  (handle->leave) ((void *)handle, key);
212 }
213 
214 
215 #if defined (__cplusplus)
216 }
217 #endif /* defined (__cplusplus) */
218 
219 
220 #endif /* ifndef __IGATEPROVIDER_H__ */
221 
Copyright 2014, Texas Instruments Incorporated