File: libspe2.ads

package info (click to toggle)
libspe2 2.2.80-95-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 940 kB
  • ctags: 1,214
  • sloc: ansic: 9,316; makefile: 551; ada: 448; sh: 24
file content (345 lines) | stat: -rw-r--r-- 8,340 bytes parent folder | download
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
-----------------------------------------------------------
-- 
-- libspe2 API functions
-- 
-----------------------------------------------------------
with System;
with Interfaces.C;
with libspe2_types;

package libspe2 is
  use System;
  use Interfaces.C;
  use libspe2_types;

--
-- link with libspe2
--
  pragma Linker_Options("-lspe2");

--
-- spe_context_create
--
  function spe_context_create
    (flags	: unsigned;
     gang	: spe_gang_context_ptr_t) 
  return spe_context_ptr_t;
  pragma Import (C, spe_context_create, "spe_context_create");

--
-- spe_context_create_affinity
--
  function spe_context_create_affinity
    (flags		: unsigned;
     affinity_neighbor	: spe_context_ptr_t;
     gang		: spe_gang_context_ptr_t) 
  return spe_context_ptr_t;
  pragma Import (C, spe_context_create_affinity, "spe_context_create_affinity");

--
-- spe_context_destroy
--
  function spe_context_destroy
    (spe  : spe_context_ptr_t)
  return Integer;
  pragma Import (C, spe_context_destroy, "spe_context_destroy");

--
-- spe_gang_context_create
--
  function spe_gang_context_create
    (flags	: unsigned)
  return spe_gang_context_ptr_t;
  pragma Import (C, spe_gang_context_create, "spe_gang_context_create");

--
-- spe_gang_context_destroy
--
  function spe_gang_context_destroy
    (gang  : spe_gang_context_ptr_t)
  return Integer;
  pragma Import (C, spe_gang_context_destroy, "spe_gang_context_destroy");

--
-- spe_image_open
--
  function spe_image_open
    (filename  : char_array)
    return spe_program_handle_t;
  pragma Import (C, spe_image_open, "spe_image_open");

--
-- spe_image_close
--
  function spe_image_close
    (program  : spe_program_handle_t)
    return Integer;
  pragma Import (C, spe_image_close, "spe_image_close");

--
-- spe_program_load
--
  function spe_program_load
    (spe        : spe_context_ptr_t;
     program    : spe_program_handle_t)
  return Integer;
  pragma Import (C, spe_program_load, "spe_program_load");

--
-- spe_context_run
--
  function spe_context_run
    (spe                : spe_context_ptr_t;
     spe_entry_ptr     	: access unsigned;
     run_flags          : unsigned;
     argp               : addr_ptr;
     envp               : addr_ptr;
     stop_info		: spe_stop_info_ptr)
  return Integer;
  pragma Import (C, spe_context_run, "spe_context_run");

--
-- spe_stop_info_read
--
  function spe_stop_info_read
    (spe      	  : spe_context_ptr_t;
     stop_info    : spe_stop_info_ptr)
  return Integer;
  pragma Import (C, spe_stop_info_read, "spe_stop_info_read");

--
-- spe_event_handler_create
--
  function spe_event_handler_create 
  return spe_event_handler_ptr_t;
  pragma Import (C, spe_event_handler_create, "spe_event_handler_create");

--
-- spe_event_handler_destroy
--
  function spe_event_handler_destroy 
    (evhandler	:spe_event_handler_ptr_t)
  return Integer;
  pragma Import (C, spe_event_handler_destroy, "spe_event_handler_destroy");

--
-- spe_event_handler_register
--
  function spe_event_handler_register 
    (evhandler	: spe_event_handler_ptr_t;
     event	: spe_event_unit_t_ptr)
  return Integer;
  pragma Import (C, spe_event_handler_register, "spe_event_handler_register");

--
-- spe_event_handler_deregister
--
  function spe_event_handler_deregister 
    (evhandler	: spe_event_handler_ptr_t;
     event	: spe_event_unit_t_ptr)
  return Integer;
  pragma Import (C, spe_event_handler_deregister, "spe_event_handler_deregister");

--
-- spe_event_wait
--
  function spe_event_wait 
    (evhandler	: spe_event_handler_ptr_t;
     events	: addr_ptr;
     max_events	: Integer;
     timeout	: Integer)
  return Integer;
  pragma Import (C, spe_event_wait, "spe_event_wait");

