Mercurial > hg > Game > Cerium
annotate TaskManager/kernel/ppe/Threads.h @ 1499:622a7d053537 draft
cpu id etc
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 22 Aug 2012 17:42:33 +0900 |
parents | bd4a27ae2524 |
children | e8c9a7099bcc |
rev | line source |
---|---|
817 | 1 #ifndef INCLUDED_THREADS |
2 #define INCLUDED_THREADS | |
3 | |
4 #include <pthread.h> | |
1179 | 5 #include "base.h" |
6 #include "types.h" | |
817 | 7 |
8 | |
9 class Threads { | |
10 public: | |
895
b662e9dd26b0
add alignment of classes in SPU
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
824
diff
changeset
|
11 BASE_NEW_DELETE(Threads); |
b662e9dd26b0
add alignment of classes in SPU
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
824
diff
changeset
|
12 |
817 | 13 /* constructor */ |
824 | 14 Threads(int num = 1) {}; |
15 virtual ~Threads() {}; | |
817 | 16 |
17 /* functions */ | |
1191
bd4a27ae2524
success run to ballbound
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents:
1185
diff
changeset
|
18 virtual void init() = 0; |
817 | 19 virtual int get_mail(int speid, int count, memaddr *ret) = 0; // BLOCKING |
20 virtual int has_mail(int speid, int count, memaddr *ret) = 0; // NONBLOCK | |
21 virtual void send_mail(int speid, int num, memaddr *data) = 0; // BLOCKING | |
1499 | 22 virtual void add_output_tasklist(int command, memaddr buff, int alloc_size) = 0; |
23 virtual int is_gpu(int cpuid) { return 0; } | |
817 | 24 |
25 /* variables */ | |
26 pthread_t *threads; | |
27 int cpu_num; | |
899 | 28 } ; |
817 | 29 |
30 #endif |