annotate TaskManager/kernel/ppe/Threads.h @ 895:bed529c55eda

add alignment of classes in SPU width and height are automatically set in frame buffer API
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 16 Jul 2010 17:23:49 +0900
parents 3468641f22d7
children 586b4f825f24
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
817
4e8fc627ed33 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 #ifndef INCLUDED_THREADS
4e8fc627ed33 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 #define INCLUDED_THREADS
4e8fc627ed33 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
4e8fc627ed33 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 #include <pthread.h>
895
bed529c55eda add alignment of classes in SPU
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 824
diff changeset
5 #include <base.h>
817
4e8fc627ed33 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
4e8fc627ed33 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7
4e8fc627ed33 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 class Threads {
4e8fc627ed33 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 public:
895
bed529c55eda add alignment of classes in SPU
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 824
diff changeset
10 BASE_NEW_DELETE(Threads);
bed529c55eda add alignment of classes in SPU
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 824
diff changeset
11
817
4e8fc627ed33 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 /* constructor */
824
3468641f22d7 Thread.h fix?
yutaka@localhost.localdomain
parents: 818
diff changeset
13 Threads(int num = 1) {};
3468641f22d7 Thread.h fix?
yutaka@localhost.localdomain
parents: 818
diff changeset
14 virtual ~Threads() {};
817
4e8fc627ed33 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15
4e8fc627ed33 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 /* functions */
4e8fc627ed33 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 virtual void init() = 0;
4e8fc627ed33 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 virtual int get_mail(int speid, int count, memaddr *ret) = 0; // BLOCKING
4e8fc627ed33 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 virtual int has_mail(int speid, int count, memaddr *ret) = 0; // NONBLOCK
4e8fc627ed33 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 virtual void send_mail(int speid, int num, memaddr *data) = 0; // BLOCKING
4e8fc627ed33 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21
4e8fc627ed33 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 /* variables */
4e8fc627ed33 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 pthread_t *threads;
4e8fc627ed33 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 int cpu_num;
895
bed529c55eda add alignment of classes in SPU
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 824
diff changeset
25 } __attribute__ ((aligned (DEFAULT_ALIGNMENT)));
817
4e8fc627ed33 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26
4e8fc627ed33 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 #endif