--
-- MFCIO Proxy Commands
--
  function spe_mfcio_put
    (spe  	: spe_context_ptr_t;
     ls		: unsigned;
     ea 	: addr_ptr;
     size	: unsigned;
     tag	: unsigned;
     tid	: unsigned;
     rid	: unsigned)
  return Integer;
  pragma Import (C, spe_mfcio_put, "spe_mfcio_put");

  function spe_mfcio_putb
    (spe  	: spe_context_ptr_t;
     ls		: unsigned;
     ea 	: addr_ptr;
     size	: unsigned;
     tag	: unsigned;
     tid	: unsigned;
     rid	: unsigned)
  return Integer;
  pragma Import (C, spe_mfcio_putb, "spe_mfcio_putb");

  function spe_mfcio_putf
    (spe  	: spe_context_ptr_t;
     ls		: unsigned;
     ea 	: addr_ptr;
     size	: unsigned;
     tag	: unsigned;
     tid	: unsigned;
     rid	: unsigned)
  return Integer;
  pragma Import (C, spe_mfcio_putf, "spe_mfcio_putf");

  function spe_mfcio_get
    (spe  	: spe_context_ptr_t;
     ls		: unsigned;
     ea 	: addr_ptr;
     size	: unsigned;
     tag	: unsigned;
     tid	: unsigned;
     rid	: unsigned)
  return Integer;
  pragma Import (C, spe_mfcio_get, "spe_mfcio_get");

  function spe_mfcio_getb
    (spe  	: spe_context_ptr_t;
     ls		: unsigned;
     ea 	: addr_ptr;
     size	: unsigned;
     tag	: unsigned;
     tid	: unsigned;
     rid	: unsigned)
  return Integer;
  pragma Import (C, spe_mfcio_getb, "spe_mfcio_getb");

  function spe_mfcio_getf
    (spe  	: spe_context_ptr_t;
     ls		: unsigned;
     ea 	: addr_ptr;
     size	: unsigned;
     tag	: unsigned;
     tid	: unsigned;
     rid	: unsigned)
  return Integer;
  pragma Import (C, spe_mfcio_getf, "spe_mfcio_getf");

--
-- MFCIO Tag Group Completion
--
  function spe_mfcio_tag_status_read
    (spe  		: spe_context_ptr_t;
     mask		: unsigned;
     behavior		: unsigned;
     tag_status_ptr	: unsigned_ptr)
  return Integer;
  pragma Import (C, spe_mfcio_tag_status_read, "spe_mfcio_tag_status_read");

--
-- SPE Mailbox Facility
--
  function spe_out_mbox_read
    (spe  		: spe_context_ptr_t;
     mbox_data_ptr	: unsigned_ptr;
     count		: Integer)
  return Integer;
  pragma Import (C, spe_out_mbox_read, "spe_out_mbox_read");

  function spe_out_mbox_status
    (spe  		: spe_context_ptr_t)
  return Integer;
  pragma Import (C, spe_out_mbox_status, "spe_out_mbox_status");

  function spe_in_mbox_write
    (spe  		: spe_context_ptr_t;
     mbox_data_ptr	: unsigned_ptr;
     count		: Integer;
     behavior		: unsigned)
  return Integer;
  pragma Import (C, spe_in_mbox_write, "spe_in_mbox_write");

  function spe_in_mbox_status
    (spe  		: spe_context_ptr_t)
  return Integer;
  pragma Import (C, spe_in_mbox_status, "spe_in_mbox_status");

  function spe_out_intr_mbox_read
    (spe  		: spe_context_ptr_t;
     mbox_data_ptr	: unsigned_ptr;
     count		: Integer;
     behavior		: unsigned)
  return Integer;
  pragma Import (C, spe_out_intr_mbox_read, "spe_out_intr_mbox_read");

  function spe_out_intr_mbox_status
    (spe  		: spe_context_ptr_t)
  return Integer;
  pragma Import (C, spe_out_intr_mbox_status, "spe_out_intr_mbox_status");

--
-- SPU SIgnal Notification Facility
--
  function spe_signal_write
    (spe  		: spe_context_ptr_t;
     signal_reg		: unsigned;
     data		: unsigned)
  return Integer;
  pragma Import (C, spe_signal_write, "spe_signal_write");

--
-- spe_ls_area_get
--
  function spe_ls_area_get
    (spe  		: spe_context_ptr_t)
  return addr_ptr;
  pragma Import (C, spe_ls_area_get, "spe_ls_area_get");

--
-- spe_ls_size_get
--
  function spe_ls_size_get
    (spe  		: spe_context_ptr_t)
  return Integer;
  pragma Import (C, spe_ls_size_get, "spe_ls_size_get");

--
-- spe_ps_area_get
--
  function spe_ps_area_get
    (spe  		: spe_context_ptr_t;
     area		: ps_area)
  return addr_ptr;
  pragma Import (C, spe_ps_area_get, "spe_ps_area_get");

--
-- spe_callback_handler_register
--
  function spe_callback_handler_register
    (handler  		: addr_ptr;
     callnum		: unsigned;
     mode		: unsigned)
  return Integer;
  pragma Import (C, spe_callback_handler_register, "spe_callback_handler_register");

--
-- spe_callback_handler_deregister
--
  function spe_callback_handler_deregister
    (callnum		: unsigned)
  return Integer;
  pragma Import (C, spe_callback_handler_deregister, "spe_callback_handler_deregister");

--
-- spe_callback_handler_query
--
  function spe_callback_handler_query
    (callnum		: unsigned)
  return spe_event_handler_ptr_t;
  pragma Import (C, spe_callback_handler_query, "spe_callback_handler_query");

--
-- spe_cpu_info_get
--
  function spe_cpu_info_get
    (info_requested	: Integer;
     cpu_node		: Integer)
  return Integer;
  pragma Import (C, spe_cpu_info_get, "spe_cpu_info_get");

end libspe2;