00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef libspe2_h
00032 #define libspe2_h
00033
00034 #ifdef __cplusplus
00035 extern "C"
00036 {
00037 #endif
00038
00039 #include <errno.h>
00040 #include <stdio.h>
00041
00042
00043
00044
00045
00046 #include "libspe2-types.h"
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 spe_context_ptr_t spe_context_create(unsigned int flags, spe_gang_context_ptr_t gang);
00061
00062
00063
00064
00065 spe_context_ptr_t spe_context_create_affinity(unsigned int flags, spe_context_ptr_t affinity_neighbor, spe_gang_context_ptr_t gang);
00066
00067
00068
00069
00070 int spe_context_destroy (spe_context_ptr_t spe);
00071
00072
00073
00074
00075 spe_gang_context_ptr_t spe_gang_context_create (unsigned int flags);
00076
00077
00078
00079
00080 int spe_gang_context_destroy (spe_gang_context_ptr_t gang);
00081
00082
00083
00084
00085 spe_program_handle_t * spe_image_open (const char *filename);
00086
00087
00088
00089
00090 int spe_image_close (spe_program_handle_t *program);
00091
00092
00093
00094
00095 int spe_program_load (spe_context_ptr_t spe, spe_program_handle_t *program);
00096
00097
00098
00099
00100 int spe_context_run (spe_context_ptr_t spe, unsigned int *entry, unsigned int runflags, void *argp, void *envp, spe_stop_info_t *stopinfo);
00101
00102
00103
00104
00105 int spe_stop_info_read (spe_context_ptr_t spe, spe_stop_info_t *stopinfo);
00106
00107
00108
00109
00110 spe_event_handler_ptr_t spe_event_handler_create(void);
00111
00112
00113
00114
00115 int spe_event_handler_destroy (spe_event_handler_ptr_t evhandler);
00116
00117
00118
00119
00120 int spe_event_handler_register(spe_event_handler_ptr_t evhandler, spe_event_unit_t *event);
00121
00122
00123
00124
00125 int spe_event_handler_deregister(spe_event_handler_ptr_t evhandler, spe_event_unit_t *event);
00126
00127
00128
00129
00130 int spe_event_wait(spe_event_handler_ptr_t evhandler, spe_event_unit_t *events, int max_events, int timeout);
00131
00132
00133
00134
00135 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);
00136
00137 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);
00138
00139 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);
00140
00141 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);
00142
00143 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);
00144
00145 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);
00146
00147
00148
00149
00150 int spe_mfcio_tag_status_read(spe_context_ptr_t spe, unsigned int mask, unsigned int behavior, unsigned int *tag_status);
00151
00152
00153
00154
00155 int spe_out_mbox_read (spe_context_ptr_t spe, unsigned int *mbox_data, int count);
00156
00157 int spe_out_mbox_status (spe_context_ptr_t spe);
00158
00159 int spe_in_mbox_write (spe_context_ptr_t spe, unsigned int *mbox_data, int count, unsigned int behavior);
00160
00161 int spe_in_mbox_status (spe_context_ptr_t spe);
00162
00163 int spe_out_intr_mbox_read (spe_context_ptr_t spe, unsigned int *mbox_data, int count, unsigned int behavior);
00164
00165 int spe_out_intr_mbox_status (spe_context_ptr_t spe);
00166
00167
00168
00169
00170 int spe_mssync_start(spe_context_ptr_t spe);
00171
00172 int spe_mssync_status(spe_context_ptr_t spe);
00173
00174
00175
00176
00177 int spe_signal_write (spe_context_ptr_t spe, unsigned int signal_reg, unsigned int data);
00178
00179
00180
00181
00182 void * spe_ls_area_get (spe_context_ptr_t spe);
00183
00184
00185
00186
00187 int spe_ls_size_get (spe_context_ptr_t spe);
00188
00189
00190
00191
00192 void * spe_ps_area_get (spe_context_ptr_t spe, enum ps_area area);
00193
00194
00195
00196
00197 int spe_callback_handler_register (void *handler, unsigned int callnum, unsigned int mode);
00198
00199
00200
00201
00202 int spe_callback_handler_deregister (unsigned int callnum);
00203
00204
00205
00206
00207 void * spe_callback_handler_query(unsigned int callnum);
00208
00209
00210
00211
00212 int spe_cpu_info_get(int info_requested, int cpu_node);
00213
00214
00215 #ifdef __cplusplus
00216 }
00217 #endif
00218
00219
00220 #endif