1/*
2 * dspbridge/mpu_api/inc/DSPManager.h
3 *
4 * DSP-BIOS Bridge driver support functions for TI OMAP processors.
5 *
6 * Copyright (C) 2007 Texas Instruments, Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU Lesser General Public License as published
10 * by the Free Software Foundation version 2.1 of the License.
11 *
12 * This program is distributed .as is. WITHOUT ANY WARRANTY of any kind,
13 * whether express or implied; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 * Lesser General Public License for more details.
16 */
17
18
19/*
20 *  ======== DSPManager.h ========
21 *  Description:
22 *      This is the header for the DSP/BIOS Bridge manager module.
23 *
24 *  Public Functions:
25 *      DspManager_Open
26 *      DspManager_Close
27 *      DSPManager_EnumNodeInfo
28 *      DSPManager_EnumProcessorInfo
29 *      DSPManager_WaitForEvents
30 *      DSPManager_RegisterObject
31 *      DSPManager_UnregisterObject
32 *
33 *! Revision History:
34 *! ================
35 *! 03-Dec-2003 map Replaced include of dbdcddefs.h with dbdefs.h
36 *! 22-Nov-2002 gp  Replaced include of dbdcd.h w/ dbdcddefs.h (hiding DCD APIs)
37 *!                 Formatting cleanup.
38 *! 15-Oct-2002 kc  Removed legacy PERF definitions.
39 *! 16-Aug-2002 map Added DSPManager_RegisterObject/UnregisterObject for
40 *!                     registering Dynamic Libraries
41 *! 13-Feb-2001 kc: DSP/BIOS Bridge name updates.
42 *! 22-Nov-2000 kc: Added DSPManager_PerfGetStat to acquire PERF stats.
43 *! 25-Sep-2000 rr: Updated to Version 0.9
44 *! 14-Aug-2000 rr: Cleaned up.
45 *! 20-Jul-2000 rr: Updated to Version 0.8.
46 *! 27-Jun-2000 rr: Created from dbapi.h
47 */
48
49#ifndef DSPMANAGER_
50#define DSPMANAGER_
51
52#ifdef __cplusplus
53extern "C" {
54#endif
55
56#include <dbdefs.h>
57
58/*
59 *  ======== DspManager_Open ========
60 *  Purpose:
61 *      Open handle to the DSP/BIOS Bridge driver
62 *  Parameters:
63 *      argc:               Reserved, set to zero
64 *      argp:               Reserved, set to NULL
65 *                          in the database will be returned.
66 *  Returns:
67 *      DSP_SOK:            Success.
68 *      DSP_EFAIL:          Failed to open handle to the DSP/BIOS Bridge driver
69 *  Details:
70 */
71	extern DBAPI DspManager_Open(UINT argc, PVOID argp);
72
73/*
74 *  ======== DspManager_Close ========
75 *  Purpose:
76 *      Close handle to the DSP/BIOS Bridge driver
77 *  Parameters:
78 *      argc:               Reserved, set to zero
79 *      argp:               Reserved, set to NULL
80 *                          in the database will be returned.
81 *  Returns:
82 *      DSP_SOK:            Success.
83 *      DSP_EFAIL:          Failed to close handle to the DSP/BIOS Bridge driver
84 *  Details:
85 */
86	extern DBAPI DspManager_Close(UINT argc, PVOID argp);
87
88/*
89 *  ======== DSPManager_EnumNodeInfo ========
90 *  Purpose:
91 *      Enumerate and get configuration information about nodes configured
92 *      in the node database.
93 *  Parameters:
94 *      uNode:              The node index, counting up from 0.
95 *      pNDBProps:          Ptr to the DSP_NDBPROPS structure for output.
96 *      uNDBPropsSize:      Size of the DSP_NDBPROPS structure.
97 *      puNumNodes:         Location where the number of nodes configured
98 *                          in the database will be returned.
99 *  Returns:
100 *      DSP_SOK:            Success.
101 *      DSP_EINVALIDARG:    Parameter uNode is out of range
102 *      DSP_EPOINTER:       Parameter pNDBProps or puNumNodes is not valid
103 *      DSP_EFAIL:          Unable to get the node information.
104 *      DSP_ESIZE:          The size of the specified DSP_NDBPROPS structure
105 *                          is too small to hold all node information,
106 *                          (i.e., uNDBPropsSize is too small).
107 *      DSP_ECHANGEDURINGENUM:  During Enumeration there has been a change in
108 *                          the number of nodes configured or in the
109 *                          the properties of the enumerated nodes.
110 *  Details:
111 */
112	extern DBAPI DSPManager_EnumNodeInfo(UINT uNode,
113					     OUT struct DSP_NDBPROPS * pNDBProps,
114					     UINT uNDBPropsSize,
115					     OUT UINT * puNumNodes);
116
117/*
118 *  ======== DSPManager_EnumProcessorInfo ========
119 *  Purpose:
120 *      Enumerate and get configuration information about available DSP
121 *      processors.
122 *  Parameters:
123 *      uProcessor:         The processor index, counting up from 0.
124 *      pProcessorInfo:     Ptr to the DSP_PROCESSORINFO structure .
125 *      uProcessorInfoSize: Size of DSP_PROCESSORINFO structure.
126 *      puNumProcs:         Location where the number of DSPs configured
127 *                          in the database will be returned
128 *  Returns:
129 *      DSP_SOK:            Success.
130 *      DSP_EINVALIDARG:    Parameter uProcessor is out of range
131 *      DSP_EPOINTER:       Parameter pProcessorInfo or puNumProcs is not valid.
132 *      DSP_EFAIL:          Unable to get the processor information.
133 *      DSP_ESIZE:          The size of the specified DSP_PROCESSORINFO struct
134 *                          is too small to hold all the processor information,
135 *                          (i.e., uProcessorInfoSize is too small).
136 *  Details:
137 */
138	extern DBAPI DSPManager_EnumProcessorInfo(UINT uProcessor,
139						  OUT struct DSP_PROCESSORINFO *
140						  pProcessorInfo,
141						  UINT uProcessorInfoSize,
142						  OUT UINT * puNumProcs);
143
144/*
145 *  ======== DSPManager_WaitForEvents ========
146 *  Purpose:
147 *      Block on any Bridge event(s)
148 *  Parameters:
149 *      aNotifications  : array of pointers to notification objects.
150 *      uCount          : number of elements in above array
151 *      puIndex         : index of signaled event object
152 *      uTimeout        : timeout interval in milliseocnds
153 *  Returns:
154 *      DSP_SOK         : Success.
155 *      DSP_ETIMEOUT    : Wait timed out. *puIndex is undetermined.
156 *  Details:
157 */
158	extern DBAPI DSPManager_WaitForEvents(struct DSP_NOTIFICATION**
159					      aNotifications, UINT uCount,
160					      OUT UINT * puIndex,
161					      UINT uTimeout);
162
163/*
164 *  ======== DSPManager_RegisterObject ========
165 *  Purpose:
166 *     Register object with DSP/BIOS Bridge Configuration database (DCD).
167 *  Parameters:
168 *     pUuid:          Pointer to UUID structure.
169 *     objType:        Library Type
170 *     pszPathName:    Path to library
171 *  Returns:
172 *     DSP_SOK:        Success.
173 *     DSP_EFAIL:      Unable to register object with the DCD.
174 *  Details:
175 */
176	extern DBAPI DSPManager_RegisterObject(struct DSP_UUID * pUuid,
177					       DSP_DCDOBJTYPE objType,
178					       CHAR * pszPathName);
179
180/*
181 *  ======== DSPManager_UnregisterObject ========
182 *  Purpose:
183 *     Unregister object with DSP/BIOS Bridge Configuration Database (DCD).
184 *  Parameters:
185 *     pUuid:          Pointer to UUID structure.
186 *     objType:        Library Type
187 *  Returns:
188 *     DSP_SOK:        Success.
189 *     DSP_EFAIL:      Unable to unregister object from the DCD.
190 *  Details:
191 */
192	extern DBAPI DSPManager_UnregisterObject(struct DSP_UUID * pUuid,
193						 DSP_DCDOBJTYPE objType);
194
195#ifndef RES_CLEANUP_DISABLE
196/*
197 *  ======== DSPManager_GetProcResourceInfo========
198 *  Purpose:
199 *     Get GPP process resource information.
200 *  Parameters:
201 *     pBuf:           Pointer to information buffer.
202 *  Returns:
203 *     DSP_SOK:        Success.
204 *     DSP_EFAIL:      Unable to unregister object from the DCD.
205 *  Details:
206 */
207	extern DBAPI DSPManager_GetProcResourceInfo(UINT *pBuf, UINT *pSize);
208#endif
209
210
211#ifdef __cplusplus
212}
213#endif
214#endif				/* DSPManager_ */
215