Home | History | Annotate | Download | only in inc
      1 /*
      2  * dspbridge/mpu_api/inc/rms_sh.h
      3  *
      4  * DSP-BIOS Bridge driver support functions for TI OMAP processors.
      5  *
      6  * Copyright (C) 2007 Texas Instruments, Inc.
      7  *
      8  * This program is free software; you can redistribute it and/or modify it
      9  * under the terms of the GNU Lesser General Public License as published
     10  * by the Free Software Foundation version 2.1 of the License.
     11  *
     12  * This program is distributed .as is. WITHOUT ANY WARRANTY of any kind,
     13  * whether express or implied; without even the implied warranty of
     14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     15  * Lesser General Public License for more details.
     16  */
     17 
     18 
     19 /*
     20  *  ======== rms_sh.h ========
     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 		RMS_WORD heapAddr;	/* base address of the node memory heap in
    117 					 * external memory (DSP virtual address) */
    118 		RMS_WORD heapSize;	/* size in MAUs of the node memory heap in
    119 					 * external memory */
    120 		RMS_WORD misc;	/* Misc field.  Not used for 'normal'
    121 				 * task nodes; for xDAIS socket nodes
    122 				 * specifies the IALG_Fxn pointer.
    123 				 */
    124 		RMS_WORD numInputStreams;	/* # input STRM definition structures */
    125 	} ;
    126 
    127 #ifdef __cplusplus
    128 }
    129 #endif
    130 #endif				/* RMS_SH_ */
    131 
    132