RcmClient.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  *  ======== RcmClient.h ========
00037  *
00038  */
00039 
00238 #ifndef ti_sdo_rcm_RcmClient__include
00239 #define ti_sdo_rcm_RcmClient__include
00240 
00241 #include <xdc/runtime/knl/GateThread.h>
00242 
00243 
00246 
00247 #if defined (__cplusplus)
00248 extern "C" {
00249 #endif
00250 
00251 
00252 // -------- status codes --------
00253 
00257 #define RcmClient_S_SUCCESS (0)
00258 
00262 #define RcmClient_E_FAIL (-1)
00263 
00271 #define RcmClient_E_EXECASYNCNOTENABLED (-2)
00272 
00278 #define RcmClient_E_EXECFAILED (-3)
00279 
00287 #define RcmClient_E_INVALIDHEAPID (-4)
00288 
00296 #define RcmClient_E_INVALIDFXNIDX (-5)
00297 
00305 #define RcmClient_E_MSGFXNERROR (-6)
00306 
00312 #define RcmClient_E_IPCERROR (-7)
00313 
00317 #define RcmClient_E_LISTCREATEFAILED (-8)
00318 
00325 #define RcmClient_E_LOSTMSG (-9)
00326 
00334 #define RcmClient_E_MSGALLOCFAILED (-10)
00335 
00344 #define RcmClient_E_MSGQCREATEFAILED (-11)
00345 
00353 #define RcmClient_E_MSGQOPENFAILED (-12)
00354 
00361 #define RcmClient_E_SERVERERROR (-13)
00362 
00372 #define RcmClient_E_SERVERNOTFOUND (-14)
00373 
00380 #define RcmClient_E_SYMBOLNOTFOUND (-15)
00381 
00385 #define RcmClient_E_NOMEMORY (-16)
00386 
00394 #define RcmClient_E_JOBIDNOTFOUND (-17)
00395 
00396 
00397 // -------- constants and types --------
00398 
00402 #define RcmClient_INVALIDFXNIDX ((UInt32)(0xFFFFFFFF))
00403 
00407 #define RcmClient_INVALIDHEAPID ((UInt16)(0xFFFF))
00408 
00412 #define RcmClient_INVALIDMSGID (0)
00413 
00421 #define RcmClient_DEFAULTPOOLID ((UInt16)(0x8000))
00422 
00429 #define RcmClient_DISCRETEJOBID (0)
00430 
00434 typedef struct RcmClient_Object_tag *RcmClient_Handle;
00435 
00442 typedef struct {
00450     UInt16      poolId;
00451 
00459     UInt16      jobId;
00460 
00464     UInt32      fxnIdx;
00465 
00469     Int32       result;
00470 
00477     UInt32      dataSize;
00478 
00485     UInt32      data[1];
00486 
00487 } RcmClient_Message;
00488 
00497 typedef Void (*RcmClient_CallbackFxn)(RcmClient_Message *, Ptr);
00498 
00502 typedef struct {
00510     UInt16 heapId;
00511 
00525     Bool callbackNotification;
00526 
00527 } RcmClient_Params;
00528 
00536 typedef struct {
00537     xdc_runtime_knl_GateThread_Struct   _f1;
00538     Ptr                 _f2;
00539     Ptr                 _f3;
00540     UInt16              _f4;
00541     Ptr                 _f5;
00542     UInt32              _f6;
00543     Bool                _f7;
00544     UInt16              _f8;
00545     Ptr                 _f9;
00546     Ptr                 _f10;
00547     Ptr                 _f11;
00548     Ptr                 _f12;
00549 } RcmClient_Struct;
00550 
00551 
00552 // -------- functions --------
00553 
00554 /*
00555  *  ======== RcmClient_acquireJobId ========
00556  */
00564 Int RcmClient_acquireJobId(
00565         RcmClient_Handle        handle,
00566         UInt16 *                jobId
00567     );
00568 
00569 /*
00570  *  ======== RcmClient_addSymbol ========
00571  */
00596 Int RcmClient_addSymbol(
00597         RcmClient_Handle        handle,
00598         String                  name,
00599         Fxn                     addr,
00600         UInt32 *                index
00601     );
00602 
00603 /*
00604  *  ======== RcmClient_alloc ========
00605  */
00633 Int RcmClient_alloc(
00634         RcmClient_Handle        handle,
00635         UInt32                  dataSize,
00636         RcmClient_Message **    message
00637     );
00638 
00639 /*
00640  *  ======== RcmClient_checkForError ========
00641  */
00695 Int RcmClient_checkForError(
00696         RcmClient_Handle        handle,
00697         RcmClient_Message **    returnMsg
00698     );
00699 
00700 /*
00701  *  ======== RcmClient_construct ========
00702  */
00720 Int RcmClient_construct(
00721         RcmClient_Struct *      structPtr,
00722         String                  server,
00723         const RcmClient_Params *params
00724     );
00725 
00726 /*
00727  *  ======== RcmClient_create ========
00728  */
00748 Int RcmClient_create(
00749         String                  server,
00750         const RcmClient_Params *params,
00751         RcmClient_Handle *      handle
00752     );
00753 
00754 /*
00755  *  ======== RcmClient_delete ========
00756  */
00762 Int RcmClient_delete(
00763         RcmClient_Handle *      handlePtr
00764     );
00765 
00766 /*
00767  *  ======== RcmClient_destruct ========
00768  */
00775 Int RcmClient_destruct(
00776         RcmClient_Struct *      structPtr
00777     );
00778 
00779 /*
00780  *  ======== RcmClient_exec ========
00781  */
00809 Int RcmClient_exec(
00810         RcmClient_Handle        handle,
00811         RcmClient_Message *     cmdMsg,
00812         RcmClient_Message **    returnMsg
00813     );
00814 
00815 /*
00816  *  ======== RcmClient_execAsync ========
00817  */
00847 Int RcmClient_execAsync(
00848         RcmClient_Handle        handle,
00849         RcmClient_Message *     cmdMsg,
00850         RcmClient_CallbackFxn   callback,
00851         Ptr                     appData
00852     );
00853 
00854 /*
00855  *  ======== RcmClient_execCmd ========
00856  */
00880 Int RcmClient_execCmd(
00881         RcmClient_Handle        handle,
00882         RcmClient_Message *     cmdMsg
00883     );
00884 
00885 /*
00886  *  ======== RcmClient_execDpc ========
00887  */
00900 Int RcmClient_execDpc(
00901         RcmClient_Handle        handle,
00902         RcmClient_Message *     cmdMsg,
00903         RcmClient_Message **    returnMsg
00904     );
00905 
00906 /*
00907  *  ======== RcmClient_execNoWait ========
00908  */
00931 Int RcmClient_execNoWait(
00932         RcmClient_Handle        handle,
00933         RcmClient_Message *     cmdMsg,
00934         UInt16 *                msgId
00935     );
00936 
00937 /*
00938  *  ======== RcmClient_exit ========
00939  */
00949 Void RcmClient_exit(Void);
00950 
00951 /*
00952  *  ======== RcmClient_free ========
00953  */
00961 Int RcmClient_free(
00962         RcmClient_Handle        handle,
00963         RcmClient_Message *     msg
00964     );
00965 
00966 /*
00967  *  ======== RcmClient_getSymbolIndex ========
00968  */
00981 Int RcmClient_getSymbolIndex(
00982         RcmClient_Handle        handle,
00983         String                  name,
00984         UInt32 *                index
00985     );
00986 
00987 /*
00988  *  ======== RcmClient_init ========
00989  */
00998 Void RcmClient_init(Void);
00999 
01000 /*
01001  *  ======== RcmClient_Parmas_init ========
01002  */
01006 Void RcmClient_Params_init(
01007         RcmClient_Params *      params
01008     );
01009 
01010 /*
01011  *  ======== RcmClient_releaseJobId ========
01012  */
01020 Int RcmClient_releaseJobId(
01021         RcmClient_Handle        handle,
01022         UInt16                  jobId
01023     );
01024 
01025 /*
01026  *  ======== RcmClient_removeSymbol ========
01027  */
01037 Int RcmClient_removeSymbol(
01038         RcmClient_Handle        handle,
01039         String                  name
01040     );
01041 
01042 /*
01043  *  ======== RcmClient_waitUntilDone ========
01044  */
01060 Int RcmClient_waitUntilDone(
01061         RcmClient_Handle        handle,
01062         UInt16                  msgId,
01063         RcmClient_Message **    returnMsg
01064     );
01065 
01066 
01067 #if defined (__cplusplus)
01068 }
01069 #endif /* defined (__cplusplus) */
01070 
01073 #endif /* ti_sdo_rcm_RcmClient__include */
01074 /*
01075  *  @(#) ti.sdo.rcm; 2, 0, 0,3; 4-16-2012 00:03:16; /db/atree/library/trees/fc/fc-q08/src/ xlibrary
01076 
01077  */
01078 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Copyright 2012, Texas Instruments Incorporated