-
Notifications
You must be signed in to change notification settings - Fork 4
/
libspe2.h
220 lines (172 loc) · 5.74 KB
/
libspe2.h
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
/*
* SPE Runtime Management Library, Version 2.0
* This library constitutes the standardized low-level application
* programming interface for application access to the Cell Broadband
* Engineís Synergistic Processing Elements (SPEs).
*
* The usage of this library requires that the application programmer
* is familiar with the CBE architecture as described in ìCell
* Broadband Engine Architecture, Version 1.0î.
*
* Copyright (C) 2006 IBM Corp.
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License,
* or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
* libspe2.h contains the public API funtions
*/
#ifndef libspe2_h
#define libspe2_h
#ifdef __cplusplus
extern "C"
{
#endif
#include <errno.h>
#include <stdio.h>
/*
* GLOBAL SYMBOLS AND STRUCTURES
* libspe2-types header file
*/
#include "libspe2-types.h"
/*
*---------------------------------------------------------
*
* API functions
*
*---------------------------------------------------------
*/
/*
* spe_context_create
*/
spe_context_ptr_t spe_context_create(unsigned int flags, spe_gang_context_ptr_t gang);
/*
* spe_context_create_affinity
*/
spe_context_ptr_t spe_context_create_affinity(unsigned int flags, spe_context_ptr_t affinity_neighbor, spe_gang_context_ptr_t gang);
/*
* spe_context_destroy
*/
int spe_context_destroy (spe_context_ptr_t spe);
/*
* spe_gang_context_create
*/
spe_gang_context_ptr_t spe_gang_context_create (unsigned int flags);
/*
* spe_gang_context_destroy
*/
int spe_gang_context_destroy (spe_gang_context_ptr_t gang);
/*
* spe_image_open
*/
spe_program_handle_t * spe_image_open (const char *filename);
/*
* spe_image_close
*/
int spe_image_close (spe_program_handle_t *program);
/*
* spe_load_program
*/
int spe_program_load (spe_context_ptr_t spe, spe_program_handle_t *program);
/*
* spe_context_run
*/
int spe_context_run (spe_context_ptr_t spe, unsigned int *entry, unsigned int runflags, void *argp, void *envp, spe_stop_info_t *stopinfo);
/*
* spe_stop_info_read
*/
int spe_stop_info_read (spe_context_ptr_t spe, spe_stop_info_t *stopinfo);
/*
* spe_event_handler_create
*/
spe_event_handler_ptr_t spe_event_handler_create(void);
/*
* spe_event_handler_destroy
*/
int spe_event_handler_destroy (spe_event_handler_ptr_t evhandler);
/*
* spe_event_handler_register
*/
int spe_event_handler_register(spe_event_handler_ptr_t evhandler, spe_event_unit_t *event);
/*
* spe_event_handler_deregister
*/
int spe_event_handler_deregister(spe_event_handler_ptr_t evhandler, spe_event_unit_t *event);
/*
* spe_event_wait
*/
int spe_event_wait(spe_event_handler_ptr_t evhandler, spe_event_unit_t *events, int max_events, int timeout);
/*
* MFCIO Proxy Commands
*/
int spe_mfcio_put (spe_context_ptr_t spe, unsigned int ls, void *ea, unsigned int size, unsigned int tag, unsigned int tid, unsigned int rid);
int spe_mfcio_putb (spe_context_ptr_t spe, unsigned int ls, void *ea, unsigned int size, unsigned int tag, unsigned int tid, unsigned int rid);
int spe_mfcio_putf (spe_context_ptr_t spe, unsigned int ls, void *ea, unsigned int size, unsigned int tag, unsigned int tid, unsigned int rid);
int spe_mfcio_get (spe_context_ptr_t spe, unsigned int ls, void *ea, unsigned int size, unsigned int tag, unsigned int tid, unsigned int rid);
int spe_mfcio_getb (spe_context_ptr_t spe, unsigned int ls, void *ea, unsigned int size, unsigned int tag, unsigned int tid, unsigned int rid);
int spe_mfcio_getf (spe_context_ptr_t spe, unsigned int ls, void *ea, unsigned int size, unsigned int tag, unsigned int tid, unsigned int rid);
/*
* MFCIO Tag Group Completion
*/
int spe_mfcio_tag_status_read(spe_context_ptr_t spe, unsigned int mask, unsigned int behavior, unsigned int *tag_status);
/*
* SPE Mailbox Facility
*/
int spe_out_mbox_read (spe_context_ptr_t spe, unsigned int *mbox_data, int count);
int spe_out_mbox_status (spe_context_ptr_t spe);
int spe_in_mbox_write (spe_context_ptr_t spe, unsigned int *mbox_data, int count, unsigned int behavior);
int spe_in_mbox_status (spe_context_ptr_t spe);
int spe_out_intr_mbox_read (spe_context_ptr_t spe, unsigned int *mbox_data, int count, unsigned int behavior);
int spe_out_intr_mbox_status (spe_context_ptr_t spe);
/*
* Multisource Sync Facility
*/
int spe_mssync_start(spe_context_ptr_t spe);
int spe_mssync_status(spe_context_ptr_t spe);
/*
* SPU SIgnal Notification Facility
*/
int spe_signal_write (spe_context_ptr_t spe, unsigned int signal_reg, unsigned int data);
/*
* spe_ls_area_get
*/
void * spe_ls_area_get (spe_context_ptr_t spe);
/*
* spe_ls_size_get
*/
int spe_ls_size_get (spe_context_ptr_t spe);
/*
* spe_ps_area_get
*/
void * spe_ps_area_get (spe_context_ptr_t spe, enum ps_area area);
/*
* spe_callback_handler_register
*/
int spe_callback_handler_register (void *handler, unsigned int callnum, unsigned int mode);
/*
* spe_callback_handler_deregister
*/
int spe_callback_handler_deregister (unsigned int callnum);
/*
* spe_callback_handler_query
*/
void * spe_callback_handler_query(unsigned int callnum);
/*
* spe_info_get
*/
int spe_cpu_info_get(int info_requested, int cpu_node);
#ifdef __cplusplus
}
#endif
#endif /*libspe2_h*/