8c89104cb374a5a4675733f209fbe8c64c221943
1 /**
2 * @file VAYUIpuCore0Proc.h
3 *
4 * @brief Processor interface for VAYUIPUCORE0.
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 VAYUIPUCORE0PROC_H_0xbbef
53 #define VAYUIPUCORE0PROC_H_0xbbef
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 VAYUIPUCORE0PROC_MODULEID
68 * @brief Module ID for VAYUSLAVE.
69 */
70 #define VAYUIPUCORE0PROC_MODULEID (UInt16) 0xbbec
72 /* =============================================================================
73 * All success and failure codes for the module
74 * =============================================================================
75 */
76 /*!
77 * @def VAYUIPUCORE0PROC_STATUSCODEBASE
78 * @brief Error code base for ProcMgr.
79 */
80 #define VAYUIPUCORE0PROC_STATUSCODEBASE (VAYUIPUCORE0PROC_MODULEID << 12u)
82 /*!
83 * @def VAYUIPUCORE0PROC_MAKE_FAILURE
84 * @brief Macro to make failure code.
85 */
86 #define VAYUIPUCORE0PROC_MAKE_FAILURE(x) ((Int)( 0x80000000 \
87 | (VAYUIPUCORE0PROC_STATUSCODEBASE + (x))))
89 /*!
90 * @def VAYUIPUCORE0PROC_MAKE_SUCCESS
91 * @brief Macro to make success code.
92 */
93 #define VAYUIPUCORE0PROC_MAKE_SUCCESS(x) (VAYUIPUCORE0PROC_STATUSCODEBASE + (x))
95 /*!
96 * @def VAYUIPUCORE0PROC_E_MMUENTRYEXISTS
97 * @brief Specified MMU entry already exists.
98 */
99 #define VAYUIPUCORE0PROC_E_MMUENTRYEXISTS VAYUIPUCORE0PROC_MAKE_FAILURE(1)
101 /*!
102 * @def VAYUIPUCORE0PROC_E_ISR
103 * @brief Error occurred during ISR operation.
104 */
105 #define VAYUIPUCORE0PROC_E_ISR VAYUIPUCORE0PROC_MAKE_FAILURE(2)
107 /*!
108 * @def VAYUIPUCORE0PROC_E_MMUCONFIG
109 * @brief Error occurred during MMU configuration
110 */
111 #define VAYUIPUCORE0PROC_E_MMUCONFIG VAYUIPUCORE0PROC_MAKE_FAILURE(3)
113 /*!
114 * @def VAYUIPUCORE0PROC_E_OSFAILURE
115 * @brief Failure in an OS-specific operation.
116 */
117 #define VAYUIPUCORE0PROC_E_OSFAILURE VAYUIPUCORE0PROC_MAKE_FAILURE(4)
119 /*!
120 * @def VAYUIPUCORE0PROC_E_INVALIDARG
121 * @brief Argument passed to a function is invalid.
122 */
123 #define VAYUIPUCORE0PROC_E_INVALIDARG VAYUIPUCORE0PROC_MAKE_FAILURE(5)
125 /*!
126 * @def VAYUIPUCORE0PROC_E_MEMORY
127 * @brief Memory allocation failed.
128 */
129 #define VAYUIPUCORE0PROC_E_MEMORY VAYUIPUCORE0PROC_MAKE_FAILURE(6)
131 /*!
132 * @def VAYUIPUCORE0PROC_E_HANDLE
133 * @brief Invalid object handle specified
134 */
135 #define VAYUIPUCORE0PROC_E_HANDLE VAYUIPUCORE0PROC_MAKE_FAILURE(7)
137 /*!
138 * @def VAYUIPUCORE0PROC_E_ACCESSDENIED
139 * @brief The operation is not permitted in this process.
140 */
141 #define VAYUIPUCORE0PROC_E_ACCESSDENIED VAYUIPUCORE0PROC_MAKE_FAILURE(8)
143 /*!
144 * @def VAYUIPUCORE0PROC_E_FAIL
145 * @brief Generic failure.
146 */
147 #define VAYUIPUCORE0PROC_E_FAIL VAYUIPUCORE0PROC_MAKE_FAILURE(9)
149 /*!
150 * @def VAYUIPUCORE0PROC_SUCCESS
151 * @brief Operation successful.
152 */
153 #define VAYUIPUCORE0PROC_SUCCESS VAYUIPUCORE0PROC_MAKE_SUCCESS(0)
155 /*!
156 * @def VAYUIPUCORE0PROC_S_ALREADYSETUP
157 * @brief The VAYUIPUCORE0PROC module has already been setup in this process.
158 */
159 #define VAYUIPUCORE0PROC_S_ALREADYSETUP VAYUIPUCORE0PROC_MAKE_SUCCESS(1)
161 /*!
162 * @def VAYUIPUCORE0PROC_S_OPENHANDLE
163 * @brief Other VAYUIPUCORE0PROC clients have still setup the
164 * VAYUIPUCORE0PROC module.
165 */
166 #define VAYUIPUCORE0PROC_S_SETUP VAYUIPUCORE0PROC_MAKE_SUCCESS(2)
168 /*!
169 * @def VAYUIPUCORE0PROC_S_OPENHANDLE
170 * @brief Other VAYUIPUCORE0PROC handles are still open in this process.
171 */
172 #define VAYUIPUCORE0PROC_S_OPENHANDLE VAYUIPUCORE0PROC_MAKE_SUCCESS(3)
174 /*!
175 * @def VAYUIPUCORE0PROC_S_ALREADYEXISTS
176 * @brief The VAYUIPUCORE0PROC instance has already been created/opened in
177 * this process
178 */
179 #define VAYUIPUCORE0PROC_S_ALREADYEXISTS VAYUIPUCORE0PROC_MAKE_SUCCESS(4)
182 /* =============================================================================
183 * Macros and types
184 * =============================================================================
185 */
186 /*!
187 * @brief Module configuration structure.
188 */
189 typedef struct VAYUIPUCORE0PROC_Config {
190 UInt32 reserved; /*!< Reserved field (not currently required) */
191 } VAYUIPUCORE0PROC_Config;
193 /*!
194 * @brief Configuration parameters specific to this processor.
195 */
196 typedef struct VAYUIPUCORE0PROC_Params_tag {
197 Bool mmuEnable;
198 /*!< Determines if mmu should be used (enabled) */
199 UInt32 numMemEntries;
200 /*!< Number of memory regions to be configured. */
201 ProcMgr_AddrInfo memEntries[ProcMgr_MAX_MEMORY_REGIONS];
202 /*!< Array of information structures for memory regions to be configured. */
203 UInt32 carveoutAddr[ProcMgr_MAX_MEMORY_REGIONS];
204 /*!< The address of the carveout for shared mem */
205 UInt32 carveoutSize[ProcMgr_MAX_MEMORY_REGIONS];
206 /*!< The length of the carveout for shared mem */
207 } VAYUIPUCORE0PROC_Params;
209 /*!
210 * @brief VAYUIPUCORE0PROC instance object.
211 */
212 struct VAYUIPUCORE0PROC_Object_tag {
213 VAYUIPUCORE0PROC_Params params;
214 /*!< Instance parameters (configuration values) */
215 Ptr halObject;
216 /*!< Pointer to the Hardware Abstraction Layer object. */
217 ProcMgr_Handle pmHandle;
218 /*!< Handle to proc manager */
219 Processor_Handle procHandle;
220 /*!< Handle to processor */
221 };
223 /*!
224 * @brief Defines the VAYUIPUCORE0PROC object type
225 */
226 typedef struct VAYUIPUCORE0PROC_Object_tag VAYUIPUCORE0PROC_Object;
228 /*!
229 * @brief Defines VAYUIPUCORE0PROC object handle
230 */
231 typedef struct VAYUIPUCORE0PROC_Object * VAYUIPUCORE0PROC_Handle;
234 /* =============================================================================
235 * APIs
236 * =============================================================================
237 */
239 /* Function to get the default configuration for the VAYUIPUCORE0PROC module. */
240 Void VAYUIPUCORE0PROC_getConfig (VAYUIPUCORE0PROC_Config * cfg);
242 /* Function to setup the VAYUIPUCORE0PROC module. */
243 Int VAYUIPUCORE0PROC_setup (VAYUIPUCORE0PROC_Config * cfg);
245 /* Function to destroy the VAYUIPUCORE0PROC module. */
246 Int VAYUIPUCORE0PROC_destroy (Void);
248 /* Function to initialize the parameters for this processor instance. */
249 Void VAYUIPUCORE0PROC_Params_init (VAYUIPUCORE0PROC_Handle handle,
250 VAYUIPUCORE0PROC_Params * params);
252 /* Function to create an instance of this processor. */
253 VAYUIPUCORE0PROC_Handle VAYUIPUCORE0PROC_create ( UInt16 procId,
254 const VAYUIPUCORE0PROC_Params * params);
256 /* Function to delete an instance of this processor. */
257 Int VAYUIPUCORE0PROC_delete (VAYUIPUCORE0PROC_Handle * handlePtr);
259 /* Function to open an instance of this processor. */
260 Int VAYUIPUCORE0PROC_open (VAYUIPUCORE0PROC_Handle * handlePtr, UInt16 procId);
262 /* Function to close an instance of this processor. */
263 Int VAYUIPUCORE0PROC_close (VAYUIPUCORE0PROC_Handle * handlePtr);
266 #if defined (__cplusplus)
267 }
268 #endif /* defined (__cplusplus) */
270 #endif /* VAYUIPUCORE0PROC_H_0xbbec */