]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/blob - qnx/src/ipc3x_dev/ti/syslink/utils/GateSpinlock.h
QNX: NameServer_delete in NameServer daemon leaks memory
[ipc/ipcdev.git] / qnx / src / ipc3x_dev / ti / syslink / utils / GateSpinlock.h
1 /**
2  *  @file   GateSpinlock.h
3  *
4  *  @brief      Gate based on Spinlock.
5  *
6  *
7  */
8 /*
9  *  ============================================================================
10  *
11  *  Copyright (c) 2008-2012, Texas Instruments Incorporated
12  *
13  *  Redistribution and use in source and binary forms, with or without
14  *  modification, are permitted provided that the following conditions
15  *  are met:
16  *
17  *  *  Redistributions of source code must retain the above copyright
18  *     notice, this list of conditions and the following disclaimer.
19  *
20  *  *  Redistributions in binary form must reproduce the above copyright
21  *     notice, this list of conditions and the following disclaimer in the
22  *     documentation and/or other materials provided with the distribution.
23  *
24  *  *  Neither the name of Texas Instruments Incorporated nor the names of
25  *     its contributors may be used to endorse or promote products derived
26  *     from this software without specific prior written permission.
27  *
28  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29  *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
30  *  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
31  *  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
32  *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
33  *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
34  *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
35  *  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
36  *  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
37  *  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
38  *  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39  *  Contact information for paper mail:
40  *  Texas Instruments
41  *  Post Office Box 655303
42  *  Dallas, Texas 75265
43  *  Contact information:
44  *  http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
45  *  DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
46  *  ============================================================================
47  *
48  */
52 #ifndef GATESPINLOCK_H_0x188E
53 #define GATESPINLOCK_H_0x188E
56 #if defined (__cplusplus)
57 extern "C" {
58 #endif
61 /* =============================================================================
62  *  Status codes
63  * =============================================================================
64  */
65 /*!
66  *  @def    GateSpinlock_E_INVALIDARG
67  *  @brief  Argument passed to a function is invalid.
68  */
69 #define GateSpinlock_E_INVALIDARG       -1
71 /*!
72  *  @def    GateSpinlock_E_MEMORY
73  *  @brief  Memory allocation failed.
74  */
75 #define GateSpinlock_E_MEMORY           -2
77 /*!
78  *  @def    GateSpinlock_E_BUSY
79  *  @brief  The name is already registered or not.
80  */
81 #define GateSpinlock_E_BUSY             -3
83 /*!
84  *  @def    GateSpinlock_E_FAIL
85  *  @brief  Generic failure.
86  */
87 #define GateSpinlock_E_FAIL             -4
89 /*!
90  *  @def    GateSpinlock_E_NOTFOUND
91  *  @brief  Name not found in the nameserver.
92  */
93 #define GateSpinlock_E_NOTFOUND         -5
95 /*!
96  *  @def    GateSpinlock_E_INVALIDSTATE
97  *  @brief  Module is not initialized.
98  */
99 #define GateSpinlock_E_INVALIDSTATE     -6
101 /*!
102  *  @def    GateSpinlock_E_INUSE
103  *  @brief  Indicates that the instance is in use.
104  */
105 #define GateSpinlock_E_INUSE            -7
107 /*!
108  *  @def    GateSpinlock_E_HANDLE
109  *  @brief  An invalid handle was provided.
110  */
111 #define GateSpinlock_E_HANDLE           -8
113 /*!
114  *  @def    GateSpinlock_S_SUCCESS
115  *  @brief  Operation successful.
116  */
117 #define GateSpinlock_S_SUCCESS          0
120 /* =============================================================================
121  *  Macros and types
122  * =============================================================================
123  */
124 /*! @brief  Object for Gate Mutex */
125 typedef struct GateSpinlock_Object   GateSpinlock_Object;
127 /*! @brief  Handle for Gate Mutex */
128 typedef struct GateSpinlock_Object * GateSpinlock_Handle;
130 /*! No parameters for GateMutex creation */
131 typedef Void GateSpinlock_Params;
134 /* =============================================================================
135  *  APIs
136  * =============================================================================
137  */
138 /* Function to create a Gate Mutex */
139 GateSpinlock_Handle
140 GateSpinlock_create (const GateSpinlock_Params * params, Error_Block *eb);
142 /* Function to delete a Gate Mutex */
143 Int GateSpinlock_delete (GateSpinlock_Handle * handle);
146 #if defined (__cplusplus)
148 #endif /* defined (__cplusplus) */
151 #endif /* GATESPINLOCK_H_0x188E */