SYS/BIOS  7.00
GateMutexPri.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
132 #ifndef ti_sysbios_gates_GateMutexPri__include
133 #define ti_sysbios_gates_GateMutexPri__include
134 
135 #include <stdbool.h>
136 #include <stddef.h>
137 #include <stdint.h>
138 
140 #include <ti/sysbios/knl/Task.h>
141 
143 
145 /* BIOS 6.x compatibility, use -Dxdc_std__include to disable */
146 #include <xdc/std.h>
147 
148 #define ti_sysbios_gates_GateMutexPri_long_names
149 #include "GateMutexPri_defs.h"
152 #ifdef __cplusplus
153 extern "C" {
154 #endif
155 
160 
162  uint32_t dummy; /* to make IAR happy */
163 };
164 
167  volatile unsigned int mutexCnt;
168  volatile int ownerOrigPri;
169  volatile Task_Handle owner;
171 };
172 
174 typedef struct {
175  Queue_Struct objQ;
176 } GateMutexPri_Module_State;
186 extern bool GateMutexPri_canBePreempted(void);
187 
196 extern bool GateMutexPri_canBlock(void);
197 
206 extern GateMutexPri_Handle GateMutexPri_create(const GateMutexPri_Params *prms, Error_Block *eb);
207 
219 extern GateMutexPri_Handle GateMutexPri_construct(GateMutexPri_Struct *obj, const GateMutexPri_Params *prms);
220 
229 extern void GateMutexPri_delete(GateMutexPri_Handle *gate);
230 
237 
250 
262 extern intptr_t GateMutexPri_enter(GateMutexPri_Handle gate);
263 
274 extern void GateMutexPri_leave(GateMutexPri_Handle gate, intptr_t key);
275 
284 extern GateMutexPri_Handle GateMutexPri_Object_first(void);
285 
296 extern GateMutexPri_Handle GateMutexPri_Object_next(GateMutexPri_Handle gate);
297 
299 extern bool GateMutexPri_query(int qual);
300 static inline GateMutexPri_Handle GateMutexPri_handle(GateMutexPri_Struct *str)
301 {
302  return ((GateMutexPri_Handle)str);
303 }
304 
305 static inline GateMutexPri_Struct * GateMutexPri_struct(GateMutexPri_Handle h)
306 {
307  return ((GateMutexPri_Struct *)h);
308 }
309 
310 #define GateMutexPri_module ((GateMutexPri_Module_State *) &(GateMutexPri_Module_state))
311 
313 #ifdef __cplusplus
314 }
315 #endif
316 
317 #endif /* ti_sysbios_gates_GateMutexPri__include */
318 
320 #undef ti_sysbios_gates_GateMutexPri_long_names
321 #include "GateMutexPri_defs.h"
void GateMutexPri_destruct(GateMutexPri_Struct *obj)
Destruct a GateMutexPri gate.
Definition: GateMutexPri.h:165
Queue_Elem objElem
Definition: GateMutexPri.h:166
intptr_t GateMutexPri_enter(GateMutexPri_Handle gate)
enter the GateMutexPri gate
void GateMutexPri_delete(GateMutexPri_Handle *gate)
Delete a GateMutexPri gate.
Opaque queue element.
Definition: Queue.h:204
Definition: GateMutexPri.h:161
bool GateMutexPri_canBlock(void)
query Gate &#39;blocking&#39; characteristics
Runtime error manager.
bool GateMutexPri_canBePreempted(void)
query Gate &#39;preempt&#39; characteristics
volatile int ownerOrigPri
Definition: GateMutexPri.h:168
GateMutexPri_Handle GateMutexPri_construct(GateMutexPri_Struct *obj, const GateMutexPri_Params *prms)
Construct a GateMutexPri gate.
Error block.
Definition: Error.h:152
volatile unsigned int mutexCnt
Definition: GateMutexPri.h:167
GateMutexPri_Handle GateMutexPri_Object_next(GateMutexPri_Handle gate)
return handle of the next GateMutexPri on GateMutexPri list
Queue_Object pendQ
Definition: GateMutexPri.h:170
GateMutexPri_Object * GateMutexPri_Handle
Definition: GateMutexPri.h:159
void GateMutexPri_Params_init(GateMutexPri_Params *prms)
Initialize the GateMutexPri_Params structure with default values.
GateMutexPri_Handle GateMutexPri_Object_first(void)
return handle of the first GateMutexPri on GateMutexPri list
volatile Task_Handle owner
Definition: GateMutexPri.h:169
GateMutexPri_Handle GateMutexPri_create(const GateMutexPri_Params *prms, Error_Block *eb)
Create a GateMutexPri gate.
uint32_t dummy
Definition: GateMutexPri.h:162
Task Manager.
void GateMutexPri_leave(GateMutexPri_Handle gate, intptr_t key)
leave the GateMutexPri gate
struct Task_Struct * Task_Handle
Definition: Task.h:526
Semaphore Manager.
© Copyright 1995-2022, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale