65
|
1 #ifndef INCLUDED_SPE_THREADS
|
|
2 #define INCLUDED_SPE_THREADS
|
|
3
|
|
4 #include <libspe2.h>
|
|
5 #include <pthread.h>
|
|
6
|
|
7 #define SPE_ELF "spe-main"
|
|
8
|
|
9 typedef struct arg {
|
|
10 int speid;
|
|
11 spe_context_ptr_t ctx;
|
|
12 } thread_arg_t;
|
|
13
|
|
14 class SpeThreads {
|
|
15 public:
|
|
16 /* constructor */
|
|
17 SpeThreads(int num = 1);
|
76
|
18 ~SpeThreads(void);
|
65
|
19
|
|
20 /* functions */
|
|
21 void init(void);
|
|
22 int get_mail(int speid);
|
109
|
23 void send_mail(int speid, unsigned int *data, int num);
|
65
|
24 static void *spe_thread_run(void *arg);
|
|
25 static void *frontend_thread_run(void *arg);
|
|
26
|
|
27 private:
|
|
28 /* variables */
|
|
29 spe_program_handle_t *spe_handle;
|
|
30 spe_context_ptr_t *spe_ctx;
|
|
31 pthread_t *threads;
|
|
32 thread_arg_t *args;
|
|
33 int spe_num;
|
|
34 };
|
|
35
|
|
36 #endif
|