annotate TaskManager/kernel/schedule/Scheduler.h @ 464:01b321c86747

task run is mere C function now.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 30 Sep 2009 10:12:26 +0900
parents b0ca9e34f7f0
children 44c0bce54dcf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
1 #ifndef INCLUDED_SCHEDULER
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
2 #define INCLUDED_SCHEDULER
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
3
301
bcb81858aa62 remove deprecated source. not work.
tkaito@localhost.localdomain
parents: 298
diff changeset
4 #include "base.h"
bcb81858aa62 remove deprecated source. not work.
tkaito@localhost.localdomain
parents: 298
diff changeset
5 #include "TaskList.h"
bcb81858aa62 remove deprecated source. not work.
tkaito@localhost.localdomain
parents: 298
diff changeset
6 #include "ListData.h"
bcb81858aa62 remove deprecated source. not work.
tkaito@localhost.localdomain
parents: 298
diff changeset
7 #include "DmaManager.h"
bcb81858aa62 remove deprecated source. not work.
tkaito@localhost.localdomain
parents: 298
diff changeset
8 #include "SchedTaskBase.h"
bcb81858aa62 remove deprecated source. not work.
tkaito@localhost.localdomain
parents: 298
diff changeset
9 #include "SchedTaskList.h"
bcb81858aa62 remove deprecated source. not work.
tkaito@localhost.localdomain
parents: 298
diff changeset
10 #include "TaskGroup.h"
373
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 366
diff changeset
11 #include "MemList.h"
387
5e2d30bfbf23 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
12 #include "MemHash.h"
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
13
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
14 #define MAX_USER_TASK 32
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
15 #define MAX_SYSTEM_TASK 2
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
16 #define MAX_TASK_OBJECT MAX_USER_TASK + MAX_SYSTEM_TASK
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
17 #define MAX_GLOBAL_AREA 32
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
18 #define MAX_MAINMEM_AREA 32
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
19
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
20 class SchedTaskBase;
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
21 class SchedTask;
184
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
22 class SchedTaskList;
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
23
464
01b321c86747 task run is mere C function now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 460
diff changeset
24 typedef int (*TaskObjectRun)(SchedTask* smanager, void* r, void *w);
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
25
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
26 class Scheduler {
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
27 public:
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
28 virtual ~Scheduler();
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
29
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
30 BASE_NEW_DELETE(Scheduler);
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
31
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
32 /* variables */
194
gongo@localhost.localdomain
parents: 187
diff changeset
33 int id;
387
5e2d30bfbf23 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
34 MemHash *hash;
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
35
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
36 // double buffering
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
37 TaskListPtr buff_taskList[2];
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
38 ListDataPtr buff_inListData[2];
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
39 ListDataPtr buff_outListData[2];
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
40
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
41 int buffFlag_taskList;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
42 int buffFlag_inListData;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
43 int buffFlag_outListData;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
44
298
58fd16298954 from EUC to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 291
diff changeset
45 /* TaskList 関連 */
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
46
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
47 /**
298
58fd16298954 from EUC to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 291
diff changeset
48 * 実行中 TaskList の現在の位置 (list->tasks[index])
373
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 366
diff changeset
49 *
298
58fd16298954 from EUC to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 291
diff changeset
50 * bakIndex_taskList がある理由
58fd16298954 from EUC to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 291
diff changeset
51 * taskList の途中で renew task が作られたとき、
58fd16298954 from EUC to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 291
diff changeset
52 * 即座に実行するため、TaskList -> RenewTaskList と移って処理する。
58fd16298954 from EUC to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 291
diff changeset
53 * RenewTaskList が終了したとき、再び TaskList に戻ってくるが
58fd16298954 from EUC to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 291
diff changeset
54 * Renew Task を生成した所から再スタートするため、
58fd16298954 from EUC to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 291
diff changeset
55 * taskList の index を覚えておく (backup)
58fd16298954 from EUC to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 291
diff changeset
56 * 同様に TaskList も覚えておく
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
57 */
184
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
58 int bakIndex_taskList;
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
59 TaskListPtr bak_curTaskList;
373
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 366
diff changeset
60
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
61
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
62 /**
298
58fd16298954 from EUC to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 291
diff changeset
63 * タスク内で生成されたタスクを入れる
58fd16298954 from EUC to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 291
diff changeset
64 * Linked List で管理
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
65 */
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
66 TaskListPtr renewCur_taskList;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
67 TaskListPtr renewTop_taskList;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
68
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
69 /**
298
58fd16298954 from EUC to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 291
diff changeset
70 * 実行中 TaskList が Renew されたものかどうかのフラグ
58fd16298954 from EUC to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 291
diff changeset
71 * Renew の場合、ListData は DMA する必要ないとか
58fd16298954 from EUC to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 291
diff changeset
72 * いろいろな判定に使えるかもしれん
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
73 * if (flag == 1) taskList is Renew
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
74 */
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
75 int flag_renewTaskList;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
76
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
77 /**
298
58fd16298954 from EUC to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 291
diff changeset
78 * タスク内 (T1) でタスク (Tc = T2, T3, ..) が複数生成された場合、
58fd16298954 from EUC to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 291
diff changeset
79 * Tc が全て終わってから、T1 の終了コマンドを PPE に送る。
58fd16298954 from EUC to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 291
diff changeset
80 * なので、Tc を process group として記憶しておく。
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
81 *
298
58fd16298954 from EUC to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 291
diff changeset
82 * Tc が taskGroup のアドレスを持つので
58fd16298954 from EUC to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 291
diff changeset
83 * Scheduler が持つ taskGroup 変数は一つだけで(多分)おk
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
84 */
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
85 TaskGroupPtr taskGroup;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
86
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
87 /* GlobalMemoryList */
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
88 void* globalList[MAX_GLOBAL_AREA];
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
89
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
90 /* MainMemory Allocate Command List */
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
91 void* mainMemList[MAX_MAINMEM_AREA];
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
92
421
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
93 /* Code Area */
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
94 MemList *code_segment_pool;
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
95
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
96 // Task Object Table
464
01b321c86747 task run is mere C function now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 460
diff changeset
97 // this is named TaskObjectRun but it is not an object.
291
3569d31705b6 document
kono@localhost.localdomain
parents: 255
diff changeset
98 // It is a pointer to an object creation function
421
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
99 // 大きいので、SPEには置かない方が本当は良い...
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
100 typedef struct {
464
01b321c86747 task run is mere C function now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 460
diff changeset
101 TaskObjectRun run;
441
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
102 memaddr location; // location address in a.out
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
103 memaddr end;
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
104 uint32 entry_offset; // offset for create();
421
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
105 MemorySegment *segment;
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
106 void (*load)(Scheduler *,int);
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
107 void (*wait)(Scheduler *,int);
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
108 } TaskObject, *TaskObjectPtr;
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
109
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
110 DmaManager* connector;
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
111
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
112 // Pipeline Stage
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
113 SchedTaskBase* task1;
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
114 SchedTaskBase* task2;
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
115 SchedTaskBase* task3;
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
116
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
117 /* functions */
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
118 void init();
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
119 void run();
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
120 virtual void init_impl() {};
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
121 void finish();
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
122
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
123 TaskListPtr get_curListBuf();
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
124 ListDataPtr get_curReadBuf();
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
125 ListDataPtr get_curWriteBuf();
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
126 TaskListPtr get_renewListBuf();
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
127
187
gongo@localhost.localdomain
parents: 184
diff changeset
128 void set_backupTaskList(TaskListPtr cur_taskList);
gongo@localhost.localdomain
parents: 184
diff changeset
129 void set_backupTaskListIndex(int cur_index);
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
130 SchedTaskList* get_nextRenewTaskList();
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
131 TaskListPtr get_backupTaskList();
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
132 int get_backupTaskListIndex();
184
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
133
298
58fd16298954 from EUC to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 291
diff changeset
134 // なんか名前が変だが。。。
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
135 /* TaskGroup */
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
136 TaskGroupPtr set_groupTask(uint32 command);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
137 void add_groupTask(TaskGroupPtr group, TaskPtr task);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
138 void remove_groupTask(TaskGroupPtr group, TaskPtr task);
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
139 void reload_groupTask();
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
140 uint32 status_groupTask(TaskGroupPtr group);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
141
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
142 /* GlobalMemory */
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
143 void* global_alloc(int id, int size);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
144 void* global_get(int id);
373
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 366
diff changeset
145 void global_set(int id, void *addr);
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
146 void global_free(int id);
373
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 366
diff changeset
147 MemList* createMemList(int size, int count);
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
148 virtual void *allocate(int size) { return NULL; };
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
149
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
150 virtual void mainMem_alloc(int id, int size) {};
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
151 virtual void mainMem_wait() {};
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
152 void *mainMem_get(int id);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
153
389
016d45583994 MemHash for Cell
kono@localhost.localdomain
parents: 388
diff changeset
154 MemorySegment * get_segment(memaddr addr, MemList *m);
437
fd44dbd049aa overlay...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 430
diff changeset
155 MemorySegment * get_segment(memaddr addr, MemList *m, int size);
442
95a856a2d552 hoge... size/count
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 441
diff changeset
156 void allocate_code_segment(int size, int count);
421
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
157
389
016d45583994 MemHash for Cell
kono@localhost.localdomain
parents: 388
diff changeset
158 virtual uint32 get_tag();
016d45583994 MemHash for Cell
kono@localhost.localdomain
parents: 388
diff changeset
159 void put_segment(MemorySegment *s);
016d45583994 MemHash for Cell
kono@localhost.localdomain
parents: 388
diff changeset
160 void wait_segment(MemorySegment *s);
387
5e2d30bfbf23 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
161
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
162 /* DMA Transfer */
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
163 void dma_load(void *buf, uint32 addr, uint32 size, uint32 mask);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
164 void dma_store(void *buf,uint32 addr, uint32 size, uint32 mask);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
165 void dma_wait(uint32 mask);
255
6bb8725e60ae show dma wait
tkaito@localhost.localdomain
parents: 194
diff changeset
166 void show_dma_wait() { connector->show_dma_wait(id); };
334
20f2459041cb [in test_render] push L key , call show_dma_wait, but incomplete.
e065746@localhost.localdomain
parents: 302
diff changeset
167 void show_dma_wait(int id) { connector->show_dma_wait(id); };
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
168 void mail_write(uint32 data);
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
169 uint32 mail_read();
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
170 void dma_loadList(ListDataPtr list, void *, uint32 mask);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
171 void dma_storeList(ListDataPtr list, void *, uint32 mask);
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
172 };
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
173
464
01b321c86747 task run is mere C function now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 460
diff changeset
174 extern void register_task(int cmd, TaskObjectRun run);
430
fb62b7acc92b code loading (on going...)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 426
diff changeset
175 extern void register_dynamic_task(int cmd,
464
01b321c86747 task run is mere C function now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 460
diff changeset
176 memaddr start, int size, TaskObjectRun run,
439
95c0457a7d31 still overlay...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 437
diff changeset
177 int entry_offset);
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
178
441
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
179 struct tbl {
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
180 unsigned int vma;
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
181 unsigned int size;
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
182 unsigned int file_offset;
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
183 unsigned int buf;
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
184 };
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
185
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
186 #endif
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
187
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
188
373
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 366
diff changeset
189 #define SchedConstructor(str) \
421
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
190 str() {} \
373
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 366
diff changeset
191 BASE_NEW_DELETE(str) \
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
192
373
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 366
diff changeset
193 #define SchedDefineTask(str) \
464
01b321c86747 task run is mere C function now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 460
diff changeset
194 static int run(SchedTask *smanager, void *rbuf, void *wbuf); \
460
b0ca9e34f7f0 fix Scheduler.h
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 442
diff changeset
195 extern "C" { \
464
01b321c86747 task run is mere C function now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 460
diff changeset
196 int runTask_##str(SchedTask *smanager, void *rbuf, void *wbuf) \
373
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 366
diff changeset
197 { \
464
01b321c86747 task run is mere C function now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 460
diff changeset
198 return run(smanager, rbuf, wbuf); \
460
b0ca9e34f7f0 fix Scheduler.h
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 442
diff changeset
199 } \
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
200 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
201
373
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 366
diff changeset
202 #define SchedExternTask(str) \
460
b0ca9e34f7f0 fix Scheduler.h
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 442
diff changeset
203 extern "C" { \
464
01b321c86747 task run is mere C function now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 460
diff changeset
204 extern int runTask_##str(SchedTask *manager, void *rbuf, void *wbuf) ; \
460
b0ca9e34f7f0 fix Scheduler.h
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 442
diff changeset
205 }
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
206
373
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 366
diff changeset
207 #define SchedRegisterTask(cmd, str) \
464
01b321c86747 task run is mere C function now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 460
diff changeset
208 register_task(cmd, runTask_##str);
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
209
421
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
210 #define SchedDefineDynamicTask(str,segment) \
464
01b321c86747 task run is mere C function now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 460
diff changeset
211 SchedDefineTask(str)
421
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
212
437
fd44dbd049aa overlay...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 430
diff changeset
213 #ifndef NO_OVERLAY
421
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
214 #define SchedExternDynamicTask(str,segment) \
441
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
215 extern "C" { \
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
216 extern unsigned long long _EAR_; \
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
217 extern struct tbl _ovly_table[]; \
464
01b321c86747 task run is mere C function now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 460
diff changeset
218 extern int runTask_##str(SchedTask *manager, void *rbuf, void *wbuf) ; \
441
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
219 }
437
fd44dbd049aa overlay...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 430
diff changeset
220 #else
439
95c0457a7d31 still overlay...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 437
diff changeset
221 #define SchedExternDynamicTask(str,segment) SchedExternTask(str)
437
fd44dbd049aa overlay...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 430
diff changeset
222 #endif
421
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
223
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
224
437
fd44dbd049aa overlay...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 430
diff changeset
225 #ifndef NO_OVERLAY
421
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
226 #define SchedRegisterDynamicTask(cmd, str, segment) \
441
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
227 register_dynamic_task(cmd, _EAR_+_ovly_table[segment].file_offset, \
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
228 _ovly_table[segment].size, \
464
01b321c86747 task run is mere C function now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 460
diff changeset
229 runTask_##str, \
01b321c86747 task run is mere C function now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 460
diff changeset
230 runTask_##str##_offset);
437
fd44dbd049aa overlay...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 430
diff changeset
231 #else
fd44dbd049aa overlay...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 430
diff changeset
232 #define SchedRegisterDynamicTask(cmd, str, segment) SchedRegisterTask(cmd, str)
fd44dbd049aa overlay...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 430
diff changeset
233 #endif
421
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
234
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
235
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
236 /* end */