1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
/*
* disp.h
*
* DSP-BIOS Bridge driver support functions for TI OMAP processors.
*
* DSP/BIOS Bridge Node Dispatcher.
*
* Copyright (C) 2005-2006 Texas Instruments, Inc.
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef DISP_
#define DISP_
#include <dspbridge/dbdefs.h>
#include <dspbridge/nodedefs.h>
#include <dspbridge/nodepriv.h>
#include <dspbridge/dispdefs.h>
/*
* ======== disp_create ========
* Create a NODE Dispatcher object. This object handles the creation,
* deletion, and execution of nodes on the DSP target, through communication
* with the Resource Manager Server running on the target. Each NODE
* Manager object should have exactly one NODE Dispatcher.
*
* Parameters:
* dispatch_obj: Location to store node dispatcher object on output.
* hdev_obj: Device for this processor.
* disp_attrs: Node dispatcher attributes.
* Returns:
* 0: Success;
* -ENOMEM: Insufficient memory for requested resources.
* -EPERM: Unable to create dispatcher.
* Requires:
* disp_init(void) called.
* disp_attrs != NULL.
* hdev_obj != NULL.
* dispatch_obj != NULL.
* Ensures:
* 0: IS_VALID(*dispatch_obj).
* error: *dispatch_obj == NULL.
*/
extern int disp_create(OUT struct disp_object **dispatch_obj,
struct dev_object *hdev_obj,
IN CONST struct disp_attr *disp_attrs);
/*
* ======== disp_delete ========
* Delete the NODE Dispatcher.
*
* Parameters:
* disp_obj: Node Dispatcher object.
* Returns:
* Requires:
* disp_init(void) called.
* Valid disp_obj.
* Ensures:
* disp_obj is invalid.
*/
extern void disp_delete(struct disp_object *disp_obj);
/*
* ======== disp_exit ========
* Discontinue usage of DISP module.
*
* Parameters:
* Returns:
* Requires:
* disp_init(void) previously called.
* Ensures:
* Any resources acquired in disp_init(void) will be freed when last DISP
* client calls disp_exit(void).
*/
extern void disp_exit(void);
/*
* ======== disp_init ========
* Initialize the DISP module.
*
* Parameters:
* Returns:
* TRUE if initialization succeeded, FALSE otherwise.
* Ensures:
*/
extern bool disp_init(void);
/*
* ======== disp_node_change_priority ========
* Change the priority of a node currently running on the target.
*
* Parameters:
* disp_obj: Node Dispatcher object.
* hnode: Node object representing a node currently
* allocated or running on the DSP.
* ulFxnAddress: Address of RMS function for changing priority.
* node_env: Address of node's environment structure.
* prio: New priority level to set node's priority to.
* Returns:
* 0: Success.
* -ETIME: A timeout occurred before the DSP responded.
* Requires:
* disp_init(void) called.
* Valid disp_obj.
* hnode != NULL.
* Ensures:
*/
extern int disp_node_change_priority(struct disp_object
*disp_obj,
struct node_object *hnode,
u32 rms_fxn,
nodeenv node_env, s32 prio);
/*
* ======== disp_node_create ========
* Create a node on the DSP by remotely calling the node's create function.
*
* Parameters:
* disp_obj: Node Dispatcher object.
* hnode: Node handle obtained from node_allocate().
* ul_fxn_addr: Address or RMS create node function.
* ul_create_fxn: Address of node's create function.
* pargs: Arguments to pass to RMS node create function.
* node_env: Location to store node environment pointer on
* output.
* Returns:
* 0: Success.
* -ETIME: A timeout occurred before the DSP responded.
* -EPERM: A failure occurred, unable to create node.
* Requires:
* disp_init(void) called.
* Valid disp_obj.
* pargs != NULL.
* hnode != NULL.
* node_env != NULL.
* node_get_type(hnode) != NODE_DEVICE.
* Ensures:
*/
extern int disp_node_create(struct disp_object *disp_obj,
struct node_object *hnode,
u32 rms_fxn,
u32 ul_create_fxn,
IN CONST struct node_createargs
*pargs, OUT nodeenv *node_env);
/*
* ======== disp_node_delete ========
* Delete a node on the DSP by remotely calling the node's delete function.
*
* Parameters:
* disp_obj: Node Dispatcher object.
* hnode: Node object representing a node currently
* loaded on the DSP.
* ul_fxn_addr: Address or RMS delete node function.
* ul_delete_fxn: Address of node's delete function.
* node_env: Address of node's environment structure.
* Returns:
* 0: Success.
* -ETIME: A timeout occurred before the DSP responded.
* Requires:
* disp_init(void) called.
* Valid disp_obj.
* hnode != NULL.
* Ensures:
*/
extern int disp_node_delete(struct disp_object *disp_obj,
struct node_object *hnode,
u32 rms_fxn,
u32 ul_delete_fxn, nodeenv node_env);
/*
* ======== disp_node_run ========
* Start execution of a node's execute phase, or resume execution of a node
* that has been suspended (via DISP_NodePause()) on the DSP.
*
* Parameters:
* disp_obj: Node Dispatcher object.
* hnode: Node object representing a node to be executed
* on the DSP.
* ul_fxn_addr: Address or RMS node execute function.
* ul_execute_fxn: Address of node's execute function.
* node_env: Address of node's environment structure.
* Returns:
* 0: Success.
* -ETIME: A timeout occurred before the DSP responded.
* Requires:
* disp_init(void) called.
* Valid disp_obj.
* hnode != NULL.
* Ensures:
*/
extern int disp_node_run(struct disp_object *disp_obj,
struct node_object *hnode,
u32 rms_fxn,
u32 ul_execute_fxn, nodeenv node_env);
#endif /* DISP_ */
|