Mercurial > hg > Members > kono > Cerium
annotate TaskManager/kernel/schedule/SchedTask.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 | 29094b48d966 |
children | 586b4f825f24 |
rev | line source |
---|---|
42 | 1 #ifndef INCLUDED_SCHED_TASK |
2 #define INCLUDED_SCHED_TASK | |
3 | |
308 | 4 #include "base.h" |
5 #include "Scheduler.h" | |
6 #include "SchedTaskBase.h" | |
7 #include "ListData.h" | |
619 | 8 #include "HTask.h" |
373 | 9 #include "MemList.h" |
109 | 10 |
634 | 11 |
308 | 12 class SchedTask : public SchedTaskBase { |
13 public: | |
109 | 14 /* constructor */ |
308 | 15 SchedTask(); |
16 virtual ~SchedTask(); | |
88 | 17 |
109 | 18 BASE_NEW_DELETE(SchedTask); |
42 | 19 |
308 | 20 /* variables */ |
708 | 21 |
308 | 22 /* functions */ |
23 | |
24 // override | |
25 void read(); | |
26 void exec(); | |
27 void write(); | |
28 SchedTaskBase* next(Scheduler *, SchedTaskBase *); | |
29 | |
464
01b321c86747
task run is mere C function now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
463
diff
changeset
|
30 // タスクの処理は、task_list に登録された C の関数によっておこなう |
308 | 31 |
32 public: | |
33 /* functions */ | |
34 | |
683 | 35 void init(TaskListPtr _list, SimpleTaskPtr _task, int index, |
36 Scheduler* sc); | |
308 | 37 |
38 //--- User API --- | |
634 | 39 int read_size() { return task->r_size; } |
40 int write_size() { return task->w_size; } | |
41 void set_write_size(int w) { task->w_size = w; } | |
713
f725c6455d19
remove SIMPLE_TASK conditional
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
708
diff
changeset
|
42 |
798 | 43 void* get_input(void *buff, int index); |
44 void* get_output(void *buff, int index); | |
45 memaddr get_param(int index); | |
625
60aa3f241b10
64bit mode worked on Mac OS X.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
619
diff
changeset
|
46 memaddr get_inputAddr(int index); |
60aa3f241b10
64bit mode worked on Mac OS X.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
619
diff
changeset
|
47 memaddr get_outputAddr(int index); |
506 | 48 // 書き出しを追加する API がない... |
308 | 49 int get_inputSize(int index); |
50 int get_outputSize(int index); | |
641
0692b08f1cd6
Regression on Mac OS X
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
635
diff
changeset
|
51 |
0692b08f1cd6
Regression on Mac OS X
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
635
diff
changeset
|
52 int get_cpuid(); |
308 | 53 |
54 void* global_alloc(int id, int size); | |
55 void* global_get(int id); | |
373 | 56 void global_set(int id, void *addr); |
308 | 57 void global_free(int id); |
373 | 58 MemList* createMemList(int size, int count); |
308 | 59 |
60 void mainMem_alloc(int id, int size); | |
61 void mainMem_wait(); | |
629
8843edf37c0e
Cell 64 bit tried, but not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
625
diff
changeset
|
62 memaddr mainMem_get(int id); |
308 | 63 |
387
5e2d30bfbf23
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
64 MemorySegment * get_segment(memaddr addr, MemList *m); |
5e2d30bfbf23
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
65 uint32 get_tag(); |
5e2d30bfbf23
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
66 void put_segment(MemorySegment *s); |
5e2d30bfbf23
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
67 void wait_segment(MemorySegment *s); |
5e2d30bfbf23
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
68 |
5e2d30bfbf23
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
69 |
5e2d30bfbf23
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
70 |
308 | 71 void *allocate(int size); |
708 | 72 void free_(void *p) ; |
308 | 73 |
832
29094b48d966
poling (may recurse..)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
806
diff
changeset
|
74 void polling(); |
29094b48d966
poling (may recurse..)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
806
diff
changeset
|
75 |
506 | 76 /* これは禁止するべき */ |
625
60aa3f241b10
64bit mode worked on Mac OS X.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
619
diff
changeset
|
77 void dma_load(void *buf, memaddr addr, uint32 size, uint32 mask); |
60aa3f241b10
64bit mode worked on Mac OS X.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
619
diff
changeset
|
78 void dma_store(void *buf,memaddr addr, uint32 size, uint32 mask); |
308 | 79 void dma_wait(uint32 mask); |
674
bde5f13adf10
fix many task example (sort).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
672
diff
changeset
|
80 |
334
20f2459041cb
[in test_render] push L key , call show_dma_wait, but incomplete.
e065746@localhost.localdomain
parents:
316
diff
changeset
|
81 void show_dma_wait(); |
672 | 82 void start_profile(); |
373 | 83 |
674
bde5f13adf10
fix many task example (sort).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
672
diff
changeset
|
84 |
310 | 85 /*! |
86 SPU用の get_input, get_output | |
87 */ | |
88 void* get_input(int index) { | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
467
diff
changeset
|
89 return get_input(readbuf, index); |
310 | 90 } |
373 | 91 |
310 | 92 void* get_output(int index) { |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
467
diff
changeset
|
93 return get_output(writebuf, index); |
373 | 94 } |
466
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
95 |
619 | 96 // user |
97 HTaskPtr create_task(int cmd); | |
634 | 98 HTaskPtr create_task(int cmd, memaddr r, long rs, memaddr w, long ws); |
806 | 99 HTaskPtr create_task_array(int id, int num_task, int num_param, int num_inData, int num_outData); |
634 | 100 |
619 | 101 void set_task_depend(HTaskPtr master, HTaskPtr slave); |
102 void spawn_task(HTaskPtr); | |
103 void set_task_cpu(HTaskPtr, CPU_TYPE); | |
104 void* allocate(int size,int align); | |
105 Scheduler* get_scheduler(); | |
674
bde5f13adf10
fix many task example (sort).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
672
diff
changeset
|
106 long get_random(); |
619 | 107 |
466
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
108 int printf(const char * format, ...); |
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
109 |
895
bed529c55eda
add alignment of classes in SPU
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
832
diff
changeset
|
110 } __attribute__ ((aligned (DEFAULT_ALIGNMENT))); |
109 | 111 |
308 | 112 |
695 | 113 extern void loadSchedTask(Scheduler *scheduler,TaskPtr task); |
302 | 114 |
115 #endif | |
308 | 116 |