libspe2  0.9a
libspe2.h
Go to the documentation of this file.
1 /*
2  * SPE Runtime Management Library, Version 2.0
3  * This library constitutes the standardized low-level application
4  * programming interface for application access to the Cell Broadband
5  * Engineís Synergistic Processing Elements (SPEs).
6  *
7  * The usage of this library requires that the application programmer
8  * is familiar with the CBE architecture as described in ìCell
9  * Broadband Engine Architecture, Version 1.0î.
10  *
11  * Copyright (C) 2006 IBM Corp.
12  *
13  * This library is free software; you can redistribute it and/or modify it
14  * under the terms of the GNU Lesser General Public License as published by
15  * the Free Software Foundation; either version 2.1 of the License,
16  * or (at your option) any later version.
17  *
18  * This library is distributed in the hope that it will be useful, but
19  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
21  * License for more details.
22  *
23  * You should have received a copy of the GNU Lesser General Public License
24  * along with this library; if not, write to the Free Software Foundation,
25  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26  */
27  /*
28  * libspe2.h contains the public API funtions
29  */
30 
31 #ifndef libspe2_h
32 #define libspe2_h
33 
34 #ifdef __cplusplus
35 extern "C"
36 {
37 #endif
38 
39 #include <errno.h>
40 #include <stdio.h>
41 
42 /*
43  * GLOBAL SYMBOLS AND STRUCTURES
44  * libspe2-types header file
45  */
46 #include "libspe2-types.h"
47 
48 
49 /*
50  *---------------------------------------------------------
51  *
52  * API functions
53  *
54  *---------------------------------------------------------
55  */
56 
57 /*
58  * spe_context_create
59  */
61 
62 /*
63  * spe_context_create_affinity
64  */
66 
67 /*
68  * spe_context_destroy
69  */
71 
72 /*
73  * spe_gang_context_create
74  */
76 
77 /*
78  * spe_gang_context_destroy
79  */
81 
82 /*
83  * spe_image_open
84  */
85 spe_program_handle_t * spe_image_open (const char *filename);
86 
87 /*
88  * spe_image_close
89  */
91 
92 /*
93  * spe_load_program
94  */
96 
97 /*
98  * spe_context_run
99  */
100 int spe_context_run (spe_context_ptr_t spe, unsigned int *entry, unsigned int runflags, void *argp, void *envp, spe_stop_info_t *stopinfo);
101 
102 /*
103  * spe_stop_info_read
104  */
106 
107 /*
108  * spe_event_handler_create
109  */
111 
112 /*
113  * spe_event_handler_destroy
114  */
116 
117 /*
118  * spe_event_handler_register
119  */
121 
122 /*
123  * spe_event_handler_deregister
124  */
126 
127 /*
128  * spe_event_wait
129  */
130 int spe_event_wait(spe_event_handler_ptr_t evhandler, spe_event_unit_t *events, int max_events, int timeout);
131 
132 /*
133  * MFCIO Proxy Commands
134  */
135 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);
136 
137 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);
138 
139 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);
140 
141 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);
142 
143 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);
144 
145 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);
146 
147 /*
148  * MFCIO Tag Group Completion
149  */
150 int spe_mfcio_tag_status_read(spe_context_ptr_t spe, unsigned int mask, unsigned int behavior, unsigned int *tag_status);
151 
152 /*
153  * SPE Mailbox Facility
154  */
155 int spe_out_mbox_read (spe_context_ptr_t spe, unsigned int *mbox_data, int count);
156 
158 
159 int spe_in_mbox_write (spe_context_ptr_t spe, unsigned int *mbox_data, int count, unsigned int behavior);
160 
162 
163 int spe_out_intr_mbox_read (spe_context_ptr_t spe, unsigned int *mbox_data, int count, unsigned int behavior);
164 
166 
167 /*
168  * Multisource Sync Facility
169  */
171 
173 
174 /*
175  * SPU SIgnal Notification Facility
176  */
177 int spe_signal_write (spe_context_ptr_t spe, unsigned int signal_reg, unsigned int data);
178 
179 /*
180  * spe_ls_area_get
181  */
183 
184 /*
185  * spe_ls_size_get
186  */
188 
189 /*
190  * spe_ps_area_get
191  */
192 void * spe_ps_area_get (spe_context_ptr_t spe, enum ps_area area);
193 
194 /*
195  * spe_callback_handler_register
196  */
197 int spe_callback_handler_register (void *handler, unsigned int callnum, unsigned int mode);
198 
199 /*
200  * spe_callback_handler_deregister
201  */
202 int spe_callback_handler_deregister (unsigned int callnum);
203 
204 /*
205  * spe_callback_handler_query
206  */
207 void * spe_callback_handler_query(unsigned int callnum);
208 
209 /*
210  * spe_info_get
211  */
212 int spe_cpu_info_get(int info_requested, int cpu_node);
213 
214 
215 #ifdef __cplusplus
216 }
217 #endif
218 
219 
220 #endif /*libspe2_h*/