Mercurial > hg > Game > Cerium
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 |
rev | line source |
---|---|
354 | 1 #include "Func.h" |
2 #include "Scheduler.h" | |
3 | |
441 | 4 #include "createTask_offset.h" |
5 | |
6 SchedExternDynamicTask(Hello,0); | |
7 SchedExternDynamicTask(Hello1,1); | |
8 | |
9 void print_ovly_table(); | |
354 | 10 |
11 /** | |
12 * この関数は SpeScheduler から呼ばれるので | |
13 * 必ずこの関数名でお願いします。 | |
14 */ | |
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 | 17 { |
441 | 18 SchedRegisterDynamicTask(HELLO_TASK, Hello, 0); |
19 SchedRegisterDynamicTask(HELLO_TASK1, Hello1, 1); | |
442 | 20 createTask_Hello(scheduler); |
21 scheduler->allocate_code_segment(1024,4); | |
441 | 22 print_ovly_table(); |
354 | 23 } |
441 | 24 |
25 | |
26 /* | |
27 extern struct tbl1 { | |
28 u32 vma; | |
29 u32 size; | |
30 u32 file_offset; | |
31 u32 buf; | |
32 } _ovly_table; | |
33 */ | |
34 | |
460 | 35 #ifdef NO_OVERLAY |
36 void | |
37 print_ovly_table() {} | |
38 #else | |
441 | 39 |
460 | 40 typedef unsigned int u32; |
41 extern unsigned long long _EAR_; | |
441 | 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 } | |
460 | 60 #endif |
441 | 61 |
62 /* end */ |