annotate example/get_segment/spe/spe-main.cc @ 441:54c49df8dcda draft

slightly worked...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 25 Sep 2009 03:49:01 +0900
parents 13c6740ab15f
children 6c63423a7dea
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"
430
4d4443138484 code loading (on going...)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 426
diff changeset
3 #include "LoadEntry.h"
354
cfd20d609ace add example/get_segment and change spe/DrawSpan.cpp
koba
parents:
diff changeset
4
441
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
5 #include "createTask_offset.h"
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
6
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
7 SchedExternDynamicTask(Hello,0);
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
8 SchedExternDynamicTask(Hello1,1);
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
9
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
10 void print_ovly_table();
354
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 /**
cfd20d609ace add example/get_segment and change spe/DrawSpan.cpp
koba
parents:
diff changeset
13 * この関数は SpeScheduler から呼ばれるので
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 */
cfd20d609ace add example/get_segment and change spe/DrawSpan.cpp
koba
parents:
diff changeset
16 void
430
4d4443138484 code loading (on going...)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 426
diff changeset
17 task_init(Scheduler *scheduler)
354
cfd20d609ace add example/get_segment and change spe/DrawSpan.cpp
koba
parents:
diff changeset
18 {
441
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
19 SchedRegisterDynamicTask(HELLO_TASK, Hello, 0);
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
20 SchedRegisterDynamicTask(HELLO_TASK1, Hello1, 1);
433
19c7c7cb02bf overlay (on going)..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 430
diff changeset
21 scheduler->allocate_code_segment(4,1024);
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 typedef unsigned int u32;
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
26 extern unsigned long long _EAR_;
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
27
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
28 /*
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
29 extern struct tbl1 {
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
30 u32 vma;
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
31 u32 size;
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
32 u32 file_offset;
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
33 u32 buf;
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
34 } _ovly_table;
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
35 */
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
36
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
37 #if 0
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
38 unsigned long long _EAR_ = 0;
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
39 struct tbl _ovly_table;
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
40 #endif
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
41
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 }
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
60
54c49df8dcda slightly worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 439
diff changeset
61 /* end */