Home | History | Annotate | Download | only in inc
      1 /*
      2  *  Copyright 2001-2008 Texas Instruments - http://www.ti.com/
      3  *
      4  *  Licensed under the Apache License, Version 2.0 (the "License");
      5  *  you may not use this file except in compliance with the License.
      6  *  You may obtain a copy of the License at
      7  *
      8  *     http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  *  Unless required by applicable law or agreed to in writing, software
     11  *  distributed under the License is distributed on an "AS IS" BASIS,
     12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  *  See the License for the specific language governing permissions and
     14  *  limitations under the License.
     15  */
     16 
     17 
     18 /*
     19  *  ======== rms_sh.h ========
     20  *  DSP-BIOS Bridge driver support functions for TI OMAP processors.
     21  *
     22  *  DSP/BIOS Bridge Resource Manager Server shared definitions (used on both
     23  *  GPP and DSP sides).
     24  *
     25  *! Revision History
     26  *! ================
     27  *! 24-Mar-2003 vp  Merged updates required for CCS2.2 transition.
     28  *! 24-Feb-2003 kc  Rearranged order of node types to temporarily support legacy message
     29  *!                 node code
     30  *! 23-Nov-2002 gp  Converted tabs -> spaces, to fix formatting.
     31  *! 13-Feb-2002 jeh Added sysstacksize element to RMS_MoreTaskArgs.
     32  *! 11-Dec-2000 sg  Added 'misc' element to RMS_MoreTaskArgs.
     33  *! 04-Dec-2000 ag  Added RMS_BUFDESC command code.
     34  *!                 C/R code value changed to allow ORing of system/user codes.
     35  *! 10-Oct-2000 sg  Added 'align' field to RMS_StrmDef.
     36  *! 09-Oct-2000 sg  Moved pre-defined message codes here from rmsdefs.h.
     37  *! 02-Oct-2000 sg  Changed ticks to msec.
     38  *! 24-Aug-2000 sg  Moved definitions that will be exposed to app developers
     39  *!  		    to a separate file, rmsdefs.h.
     40  *! 10-Aug-2000 sg  Added RMS_COMMANDBUFSIZE and RMS_RESPONSEBUFSIZE; added
     41  *!		    pre-defined command/response codes; more comments.
     42  *! 09-Aug-2000 sg  Added RMS_ETASK.
     43  *! 08-Aug-2000 jeh Define RMS_WORD for GPP, rename DSP_MSG to RMS_DSPMSG.
     44  *!                 Added RMS_MsgArgs, RMS_MoreTaskArgs.
     45  *! 25-Jul-2000 sg: Changed SIO to STRM.
     46  *! 30-Jun-2000 sg: Initial.
     47  */
     48 
     49 #ifndef RMS_SH_
     50 #define RMS_SH_
     51 
     52 #ifdef __cplusplus
     53 extern "C" {
     54 #endif
     55 
     56 #include <rmstypes.h>
     57 
     58 /* Node Types: */
     59 #define RMS_TASK                1	/* Task node */
     60 #define RMS_DAIS                2	/* xDAIS socket node */
     61 #define RMS_MSG                 3	/* Message node */
     62 
     63 /* Memory Types: */
     64 #define RMS_CODE                0	/* Program space */
     65 #define RMS_DATA                1	/* Data space */
     66 #define RMS_IO                	2	/* I/O space */
     67 
     68 /* RM Server Command and Response Buffer Sizes: */
     69 #define RMS_COMMANDBUFSIZE     256	/* Size of command buffer */
     70 #define RMS_RESPONSEBUFSIZE    16	/* Size of response buffer */
     71 
     72 /* Pre-Defined Command/Response Codes: */
     73 #define RMS_EXIT                0x80000000	/* GPP->Node: shutdown */
     74 #define RMS_EXITACK             0x40000000	/* Node->GPP: ack shutdown */
     75 #define RMS_BUFDESC             0x20000000	/* Arg1 SM buf, Arg2 is SM size */
     76 #define RMS_USER                0x0	/* Start of user-defined msg codes */
     77 #define RMS_MAXUSERCODES        0xfff	/* Maximum user defined C/R Codes */
     78 
     79 
     80 /* RM Server RPC Command Structure: */
     81 	struct RMS_Command {
     82 		RMS_WORD fxn;	/* Server function address */
     83 		RMS_WORD arg1;	/* First argument */
     84 		RMS_WORD arg2;	/* Second argument */
     85 		RMS_WORD data;	/* Function-specific data array */
     86 	} ;
     87 
     88 /*
     89  *  The RMS_StrmDef structure defines the parameters for both input and output
     90  *  streams, and is passed to a node's create function.
     91  */
     92 	struct RMS_StrmDef {
     93 		RMS_WORD bufsize;	/* Buffer size (in DSP words) */
     94 		RMS_WORD nbufs;	/* Max number of bufs in stream */
     95 		RMS_WORD segid;	/* Segment to allocate buffers */
     96 		RMS_WORD align;	/* Alignment for allocated buffers */
     97 		RMS_WORD timeout;	/* Timeout (msec) for blocking calls */
     98 		RMS_CHAR name[1];	/* Device Name (terminated by '\0') */
     99 	} ;
    100 
    101 /* Message node create args structure: */
    102 	struct RMS_MsgArgs {
    103 		RMS_WORD maxMessages;	/* Max # simultaneous msgs to node */
    104 		RMS_WORD segid;	/* Mem segment for NODE_allocMsgBuf */
    105 		RMS_WORD notifyType;	/* Type of message notification */
    106 		RMS_WORD argLength;	/* Length (in DSP chars) of arg data */
    107 		RMS_WORD argData;	/* Arg data for node */
    108 	} ;
    109 
    110 /* Partial task create args structure */
    111 	struct RMS_MoreTaskArgs {
    112 		RMS_WORD priority;	/* Task's runtime priority level */
    113 		RMS_WORD stackSize;	/* Task's stack size */
    114 		RMS_WORD sysstackSize;	/* Task's system stack size (55x) */
    115 		RMS_WORD stackSeg;	/* Memory segment for task's stack */
    116 #if defined (OMAP_2430) || defined (OMAP_3430)
    117 		RMS_WORD heapAddr;	/* base address of the node memory heap in
    118 					 * external memory (DSP virtual address) */
    119 		RMS_WORD heapSize;	/* size in MAUs of the node memory heap in
    120 					 * external memory */
    121 #endif
    122 		RMS_WORD misc;	/* Misc field.  Not used for 'normal'
    123 				 * task nodes; for xDAIS socket nodes
    124 				 * specifies the IALG_Fxn pointer.
    125 				 */
    126 		RMS_WORD numInputStreams;	/* # input STRM definition structures */
    127 	} ;
    128 
    129 #ifdef __cplusplus
    130 }
    131 #endif
    132 #endif				/* RMS_SH_ */
    133 
    134