annotate example/get_segment/spe/spe-main.cc @ 460:433892ba596b draft

fix Scheduler.h
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 29 Sep 2009 11:51:25 +0900
parents 6c63423a7dea
children ca987c0beb11
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
354
cfd20d609ace add example/get_segment and change spe/DrawSpan.cpp
koba
parents:
diff changeset
1 #include "Func.h"
cfd20d609ace add example/get_segment and change spe/DrawSpan.cpp
koba
parents:
diff changeset
2 #include "Scheduler.h"
cfd20d609ace add example/get_segment and change spe/DrawSpan.cpp
koba
parents:
diff changeset
3
441
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
4 #include "createTask_offset.h"
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
5
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
6 SchedExternDynamicTask(Hello,0);
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
7 SchedExternDynamicTask(Hello1,1);
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
8
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
9 void print_ovly_table();
354
cfd20d609ace add example/get_segment and change spe/DrawSpan.cpp
koba
parents:
diff changeset
10
cfd20d609ace add example/get_segment and change spe/DrawSpan.cpp
koba
parents:
diff changeset
11 /**
cfd20d609ace add example/get_segment and change spe/DrawSpan.cpp
koba
parents:
diff changeset
12 * この関数は SpeScheduler から呼ばれるので
cfd20d609ace add example/get_segment and change spe/DrawSpan.cpp
koba
parents:
diff changeset
13 * 必ずこの関数名でお願いします。
cfd20d609ace add example/get_segment and change spe/DrawSpan.cpp
koba
parents:
diff changeset
14 */
cfd20d609ace add example/get_segment and change spe/DrawSpan.cpp
koba
parents:
diff changeset
15 void
430
4d4443138484 code loading (on going...)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 426
diff changeset
16 task_init(Scheduler *scheduler)
354
cfd20d609ace add example/get_segment and change spe/DrawSpan.cpp
koba
parents:
diff changeset
17 {
441
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
18 SchedRegisterDynamicTask(HELLO_TASK, Hello, 0);
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
19 SchedRegisterDynamicTask(HELLO_TASK1, Hello1, 1);
442
6c63423a7dea hoge... size/count
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 441
diff changeset
20 createTask_Hello(scheduler);
6c63423a7dea hoge... size/count
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 441
diff changeset
21 scheduler->allocate_code_segment(1024,4);
441
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
22 print_ovly_table();
354
cfd20d609ace add example/get_segment and change spe/DrawSpan.cpp
koba
parents:
diff changeset
23 }
441
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
24
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
25
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
26 /*
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
27 extern struct tbl1 {
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
28 u32 vma;
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
29 u32 size;
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
30 u32 file_offset;
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
31 u32 buf;
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
32 } _ovly_table;
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
33 */
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
34
460
433892ba596b fix Scheduler.h
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 442
diff changeset
35 #ifdef NO_OVERLAY
433892ba596b fix Scheduler.h
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 442
diff changeset
36 void
433892ba596b fix Scheduler.h
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 442
diff changeset
37 print_ovly_table() {}
433892ba596b fix Scheduler.h
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 442
diff changeset
38 #else
441
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
39
460
433892ba596b fix Scheduler.h
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 442
diff changeset
40 typedef unsigned int u32;
433892ba596b fix Scheduler.h
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 442
diff changeset
41 extern unsigned long long _EAR_;
441
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
42 void
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
43 print_ovly_table()
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
44 {
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
45 int i;
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
46 struct tbl *ov;
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
47
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
48 ov = _ovly_table;
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
49
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
50 fprintf(stderr,"memaddr = %d\n",sizeof(memaddr));
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
51 for(i=0;i<2;i++) {
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
52 unsigned long long adr = _EAR_;
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
53 fprintf(stderr,"ovly_table[%d] vma=%08x size=%08x offset=%08x address=%08llx\n",
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
54 i,
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
55 ov[i].vma,
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
56 ov[i].size, ov[i].file_offset,
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
57 (adr) + ov[i].file_offset);
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
58 }
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
59 }
460
433892ba596b fix Scheduler.h
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 442
diff changeset
60 #endif
441
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
61
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
62 /* end */