1/*
2 * rms_sh.h
3 *
4 * DSP-BIOS Bridge driver support functions for TI OMAP processors.
5 *
6 * DSP/BIOS Bridge Resource Manager Server shared definitions (used on both
7 * GPP and DSP sides).
8 *
9 * Copyright (C) 2008 Texas Instruments, Inc.
10 *
11 * This package is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 *
15 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18 */
19
20#ifndef RMS_SH_
21#define RMS_SH_
22
23#include <dspbridge/rmstypes.h>
24
25/* Memory Types: */
26#define RMS_CODE                0	/* Program space */
27#define RMS_DATA                1	/* Data space */
28
29/* RM Server Command and Response Buffer Sizes: */
30#define RMS_COMMANDBUFSIZE     256	/* Size of command buffer */
31
32/* Pre-Defined Command/Response Codes: */
33#define RMS_EXIT                0x80000000	/* GPP->Node: shutdown */
34#define RMS_EXITACK             0x40000000	/* Node->GPP: ack shutdown */
35#define RMS_BUFDESC             0x20000000	/* Arg1 SM buf, Arg2 SM size */
36#define RMS_KILLTASK            0x10000000	/* GPP->Node: Kill Task */
37
38/* RM Server RPC Command Structure: */
39struct rms_command {
40	rms_word fxn;		/* Server function address */
41	rms_word arg1;		/* First argument */
42	rms_word arg2;		/* Second argument */
43	rms_word data;		/* Function-specific data array */
44};
45
46/*
47 *  The rms_strm_def structure defines the parameters for both input and output
48 *  streams, and is passed to a node's create function.
49 */
50struct rms_strm_def {
51	rms_word bufsize;	/* Buffer size (in DSP words) */
52	rms_word nbufs;		/* Max number of bufs in stream */
53	rms_word segid;		/* Segment to allocate buffers */
54	rms_word align;		/* Alignment for allocated buffers */
55	rms_word timeout;	/* Timeout (msec) for blocking calls */
56	char name[1];	/* Device Name (terminated by '\0') */
57};
58
59/* Message node create args structure: */
60struct rms_msg_args {
61	rms_word max_msgs;	/* Max # simultaneous msgs to node */
62	rms_word segid;		/* Mem segment for NODE_allocMsgBuf */
63	rms_word notify_type;	/* Type of message notification */
64	rms_word arg_length;	/* Length (in DSP chars) of arg data */
65	rms_word arg_data;	/* Arg data for node */
66};
67
68/* Partial task create args structure */
69struct rms_more_task_args {
70	rms_word priority;	/* Task's runtime priority level */
71	rms_word stack_size;	/* Task's stack size */
72	rms_word sysstack_size;	/* Task's system stack size (55x) */
73	rms_word stack_seg;	/* Memory segment for task's stack */
74	rms_word heap_addr;	/* base address of the node memory heap in
75				 * external memory (DSP virtual address) */
76	rms_word heap_size;	/* size in MAUs of the node memory heap in
77				 * external memory */
78	rms_word misc;		/* Misc field.  Not used for 'normal'
79				 * task nodes; for xDAIS socket nodes
80				 * specifies the IALG_Fxn pointer.
81				 */
82	/* # input STRM definition structures */
83	rms_word num_input_streams;
84};
85
86#endif /* RMS_SH_ */
87