81
|
1 #include <stdio.h>
|
|
2 #include "CellScheduler.h"
|
194
|
3 #include "spu_mfcio.h"
|
109
|
4 #include "error.h"
|
81
|
5
|
94
|
6 extern unsigned char _end[];
|
|
7
|
81
|
8 int
|
|
9 main(unsigned long long speid,
|
|
10 unsigned long long argc, unsigned long long argv)
|
|
11 {
|
|
12 CellScheduler *manager;
|
|
13
|
242
|
14 //const unsigned ls_size = (unsigned)&argc;
|
|
15 //unsigned code_size = (unsigned)&_end;
|
|
16 //unsigned heap_size = ls_size - code_size;
|
94
|
17
|
109
|
18 __debug(" ls_size:%10d bytes\n", ls_size);
|
|
19 __debug("code_size:%10d bytes\n", code_size);
|
|
20 __debug("heap_size:%10d bytes\n", heap_size);
|
94
|
21
|
81
|
22 manager = new CellScheduler();
|
|
23 manager->init();
|
109
|
24 manager->id = (int)argc;
|
94
|
25
|
619
|
26 TaskManagerImpl *tm = new SpeTaskManagerImpl(manager);
|
|
27 manager->set_manager(tm);
|
|
28
|
194
|
29 spu_write_decrementer(0x7FFFFFFFU);
|
|
30 unsigned int prof = spu_read_decrementer();
|
81
|
31 manager->run();
|
212
|
32
|
194
|
33 prof -= spu_read_decrementer();
|
|
34
|
200
|
35 //printf("%f\n", prof/79800000.0f*1000.0f);
|
|
36
|
81
|
37 manager->finish();
|
|
38
|
|
39 return 0;
|
|
40 }
|