03669f40afc0517955728edabc6c473524a30a96
1 /**
2 * @file VAYUDspProc.h
3 *
4 * @brief Processor interface for VAYUSLAVE.
5 *
6 *
7 */
8 /*
9 * ============================================================================
10 *
11 * Copyright (c) 2013, 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 VAYUDSPPROC_H_0xbbed
53 #define VAYUDSPPROC_H_0xbbed
56 /* Module headers */
57 #include <ti/syslink/ProcMgr.h>
58 #include <ProcDefs.h>
61 #if defined (__cplusplus)
62 extern "C" {
63 #endif
66 /*!
67 * @def VAYUDSPPROC_MODULEID
68 * @brief Module ID for VAYUSLAVE.
69 */
70 #define VAYUDSPPROC_MODULEID (UInt16) 0xbbec
72 /* =============================================================================
73 * All success and failure codes for the module
74 * =============================================================================
75 */
76 /*!
77 * @def VAYUDSPPROC_STATUSCODEBASE
78 * @brief Error code base for ProcMgr.
79 */
80 #define VAYUDSPPROC_STATUSCODEBASE (VAYUDSPPROC_MODULEID << 12u)
82 /*!
83 * @def VAYUDSPPROC_MAKE_FAILURE
84 * @brief Macro to make failure code.
85 */
86 #define VAYUDSPPROC_MAKE_FAILURE(x) ((Int)( 0x80000000 \
87 | (VAYUDSPPROC_STATUSCODEBASE + (x))))
89 /*!
90 * @def VAYUDSPPROC_MAKE_SUCCESS
91 * @brief Macro to make success code.
92 */
93 #define VAYUDSPPROC_MAKE_SUCCESS(x) (VAYUDSPPROC_STATUSCODEBASE + (x))
95 /*!
96 * @def VAYUDSPPROC_E_MMUENTRYEXISTS
97 * @brief Specified MMU entry already exists.
98 */
99 #define VAYUDSPPROC_E_MMUENTRYEXISTS VAYUDSPPROC_MAKE_FAILURE(1)
101 /*!
102 * @def VAYUDSPPROC_E_ISR
103 * @brief Error occurred during ISR operation.
104 */
105 #define VAYUDSPPROC_E_ISR VAYUDSPPROC_MAKE_FAILURE(2)
107 /*!
108 * @def VAYUDSPPROC_E_MMUCONFIG
109 * @brief Error occurred during MMU configuration
110 */
111 #define VAYUDSPPROC_E_MMUCONFIG VAYUDSPPROC_MAKE_FAILURE(3)
113 /*!
114 * @def VAYUDSPPROC_E_OSFAILURE
115 * @brief Failure in an OS-specific operation.
116 */
117 #define VAYUDSPPROC_E_OSFAILURE VAYUDSPPROC_MAKE_FAILURE(4)
119 /*!
120 * @def VAYUDSPPROC_E_INVALIDARG
121 * @brief Argument passed to a function is invalid.
122 */
123 #define VAYUDSPPROC_E_INVALIDARG VAYUDSPPROC_MAKE_FAILURE(5)
125 /*!
126 * @def VAYUDSPPROC_E_MEMORY
127 * @brief Memory allocation failed.
128 */
129 #define VAYUDSPPROC_E_MEMORY VAYUDSPPROC_MAKE_FAILURE(6)
131 /*!
132 * @def VAYUDSPPROC_E_HANDLE
133 * @brief Invalid object handle specified
134 */
135 #define VAYUDSPPROC_E_HANDLE VAYUDSPPROC_MAKE_FAILURE(7)
137 /*!
138 * @def VAYUDSPPROC_E_ACCESSDENIED
139 * @brief The operation is not permitted in this process.
140 */
141 #define VAYUDSPPROC_E_ACCESSDENIED VAYUDSPPROC_MAKE_FAILURE(8)
143 /*!
144 * @def VAYUDSPPROC_E_FAIL
145 * @brief Generic failure.
146 */
147 #define VAYUDSPPROC_E_FAIL VAYUDSPPROC_MAKE_FAILURE(9)
149 /*!
150 * @def VAYUDSPPROC_SUCCESS
151 * @brief Operation successful.
152 */
153 #define VAYUDSPPROC_SUCCESS VAYUDSPPROC_MAKE_SUCCESS(0)
155 /*!
156 * @def VAYUDSPPROC_S_ALREADYSETUP
157 * @brief The VAYUDSPPROC module has already been setup in this process.
158 */
159 #define VAYUDSPPROC_S_ALREADYSETUP VAYUDSPPROC_MAKE_SUCCESS(1)
161 /*!
162 * @def VAYUDSPPROC_S_OPENHANDLE
163 * @brief Other VAYUDSPPROC clients have still setup the VAYUDSPPROC module.
164 */
165 #define VAYUDSPPROC_S_SETUP VAYUDSPPROC_MAKE_SUCCESS(2)
167 /*!
168 * @def VAYUDSPPROC_S_OPENHANDLE
169 * @brief Other VAYUDSPPROC handles are still open in this process.
170 */
171 #define VAYUDSPPROC_S_OPENHANDLE VAYUDSPPROC_MAKE_SUCCESS(3)
173 /*!
174 * @def VAYUDSPPROC_S_ALREADYEXISTS
175 * @brief The VAYUDSPPROC instance has already been created/opened in this
176 * process
177 */
178 #define VAYUDSPPROC_S_ALREADYEXISTS VAYUDSPPROC_MAKE_SUCCESS(4)
181 /* =============================================================================
182 * Macros and types
183 * =============================================================================
184 */
185 /*!
186 * @brief Module configuration structure.
187 */
188 typedef struct VAYUDSPPROC_Config {
189 UInt32 reserved; /*!< Reserved field (not currently required) */
190 } VAYUDSPPROC_Config;
192 /*!
193 * @brief Configuration parameters specific to this processor.
194 */
195 typedef struct VAYUDSPPROC_Params_tag {
196 Bool mmuEnable;
197 /*!< Determines if mmu should be used (enabled) */
198 UInt32 numMemEntries;
199 /*!< Number of memory regions to be configured. */
200 ProcMgr_AddrInfo memEntries[ProcMgr_MAX_MEMORY_REGIONS];
201 /*!< Array of information structures for memory regions to be configured. */
202 UInt32 carveoutAddr[ProcMgr_MAX_MEMORY_REGIONS];
203 /*!< The address of the carveout for shared mem */
204 UInt32 carveoutSize[ProcMgr_MAX_MEMORY_REGIONS];
205 /*!< The length of the carveout for shared mem */
206 } VAYUDSPPROC_Params;
208 /*!
209 * @brief VAYUDSPPROC instance object.
210 */
211 struct VAYUDSPPROC_Object_tag {
212 VAYUDSPPROC_Params params;
213 /*!< Instance parameters (configuration values) */
214 Ptr halObject;
215 /*!< Pointer to the Hardware Abstraction Layer object. */
216 ProcMgr_Handle pmHandle;
217 /*!< Handle to proc manager */
218 Processor_Handle procHandle;
219 /*!< Handle to processor */
220 };
222 /*!
223 * @brief Defines the VAYUDSPPROC object type
224 */
225 typedef struct VAYUDSPPROC_Object_tag VAYUDSPPROC_Object;
227 /*!
228 * @brief Defines VAYUDSPPROC object handle
229 */
230 typedef struct VAYUDSPPROC_Object * VAYUDSPPROC_Handle;
233 /* =============================================================================
234 * APIs
235 * =============================================================================
236 */
238 /* Function to get the default configuration for the VAYUDSPPROC module. */
239 Void VAYUDSPPROC_getConfig (VAYUDSPPROC_Config * cfg);
241 /* Function to setup the VAYUDSPPROC module. */
242 Int VAYUDSPPROC_setup (VAYUDSPPROC_Config * cfg);
244 /* Function to destroy the VAYUDSPPROC module. */
245 Int VAYUDSPPROC_destroy (Void);
247 /* Function to initialize the parameters for this processor instance. */
248 Void VAYUDSPPROC_Params_init (VAYUDSPPROC_Handle handle,
249 VAYUDSPPROC_Params * params);
251 /* Function to create an instance of this processor. */
252 VAYUDSPPROC_Handle VAYUDSPPROC_create ( UInt16 procId,
253 const VAYUDSPPROC_Params * params);
255 /* Function to delete an instance of this processor. */
256 Int VAYUDSPPROC_delete (VAYUDSPPROC_Handle * handlePtr);
258 /* Function to open an instance of this processor. */
259 Int VAYUDSPPROC_open (VAYUDSPPROC_Handle * handlePtr, UInt16 procId);
261 /* Function to close an instance of this processor. */
262 Int VAYUDSPPROC_close (VAYUDSPPROC_Handle * handlePtr);
265 #if defined (__cplusplus)
266 }
267 #endif /* defined (__cplusplus) */
269 #endif /* VAYUDSPPROC_H_0xbbec */