RcmServer.h

Go to the documentation of this file.
00001 /* 
00002  * Copyright (c) 2012, 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 
00035 /*
00036  *  ======== RcmServer.h ========
00037  *
00038  */
00039 
00074 #ifndef ti_sdo_rcm_RcmServer__include
00075 #define ti_sdo_rcm_RcmServer__include
00076 
00077 #include <xdc/runtime/knl/GateThread.h>
00078 #include <xdc/runtime/knl/Thread.h>
00079 
00080 
00083 
00084 #if defined (__cplusplus)
00085 extern "C" {
00086 #endif
00087 
00088 
00089 // -------- success and failure codes --------
00090 
00094 #define RcmServer_S_SUCCESS (0)
00095 
00099 #define RcmServer_E_FAIL (-1)
00100 
00104 #define RcmServer_E_NOMEMORY (-2)
00105 
00112 #define RcmServer_E_SYMBOLNOTFOUND (-3)
00113 
00121 #define RcmServer_E_SYMBOLSTATIC (-4)
00122 
00129 #define RcmServer_E_SYMBOLTABLEFULL (-5)
00130 
00131 
00132 // -------- constants and types --------
00133 
00149 typedef Int32 (*RcmServer_MsgFxn)(UInt32, UInt32 *);
00150 
00159 typedef struct {
00167     String name;
00168 
00174     RcmServer_MsgFxn addr;
00175 
00176 } RcmServer_FxnDesc;
00177 
00181 typedef struct {
00185     Int length;
00186 
00190     RcmServer_FxnDesc *elem;
00191 
00192 } RcmServer_FxnDescAry;
00193 
00200 typedef struct {
00204     String name;
00205 
00209     UInt count;
00210 
00217     Thread_Priority priority;
00218 
00226     Int osPriority;
00227 
00231     SizeT stackSize;
00232 
00236     String stackSeg;
00237 
00238 } RcmServer_ThreadPoolDesc;
00239 
00243 typedef struct {
00247     Int length;
00248 
00252     RcmServer_ThreadPoolDesc *elem;
00253 
00254 } RcmServer_ThreadPoolDescAry;
00255 
00256 
00260 typedef struct RcmServer_Object_tag *RcmServer_Handle;
00261 
00265 typedef struct {
00275     Thread_Priority priority;
00276 
00288     Int osPriority;
00289 
00293     SizeT stackSize;
00294 
00298     String stackSeg;
00299 
00303     RcmServer_ThreadPoolDesc defaultPool;
00304 
00314     RcmServer_ThreadPoolDescAry workerPools;
00315 
00348     RcmServer_FxnDescAry fxns;
00349 
00350 } RcmServer_Params;
00351 
00359 typedef struct {
00360     GateThread_Struct   _f1;
00361     Ptr                 _f2;
00362     Ptr                 _f3;
00363     Ptr                 _f4;
00364     struct {
00365         Int     _f1;
00366         Ptr     _f2;
00367     }                   _f5;
00368     Ptr                 _f6[9];
00369     UInt16              _f7;
00370     UInt16              _f8;
00371     Bool                _f9;
00372     Int                 _f10;
00373     Ptr                 _f11[4];
00374     Ptr                 _f12;
00375 } RcmServer_Struct;
00376 
00377 
00378 // -------- functions --------
00379 
00380 /*
00381  *  ======== RcmServer_addSymbol ========
00382  */
00402 Int RcmServer_addSymbol(
00403         RcmServer_Handle        handle,
00404         String                  name,
00405         RcmServer_MsgFxn        addr,
00406         UInt32 *                index
00407     );
00408 
00409 /*
00410  *  ======== RcmServer_construct ========
00411  */
00434 Int RcmServer_construct(
00435         RcmServer_Struct *      structPtr,
00436         String                  name,
00437         const RcmServer_Params *params
00438     );
00439 
00440 /*
00441  *  ======== RcmServer_create ========
00442  */
00463 Int RcmServer_create(
00464         String                  name,
00465         RcmServer_Params *      params,
00466         RcmServer_Handle *      handle
00467     );
00468 
00469 /*
00470  *  ======== RcmServer_delete ========
00471  */
00477 Int RcmServer_delete(
00478         RcmServer_Handle *      handlePtr
00479     );
00480 
00481 /*
00482  *  ======== RcmServer_destruct ========
00483  */
00490 Int RcmServer_destruct(
00491         RcmServer_Struct *      structPtr
00492     );
00493 
00494 /*
00495  *  ======== RcmServer_exit ========
00496  */
00506 Void RcmServer_exit(Void);
00507 
00508 /*
00509  *  ======== RcmServer_init ========
00510  */
00519 Void RcmServer_init(Void);
00520 
00521 /*
00522  *  ======== RcmServer_Params_init ========
00523  */
00527 Void RcmServer_Params_init(
00528         RcmServer_Params *      params
00529     );
00530 
00531 /*
00532  *  ======== RcmServer_removeSymbol ========
00533  */
00547 Int RcmServer_removeSymbol(
00548         RcmServer_Handle        handle,
00549         String                  name
00550     );
00551 
00552 /*
00553  *  ======== RcmServer_start ========
00554  */
00566 Int RcmServer_start(
00567         RcmServer_Handle        handle
00568     );
00569 
00570 
00571 #if defined (__cplusplus)
00572 }
00573 #endif /* defined (__cplusplus) */
00574 
00576 #endif /* ti_sdo_rcm_RcmServer__include */
00577 /*
00578  *  @(#) ti.sdo.rcm; 2, 0, 0,3; 4-16-2012 00:03:16; /db/atree/library/trees/fc/fc-q08/src/ xlibrary
00579 
00580  */
00581 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Copyright 2012, Texas Instruments Incorporated