Mercurial > hg > Game > Cerium
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 |
rev | line source |
---|---|
354 | 1 #include "Func.h" |
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 | 4 |
441 | 5 #include "createTask_offset.h" |
6 | |
7 SchedExternDynamicTask(Hello,0); | |
8 SchedExternDynamicTask(Hello1,1); | |
9 | |
10 void print_ovly_table(); | |
354 | 11 |
12 /** | |
13 * この関数は SpeScheduler から呼ばれるので | |
14 * 必ずこの関数名でお願いします。 | |
15 */ | |
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 | 18 { |
441 | 19 SchedRegisterDynamicTask(HELLO_TASK, Hello, 0); |
20 SchedRegisterDynamicTask(HELLO_TASK1, Hello1, 1); | |
433 | 21 scheduler->allocate_code_segment(4,1024); |
441 | 22 print_ovly_table(); |
354 | 23 } |
441 | 24 |
25 typedef unsigned int u32; | |
26 extern unsigned long long _EAR_; | |
27 | |
28 /* | |
29 extern struct tbl1 { | |
30 u32 vma; | |
31 u32 size; | |
32 u32 file_offset; | |
33 u32 buf; | |
34 } _ovly_table; | |
35 */ | |
36 | |
37 #if 0 | |
38 unsigned long long _EAR_ = 0; | |
39 struct tbl _ovly_table; | |
40 #endif | |
41 | |
42 void | |
43 print_ovly_table() | |
44 { | |
45 int i; | |
46 struct tbl *ov; | |
47 | |
48 ov = _ovly_table; | |
49 | |
50 fprintf(stderr,"memaddr = %d\n",sizeof(memaddr)); | |
51 for(i=0;i<2;i++) { | |
52 unsigned long long adr = _EAR_; | |
53 fprintf(stderr,"ovly_table[%d] vma=%08x size=%08x offset=%08x address=%08llx\n", | |
54 i, | |
55 ov[i].vma, | |
56 ov[i].size, ov[i].file_offset, | |
57 (adr) + ov[i].file_offset); | |
58 } | |
59 } | |
60 | |
61 /* end */ |