• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * dspbridge/mpu_api/inc/qosti.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 #ifndef _RQOSTI_H
20 #define _RQOSTI_H
21 #include <dbapi.h>
22 #include <qosti_dspdecl.h>
23 #include <stdio.h>
24 /* This must match QOS_TI_GetMemStatArg1::ALLHEAPS */
25 #define KAllHeaps 0x100
26 /* This must match QOS_TI_GetSharedScratchMsgArg2::ALL_SCRATCHGROUPS */
27 #define KAllScratchGroups 0
28 /*
29  *  ======== QOS_TI_GetDynLoaderMemStatArg1 ========
30  *  The enumeration defines the memory heap resources available for querying.
31  */
32 typedef enum QOS_TI_GetDynLoaderMemStatArg1 {
33 	EDynloadDaram = 0,
34 	EDynloadSaram = 1,
35 	EDynloadExternal = 2,
36 	EDynloadSram = 3
37 } QOS_TI_GetDynLoaderMemStatArg1;
38 
39 /*
40  *  ======== QOS_TI_GetSharedScratchMsgArg1 ========
41  *  The enumeration defines the control command selector for *arg1*
42  *  of the QOS_TI_GETSHAREDSCRATCH message.
43  */
44 typedef enum QOS_TI_GetSharedScratchMsgArg1 {
45 
46 	ESharedScratchAllHeaps,
47 
48 	ESharedScratchDaram,
49 
50 	ESharedScratchSaram
51 } QOS_TI_GetSharedScratchMsgArg1;
52 
53 void DbgMsg(DWORD dwZone, char *szFormat, ...);
54 
55 /*  ============================================================================
56   func   MsgToDsp
57   desc   Send Message to DSP
58   ret    DSP_SOK if Message was transferred to DSP successfully.
59  ============================================================================*/
60 
61 DSP_STATUS QosTI_DspMsg(DWORD dwCmd, DWORD dwArg1, DWORD dwArg2, DWORD *dwOut1,
62 																DWORD *dwOut2);
63 
64 /*  ========================================================================
65   func   Create
66   desc   Create the Qos service.
67   ret    DSP_SOK if successfully created.
68   ========================================================================*/
69 
70 DSP_STATUS QosTI_Create();
71 
72 /* ========================================================================
73   func   Delete
74   desc   Delete Qos service.
75   ========================================================================*/
76 
77 void QosTI_Delete();
78 
79 /*  ========================================================================
80   func   GetDynLoaderMemStat
81   desc   Get the current memory utilization for heaps used in dynamic loading.
82   arg   IN heapDesc:  value in range 0..4 => Heap Identifier
83                   Valid values:
84                         EDynloadDaram    = DYN_DARAM heap (internal)
85                         EDynloadSaram    = DYN_SARAM heap (internal)
86                         EDynloadExternal = DYN_EXTERNAL heap (external)
87                         EDynloadSram     = DYN_SRAM heap (internal)
88   arg   OUT memInitSize:             initially configured size of heap
89   arg   OUT memUsed:                 size of heap in use (not free)
90   arg   OUT memLargestFreeBlockSize: size of largest contiguous free memory
91   arg   OUT memFreeBlocks:           number of free blocks in heap
92   arg   OUT memAllocBlocks:          number of allocated blocks in heap
93   ret   DSP_SOK if successful.
94   ========================================================================*/
95 
96 DSP_STATUS QosTI_GetDynLoaderMemStat(UINT heapDesc, UINT *memInitSize,
97 								UINT *memUsed, UINT *memLargestFreeBlockSize,
98 								UINT *memFreeBlocks, UINT *memAllocBlocks);
99 
100 
101 /*  ========================================================================
102     func   QosTI_GetProcLoadStat
103     desc   Get the Processor load statistics
104     arg   OUT currentLoad:
105     arg   OUT predLoad:
106     arg   OUT currDspFreq:
107     arg   OUT predictedFreq:
108     ret   DSP_SOK if successful.
109     ======================================================================== */
110 DSP_STATUS QosTI_GetProcLoadStat(UINT *currentLoad, UINT *predLoad,
111 									    UINT *currDspFreq, UINT *predictedFreq);
112 
113 #endif				/* _RQOSTI_H*/
114 
115