Codec Engine Application Programming Interface (API)  ce-w08
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Server.h
Go to the documentation of this file.
1 /*
2  * Copyright 2013 by Texas Instruments Incorporated.
3  *
4  */
5 
6 /*
7  * Copyright (c) 2013, Texas Instruments Incorporated
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  *
14  * * Redistributions of source code must retain the above copyright
15  * notice, this list of conditions and the following disclaimer.
16  *
17  * * Redistributions in binary form must reproduce the above copyright
18  * notice, this list of conditions and the following disclaimer in the
19  * documentation and/or other materials provided with the distribution.
20  *
21  * * Neither the name of Texas Instruments Incorporated nor the names of
22  * its contributors may be used to endorse or promote products derived
23  * from this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
27  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
29  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
32  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
33  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
34  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
35  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  *
37  */
38 /*
39  * ======== Server.h ========
40  * DSP Server module
41  *
42  * APIs for accessing information from remote server.
43  */
44 
55 #ifndef ti_sdo_ce_Server_
56 #define ti_sdo_ce_Server_
57 
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61 
62 
63 #include <ti/sdo/ce/ServerDefs.h>
64 #include <ti/sdo/ce/Engine.h>
65 #include <ti/sdo/ce/skel.h>
66 
67 #include <stdio.h> /* def of FILE * */
68 
71 
80 #define Server_MODNAME "ti.sdo.ce.Server"
81 
85 #define Server_MAXSEGNAMELENGTH 32
86 
90 typedef enum Server_Status {
91  Server_EOK = 0,
103 } Server_Status;
104 
105 /*
106  * ======== Server_AlgDesc ========
107  */
108 typedef struct Server_AlgDesc {
114  String name;
115 
125 
131  Ptr idmaFxns;
132 
138  Bool isLocal;
139 
165  Int groupId;
166 
177  Ptr iresFxns;
178 
179  /*
180  * Currently not used.
181  * Codec class configuration data for stub side, if any. We
182  * generate this structure for both sides, although it is
183  * currently only used in the skeletons.
184  */
186 
191 
192  /*
193  * Currently not used.
194  * Indicates the type of memory the alg's memory requests will
195  * be allocated from.
196  * The alg's memory will be allocated from cached memory, if
197  * memType = Engine_USECACHEDMEM_CACHED,
198  * from non-cached memory, if
199  * memType = Engine_USECACHEDMEM_NONCACHED,
200  * Otherwise, if
201  * memType = Engine_USECACHEDMEM_DEFAULT,
202  * memory allocations will be determined by the value of
203  * ti_sdo_ce_alg_Algorithm_useCache (cached, if TRUE, non-cached,
204  * if FALSE).
205  *
206  * @sa Engine_CachedMemType
207  */
236  String types;
237 
242  String stubFxnsName;
243 
247  SKEL_Fxns *skelFxns;
248 
252  Int priority;
253 
258 
259  /*
260  * Currently not used.
261  * Memory heap for algorithm stack.
262  */
263  Int stackSeg;
265 
273 typedef struct Server_MemStat {
275  Uint32 base;
276  Uint32 size;
277  Uint32 used;
278  Uint32 maxBlockLen;
280 
281 
282 /*
283  * ======== Server_addAlg ========
284  */
380 extern Server_Status Server_addAlg(Server_Handle server, String location,
381  Server_AlgDesc *pAlgDesc);
382 
383 
384 /*
385  * ======== Server_connectTrace ========
386  */
408 extern Server_Status Server_connectTrace(Server_Handle server, Int * token);
409 
410 /*
411  * ======== Server_disconnectTrace ========
412  */
430 extern Server_Status Server_disconnectTrace(Server_Handle server, Int token);
431 
432 /*
433  * ======== Server_fwriteTrace ========
434  */
459 extern Int Server_fwriteTrace(Server_Handle server, String prefix, FILE *out);
460 
461 /*
462  * ======== Server_getCpuLoad ========
463  */
485 extern Int Server_getCpuLoad(Server_Handle server);
486 
487 /*
488  * ======== Server_getMemStat ========
489  */
512 extern Server_Status Server_getMemStat(Server_Handle server, Int segNum,
513  Server_MemStat *memStat);
514 
515 /*
516  * ======== Server_getNumMemSegs ========
517  */
539 extern Server_Status Server_getNumMemSegs(Server_Handle server, Int *numSegs);
540 
542 /*
543  * ======== Server_init ========
544  */
545 extern Void Server_init(Void);
548 /*
549  * ======== Server_initAlgDesc ========
550  */
583 extern Void Server_initAlgDesc(Server_AlgDesc *pAlgDesc);
584 
585 /*
586  * ======== Server_redefineHeap ========
587  */
641 extern Server_Status Server_redefineHeap(Server_Handle server, String name,
642  Uint32 base, Uint32 size);
643 
644 #if 0
645 /*
646  * ======== Server_removeAlg ========
647  */
648 /*
649  * Currently not implemented.
650  *
651  * @brief Dynamically remove an algorithm that was added to a Server
652  * with Server_addAlg().
653  *
654  * @remarks The same values of the parameters @c name and @c server that
655  * were passed to Server_addAlg() should be used here. In
656  * particular, if @c name was used to add the alg, all handles to
657  * the engine named @c name must be closed before calling
658  * Server_removeAlg().
659  *
660  *
661  * @param[in] name The name of the engine or NULL, that was
662  * passed to Server_addAlg(). Set to NULL for now.
663  * Currently, only the default "local" engine is
664  * supported.
665  * @param[in] server The handle to a server, previously acquired
666  * by a call to Engine_getServer(), or NULL.
667  * Set to NULL for now. In the future, this will
668  * be used to dynamically remove remote
669  * algorithms from a server.
670  * @param[in] algName Name of the algorithm to remove.
671  *
672  * @retval Server_EOK Success.
673  * @retval Server_ENOTFOUND The server's underlying engine, @c name,
674  * does not exist.
675  * @retval Server_ENOTFOUND @c algName could not be found in the
676  * server's underlying engine table.
677  * @retval Server_EINUSE The server's underlying engine, @c name,
678  * is still open.
679  *
680  * @sa Server_addAlg()
681  */
682 extern Server_Status Server_removeAlg(String name, Server_Handle server,
683  String algName);
684 #endif
685 
686 /*
687  * ======== Server_restoreHeap ========
688  */
722 extern Server_Status Server_restoreHeap(Server_Handle server, String name);
723 
724 /*
725  * ======== Server_setTrace ========
726  */
748 extern Int Server_setTrace(Server_Handle server, String mask);
749  /* ingroup */
751 
752 #ifdef __cplusplus
753 }
754 #endif
755 
756 #endif
757 /*
758  * @(#) ti.sdo.ce; 1, 0, 6,3; 6-13-2013 00:10:03; /db/atree/library/trees/ce/ce-w08/src/ xlibrary
759 
760  */
761 
Copyright 2013, Texas Instruments Incorporated