annotate TaskManager/kernel/schedule/Scheduler.h @ 685:b386522827ae

Bulk task on going.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 07 Dec 2009 00:32:34 +0900
parents 3b6290c05f9f
children 257ad1a518e3
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
621
5b178db5988a Cell fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 619
diff changeset
4 #include <stdlib.h>
301
bcb81858aa62 remove deprecated source. not work.
tkaito@localhost.localdomain
parents: 298
diff changeset
5 #include "base.h"
bcb81858aa62 remove deprecated source. not work.
tkaito@localhost.localdomain
parents: 298
diff changeset
6 #include "TaskList.h"
bcb81858aa62 remove deprecated source. not work.
tkaito@localhost.localdomain
parents: 298
diff changeset
7 #include "ListData.h"
bcb81858aa62 remove deprecated source. not work.
tkaito@localhost.localdomain
parents: 298
diff changeset
8 #include "DmaManager.h"
bcb81858aa62 remove deprecated source. not work.
tkaito@localhost.localdomain
parents: 298
diff changeset
9 #include "SchedTaskBase.h"
bcb81858aa62 remove deprecated source. not work.
tkaito@localhost.localdomain
parents: 298
diff changeset
10 #include "SchedTaskList.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"
619
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 614
diff changeset
13
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
14
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
15 #define MAX_USER_TASK 32
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
16 #define MAX_SYSTEM_TASK 2
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
17 #define MAX_TASK_OBJECT MAX_USER_TASK + MAX_SYSTEM_TASK
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
18 #define MAX_GLOBAL_AREA 32
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
19 #define MAX_MAINMEM_AREA 32
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
20
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
21 class SchedTaskBase;
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
22 class SchedTask;
184
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
23 class SchedTaskList;
621
5b178db5988a Cell fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 619
diff changeset
24 class TaskManagerImpl;
5b178db5988a Cell fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 619
diff changeset
25 class HTask;
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
26
464
01b321c86747 task run is mere C function now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 460
diff changeset
27 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
28
621
5b178db5988a Cell fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 619
diff changeset
29 extern "C" {
5b178db5988a Cell fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 619
diff changeset
30 extern long random();
5b178db5988a Cell fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 619
diff changeset
31 }
5b178db5988a Cell fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 619
diff changeset
32
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
33 class Scheduler {
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
34 public:
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
35 virtual ~Scheduler();
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
36
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
37 BASE_NEW_DELETE(Scheduler);
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
38
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
39 /* variables */
194
gongo@localhost.localdomain
parents: 187
diff changeset
40 int id;
387
5e2d30bfbf23 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
41 MemHash *hash;
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
42
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
43 // double buffering
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
44 TaskListPtr buff_taskList[2];
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
45
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
46 int buffFlag_taskList;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
47
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
48 /* GlobalMemoryList */
629
8843edf37c0e Cell 64 bit tried, but not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 626
diff changeset
49 /* global among Tasks in the same CPU */
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
50 void* globalList[MAX_GLOBAL_AREA];
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
51
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
52 /* MainMemory Allocate Command List */
629
8843edf37c0e Cell 64 bit tried, but not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 626
diff changeset
53 memaddr mainMemList[MAX_MAINMEM_AREA];
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
54
421
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
55 /* Code Area */
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
56 MemList *code_segment_pool;
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
57
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
58 // Task Object Table
464
01b321c86747 task run is mere C function now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 460
diff changeset
59 // this is named TaskObjectRun but it is not an object.
291
3569d31705b6 document
kono@localhost.localdomain
parents: 255
diff changeset
60 // 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
61 // 大きいので、SPEには置かない方が本当は良い...
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
62 typedef struct {
464
01b321c86747 task run is mere C function now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 460
diff changeset
63 TaskObjectRun run;
441
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
64 memaddr location; // location address in a.out
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
65 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
66 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
67 MemorySegment *segment;
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
68 void (*load)(Scheduler *,int);
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
69 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
70 } TaskObject, *TaskObjectPtr;
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
71
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
72 DmaManager* connector;
619
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 614
diff changeset
73 TaskManagerImpl* manager;
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
74
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
75
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
76 /* functions */
635
8cc609285bbe SimpleTask worked on Mac OS X
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 634
diff changeset
77 void init(TaskManagerImpl *m);
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
78 void run();
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
79 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
80 void finish();
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
81
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
82 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
83 TaskListPtr get_renewListBuf();
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
84
187
gongo@localhost.localdomain
parents: 184
diff changeset
85 void set_backupTaskList(TaskListPtr cur_taskList);
gongo@localhost.localdomain
parents: 184
diff changeset
86 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
87 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
88 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
89 int get_backupTaskListIndex();
184
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
90
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
91
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
92 /* GlobalMemory */
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
93 void* global_alloc(int id, int size);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
94 void* global_get(int id);
373
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 366
diff changeset
95 void global_set(int id, void *addr);
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
96 void global_free(int id);
373
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 366
diff changeset
97 MemList* createMemList(int size, int count);
467
44c0bce54dcf fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
98 void free_(void *p) { free(p); }
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
99
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
100 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
101 virtual void mainMem_wait() {};
629
8843edf37c0e Cell 64 bit tried, but not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 626
diff changeset
102 memaddr mainMem_get(int id);
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
103
389
016d45583994 MemHash for Cell
kono@localhost.localdomain
parents: 388
diff changeset
104 MemorySegment * get_segment(memaddr addr, MemList *m);
437
fd44dbd049aa overlay...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 430
diff changeset
105 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
106 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
107
389
016d45583994 MemHash for Cell
kono@localhost.localdomain
parents: 388
diff changeset
108 virtual uint32 get_tag();
016d45583994 MemHash for Cell
kono@localhost.localdomain
parents: 388
diff changeset
109 void put_segment(MemorySegment *s);
016d45583994 MemHash for Cell
kono@localhost.localdomain
parents: 388
diff changeset
110 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
111
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
112 /* DMA Transfer */
625
60aa3f241b10 64bit mode worked on Mac OS X.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 621
diff changeset
113 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: 621
diff changeset
114 void dma_store(void *buf,memaddr addr, uint32 size, uint32 mask);
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
115 void dma_wait(uint32 mask);
255
6bb8725e60ae show dma wait
tkaito@localhost.localdomain
parents: 194
diff changeset
116 void show_dma_wait() { connector->show_dma_wait(id); };
672
3b6290c05f9f add profiling code
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 635
diff changeset
117 void start_profile() { connector->start_profile(); };
625
60aa3f241b10 64bit mode worked on Mac OS X.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 621
diff changeset
118 void mail_write(memaddr data);
60aa3f241b10 64bit mode worked on Mac OS X.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 621
diff changeset
119 memaddr mail_read();
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
120 void dma_loadList(ListDataPtr list, void *, uint32 mask);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
121 void dma_storeList(ListDataPtr list, void *, uint32 mask);
619
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 614
diff changeset
122
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 614
diff changeset
123 /* manager */
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 614
diff changeset
124
621
5b178db5988a Cell fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 619
diff changeset
125 void set_manager(TaskManagerImpl *m) { manager = m; };
619
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 614
diff changeset
126
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 614
diff changeset
127 // user
621
5b178db5988a Cell fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 619
diff changeset
128 HTask * create_task(int cmd);
634
0558abba673c SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 629
diff changeset
129 HTask * create_task(int cmd, memaddr r, long rs, memaddr w, long ws);
0558abba673c SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 629
diff changeset
130
621
5b178db5988a Cell fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 619
diff changeset
131 void set_task_depend(HTask * master, HTask * slave) ;
5b178db5988a Cell fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 619
diff changeset
132 void spawn_task(HTask * t) ;
5b178db5988a Cell fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 619
diff changeset
133 void set_task_cpu(HTask * t, CPU_TYPE cpu) ;
635
8cc609285bbe SimpleTask worked on Mac OS X
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 634
diff changeset
134 void *allocate(int size);
621
5b178db5988a Cell fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 619
diff changeset
135 void* allocate(int size,int align) ;
5b178db5988a Cell fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 619
diff changeset
136 long get_random() ;
5b178db5988a Cell fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 619
diff changeset
137 Scheduler *get_scheduler() { return this; };
619
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 614
diff changeset
138
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 614
diff changeset
139
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
140 };
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
141
464
01b321c86747 task run is mere C function now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 460
diff changeset
142 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
143 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
144 memaddr start, int size, TaskObjectRun run,
439
95c0457a7d31 still overlay...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 437
diff changeset
145 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
146
441
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
147 struct tbl {
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
148 unsigned int vma;
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
149 unsigned int size;
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
150 unsigned int file_offset;
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
151 unsigned int buf;
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
152 };
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
153
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
154 #endif
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
155
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
156
373
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 366
diff changeset
157 #define SchedConstructor(str) \
421
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
158 str() {} \
373
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 366
diff changeset
159 BASE_NEW_DELETE(str) \
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
160
468
bd5b93d39597 test_nogl on Mac OS X worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 467
diff changeset
161 #define SchedDefineTask(str) SchedDefineTask1(str,run) \
bd5b93d39597 test_nogl on Mac OS X worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 467
diff changeset
162
bd5b93d39597 test_nogl on Mac OS X worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 467
diff changeset
163 #define SchedDefineTask1(str,run) \
464
01b321c86747 task run is mere C function now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 460
diff changeset
164 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
165 extern "C" { \
464
01b321c86747 task run is mere C function now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 460
diff changeset
166 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
167 { \
464
01b321c86747 task run is mere C function now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 460
diff changeset
168 return run(smanager, rbuf, wbuf); \
460
b0ca9e34f7f0 fix Scheduler.h
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 442
diff changeset
169 } \
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
170 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
171
373
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 366
diff changeset
172 #define SchedExternTask(str) \
460
b0ca9e34f7f0 fix Scheduler.h
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 442
diff changeset
173 extern "C" { \
464
01b321c86747 task run is mere C function now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 460
diff changeset
174 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
175 }
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 70
diff changeset
176
373
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 366
diff changeset
177 #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
178 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
179
614
4e44147d78ee remove uncessary Task Name definision
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 501
diff changeset
180 #define SchedRegister(str) \
4e44147d78ee remove uncessary Task Name definision
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 501
diff changeset
181 register_task(str, runTask_##str);
4e44147d78ee remove uncessary Task Name definision
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 501
diff changeset
182
421
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
183 #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
184 SchedDefineTask(str)
421
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
185
437
fd44dbd049aa overlay...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 430
diff changeset
186 #ifndef NO_OVERLAY
421
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
187 #define SchedExternDynamicTask(str,segment) \
441
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
188 extern "C" { \
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
189 extern unsigned long long _EAR_; \
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
190 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
191 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
192 }
437
fd44dbd049aa overlay...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 430
diff changeset
193 #else
439
95c0457a7d31 still overlay...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 437
diff changeset
194 #define SchedExternDynamicTask(str,segment) SchedExternTask(str)
437
fd44dbd049aa overlay...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 430
diff changeset
195 #endif
421
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
196
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
197
437
fd44dbd049aa overlay...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 430
diff changeset
198 #ifndef NO_OVERLAY
421
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
199 #define SchedRegisterDynamicTask(cmd, str, segment) \
626
ab866bc8a624 64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 625
diff changeset
200 register_dynamic_task(cmd, (memaddr)(_EAR_+_ovly_table[segment].file_offset), \
441
7bae2117f239 slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
201 _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
202 runTask_##str, \
01b321c86747 task run is mere C function now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 460
diff changeset
203 runTask_##str##_offset);
614
4e44147d78ee remove uncessary Task Name definision
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 501
diff changeset
204 #define SchedRegisterDynamic(str, segment) SchedRegisterDynamicTask(str, str, segment)
437
fd44dbd049aa overlay...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 430
diff changeset
205 #else
fd44dbd049aa overlay...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 430
diff changeset
206 #define SchedRegisterDynamicTask(cmd, str, segment) SchedRegisterTask(cmd, str)
614
4e44147d78ee remove uncessary Task Name definision
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 501
diff changeset
207 #define SchedRegisterDynamic(str, segment) SchedRegisterDynamicTask(str, str, segment)
437
fd44dbd049aa overlay...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 430
diff changeset
208 #endif
421
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
209
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
210
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 389
diff changeset
211 /* end */