1 /**
2 * @file VAYUIpuCore1Proc.h
3 *
4 * @brief Processor interface for VAYUSLAVE.
5 *
6 *
7 */
8 /*
9 * ============================================================================
10 *
11 * Copyright (c) 2013-2014, 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 VAYUIPUCORE1PROC_H_0xbbed
53 #define VAYUIPUCORE1PROC_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 VAYUIPUCORE1PROC_MODULEID
68 * @brief Module ID for VAYUSLAVE.
69 */
70 #define VAYUIPUCORE1PROC_MODULEID (UInt16) 0xbbec
72 /* =============================================================================
73 * All success and failure codes for the module
74 * =============================================================================
75 */
76 /*!
77 * @def VAYUIPUCORE1PROC_STATUSCODEBASE
78 * @brief Error code base for ProcMgr.
79 */
80 #define VAYUIPUCORE1PROC_STATUSCODEBASE (VAYUIPUCORE1PROC_MODULEID << 12u)
82 /*!
83 * @def VAYUIPUCORE1PROC_MAKE_FAILURE
84 * @brief Macro to make failure code.
85 */
86 #define VAYUIPUCORE1PROC_MAKE_FAILURE(x) ((Int)( 0x80000000 \
87 | (VAYUIPUCORE1PROC_STATUSCODEBASE + (x))))
89 /*!
90 * @def VAYUIPUCORE1PROC_MAKE_SUCCESS
91 * @brief Macro to make success code.
92 */
93 #define VAYUIPUCORE1PROC_MAKE_SUCCESS(x) (VAYUIPUCORE1PROC_STATUSCODEBASE + (x))
95 /*!
96 * @def VAYUIPUCORE1PROC_E_MMUENTRYEXISTS
97 * @brief Specified MMU entry already exists.
98 */
99 #define VAYUIPUCORE1PROC_E_MMUENTRYEXISTS VAYUIPUCORE1PROC_MAKE_FAILURE(1)
101 /*!
102 * @def VAYUIPUCORE1PROC_E_ISR
103 * @brief Error occurred during ISR operation.
104 */
105 #define VAYUIPUCORE1PROC_E_ISR VAYUIPUCORE1PROC_MAKE_FAILURE(2)
107 /*!
108 * @def VAYUIPUCORE1PROC_E_MMUCONFIG
109 * @brief Error occurred during MMU configuration
110 */
111 #define VAYUIPUCORE1PROC_E_MMUCONFIG VAYUIPUCORE1PROC_MAKE_FAILURE(3)
113 /*!
114 * @def VAYUIPUCORE1PROC_E_OSFAILURE
115 * @brief Failure in an OS-specific operation.
116 */
117 #define VAYUIPUCORE1PROC_E_OSFAILURE VAYUIPUCORE1PROC_MAKE_FAILURE(4)
119 /*!
120 * @def VAYUIPUCORE1PROC_E_INVALIDARG
121 * @brief Argument passed to a function is invalid.
122 */
123 #define VAYUIPUCORE1PROC_E_INVALIDARG VAYUIPUCORE1PROC_MAKE_FAILURE(5)
125 /*!
126 * @def VAYUIPUCORE1PROC_E_MEMORY
127 * @brief Memory allocation failed.
128 */
129 #define VAYUIPUCORE1PROC_E_MEMORY VAYUIPUCORE1PROC_MAKE_FAILURE(6)
131 /*!
132 * @def VAYUIPUCORE1PROC_E_HANDLE
133 * @brief Invalid object handle specified
134 */
135 #define VAYUIPUCORE1PROC_E_HANDLE VAYUIPUCORE1PROC_MAKE_FAILURE(7)
137 /*!
138 * @def VAYUIPUCORE1PROC_E_ACCESSDENIED
139 * @brief The operation is not permitted in this process.
140 */
141 #define VAYUIPUCORE1PROC_E_ACCESSDENIED VAYUIPUCORE1PROC_MAKE_FAILURE(8)
143 /*!
144 * @def VAYUIPUCORE1PROC_E_FAIL
145 * @brief Generic failure.
146 */
147 #define VAYUIPUCORE1PROC_E_FAIL VAYUIPUCORE1PROC_MAKE_FAILURE(9)
149 /*!
150 * @def VAYUIPUCORE1PROC_SUCCESS
151 * @brief Operation successful.
152 */
153 #define VAYUIPUCORE1PROC_SUCCESS VAYUIPUCORE1PROC_MAKE_SUCCESS(0)
155 /*!
156 * @def VAYUIPUCORE1PROC_S_ALREADYSETUP
157 * @brief The VAYUIPUCORE1PROC module has already been setup in this process.
158 */
159 #define VAYUIPUCORE1PROC_S_ALREADYSETUP VAYUIPUCORE1PROC_MAKE_SUCCESS(1)
161 /*!
162 * @def VAYUIPUCORE1PROC_S_OPENHANDLE
163 * @brief Other VAYUIPUCORE1PROC clients have still setup the
164 * VAYUIPUCORE1PROC module.
165 */
166 #define VAYUIPUCORE1PROC_S_SETUP VAYUIPUCORE1PROC_MAKE_SUCCESS(2)
168 /*!
169 * @def VAYUIPUCORE1PROC_S_OPENHANDLE
170 * @brief Other VAYUIPUCORE1PROC handles are still open in this process.
171 */
172 #define VAYUIPUCORE1PROC_S_OPENHANDLE VAYUIPUCORE1PROC_MAKE_SUCCESS(3)
174 /*!
175 * @def VAYUIPUCORE1PROC_S_ALREADYEXISTS
176 * @brief The VAYUIPUCORE1PROC instance has already been created/opened in
177 * this process
178 */
179 #define VAYUIPUCORE1PROC_S_ALREADYEXISTS VAYUIPUCORE1PROC_MAKE_SUCCESS(4)
182 /* =============================================================================
183 * Macros and types
184 * =============================================================================
185 */
186 /*!
187 * @brief Module configuration structure.
188 */
189 typedef struct VAYUIPUCORE1PROC_Config {
190 UInt32 reserved; /*!< Reserved field (not currently required) */
191 } VAYUIPUCORE1PROC_Config;
193 /*!
194 * @brief Configuration parameters specific to this processor.
195 */
196 typedef struct VAYUIPUCORE1PROC_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 } VAYUIPUCORE1PROC_Params;
205 /*!
206 * @brief VAYUIPUCORE1PROC instance object.
207 */
208 struct VAYUIPUCORE1PROC_Object_tag {
209 VAYUIPUCORE1PROC_Params params;
210 /*!< Instance parameters (configuration values) */
211 Ptr halObject;
212 /*!< Pointer to the Hardware Abstraction Layer object. */
213 ProcMgr_Handle pmHandle;
214 /*!< Handle to proc manager */
215 Processor_Handle procHandle;
216 /*!< Handle to processor */
217 };
219 /*!
220 * @brief Defines the VAYUIPUCORE1PROC object type
221 */
222 typedef struct VAYUIPUCORE1PROC_Object_tag VAYUIPUCORE1PROC_Object;
224 /*!
225 * @brief Defines VAYUIPUCORE1PROC object handle
226 */
227 typedef struct VAYUIPUCORE1PROC_Object * VAYUIPUCORE1PROC_Handle;
230 /* =============================================================================
231 * APIs
232 * =============================================================================
233 */
235 /* Function to get the default configuration for the VAYUIPUCORE1PROC module. */
236 Void VAYUIPUCORE1PROC_getConfig (VAYUIPUCORE1PROC_Config * cfg);
238 /* Function to setup the VAYUIPUCORE1PROC module. */
239 Int VAYUIPUCORE1PROC_setup (VAYUIPUCORE1PROC_Config * cfg);
241 /* Function to destroy the VAYUIPUCORE1PROC module. */
242 Int VAYUIPUCORE1PROC_destroy (Void);
244 /* Function to initialize the parameters for this processor instance. */
245 Void VAYUIPUCORE1PROC_Params_init (VAYUIPUCORE1PROC_Handle handle,
246 VAYUIPUCORE1PROC_Params * params);
248 /* Function to create an instance of this processor. */
249 VAYUIPUCORE1PROC_Handle VAYUIPUCORE1PROC_create ( UInt16 procId,
250 const VAYUIPUCORE1PROC_Params * params);
252 /* Function to delete an instance of this processor. */
253 Int VAYUIPUCORE1PROC_delete (VAYUIPUCORE1PROC_Handle * handlePtr);
255 /* Function to open an instance of this processor. */
256 Int VAYUIPUCORE1PROC_open (VAYUIPUCORE1PROC_Handle * handlePtr, UInt16 procId);
258 /* Function to close an instance of this processor. */
259 Int VAYUIPUCORE1PROC_close (VAYUIPUCORE1PROC_Handle * handlePtr);
262 #if defined (__cplusplus)
263 }
264 #endif /* defined (__cplusplus) */
266 #endif /* VAYUIPUCORE1PROC_H_0xbbec */