Server.h

Go to the documentation of this file.
00001 /* 
00002  * Copyright (c) 2010, Texas Instruments Incorporated
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  *
00009  * *  Redistributions of source code must retain the above copyright
00010  *    notice, this list of conditions and the following disclaimer.
00011  *
00012  * *  Redistributions in binary form must reproduce the above copyright
00013  *    notice, this list of conditions and the following disclaimer in the
00014  *    documentation and/or other materials provided with the distribution.
00015  *
00016  * *  Neither the name of Texas Instruments Incorporated nor the names of
00017  *    its contributors may be used to endorse or promote products derived
00018  *    from this software without specific prior written permission.
00019  *
00020  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00021  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
00022  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00023  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
00024  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00025  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00026  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00027  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00028  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00029  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
00030  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00031  * 
00032  */
00033 /*
00034  *  ======== Server.h ========
00035  *  DSP Server module
00036  *
00037  *  APIs for accessing information from remote server.
00038  */
00039 
00050 #ifndef ti_sdo_ce_Server_
00051 #define ti_sdo_ce_Server_
00052 
00053 #ifdef __cplusplus
00054 extern "C" {
00055 #endif
00056 
00057 #include <stdio.h>  /* def of FILE * */
00058 
00061 
00065 #define Server_GTNAME "CS"
00066 
00070 #define Server_MAXSEGNAMELENGTH 32
00071 
00072 
00076 typedef struct Server_Obj *Server_Handle;
00077 
00081 typedef enum Server_Status {
00082     Server_EOK       = 0,      
00083     Server_ENOSERVER = 1,      
00084     Server_ENOMEM    = 2,      
00085     Server_ERUNTIME  = 3,      
00086     Server_EINVAL    = 4,      
00087     Server_EWRONGSTATE =5,     
00089     Server_EINUSE   = 6,       
00091     Server_ENOTFOUND = 7,      
00092     Server_EFAIL = 8           
00093 } Server_Status;
00094 
00100 typedef struct Server_AlgInfo {
00101     Int         algInfoSize;    
00102     String      name;           
00103     String      *typeTab;       
00104 } Server_AlgInfo;
00105 
00113 typedef struct Server_MemStat {
00114     Char   name[Server_MAXSEGNAMELENGTH + 1]; 
00115     Uint32 base;           
00116     Uint32 size;           
00117     Uint32 used;           
00118     Uint32 maxBlockLen;    
00119 } Server_MemStat;
00120 
00121 /*
00122  *  ======== Server_connectTrace ========
00123  */
00145 extern Server_Status Server_connectTrace(Server_Handle server, Int * token);
00146 
00147 /*
00148  *  ======== Server_disconnectTrace ========
00149  */
00167 extern Server_Status Server_disconnectTrace(Server_Handle server, Int token);
00168 
00169 /*
00170  *  ======== Server_fwriteTrace ========
00171  */
00196 extern Int Server_fwriteTrace(Server_Handle server, String prefix, FILE *out);
00197 
00198 /*
00199  *  ======== Server_getAlgInfo ========
00200  *  TODO: Do we need this?
00201  */
00224 extern Int Server_getAlgInfo(Server_Handle server, Int algNum,
00225         Server_AlgInfo *algInfo);
00226 
00227 /*
00228  *  ======== Server_getCpuLoad ========
00229  */
00251 extern Int Server_getCpuLoad(Server_Handle server);
00252 
00253 /*
00254  *  ======== Server_getMemStat ========
00255  */
00275 extern Server_Status Server_getMemStat(Server_Handle server, Int segNum,
00276         Server_MemStat *memStat);
00277 
00278 /*
00279  *  ======== Server_getNumAlgs ========
00280  */
00296 extern Server_Status Server_getNumAlgs(Server_Handle server, Int *numAlgs);
00297 
00298 /*
00299  *  ======== Server_getNumMemSegs ========
00300  */
00318 extern Server_Status Server_getNumMemSegs(Server_Handle server, Int *numSegs);
00319 
00321 /*
00322  *  ======== Server_init ========
00323  */
00324 extern Void Server_init(Void);
00327 /*
00328  *  ======== Server_redefineHeap ========
00329  */
00380 extern Server_Status Server_redefineHeap(Server_Handle server, String name,
00381         Uint32 base, Uint32 size);
00382 
00383 /*
00384  *  ======== Server_restoreHeap ========
00385  */
00417 extern Server_Status Server_restoreHeap(Server_Handle server, String name);
00418 
00419 /*
00420  *  ======== Server_setTrace ========
00421  */
00443 extern Int Server_setTrace(Server_Handle server, String mask);
00444   /* ingroup */
00446 
00447 #ifdef __cplusplus
00448 }
00449 #endif
00450 
00451 #endif
00452 /*
00453  *  @(#) ti.sdo.ce; 1, 0, 6,432; 12-2-2010 21:19:08; /db/atree/library/trees/ce/ce-r11x/src/ xlibrary
00454 
00455  */
00456 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Copyright 2010, Texas Instruments Incorporated