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
|
94
|
14 const unsigned ls_size = (unsigned)&argc;
|
|
15 unsigned code_size = (unsigned)&_end;
|
|
16 unsigned heap_size = ls_size - code_size;
|
|
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
|
194
|
26 spu_write_decrementer(0x7FFFFFFFU);
|
|
27 unsigned int prof = spu_read_decrementer();
|
81
|
28 manager->run();
|
194
|
29 prof -= spu_read_decrementer();
|
|
30
|
200
|
31 //printf("%f\n", prof/79800000.0f*1000.0f);
|
|
32
|
81
|
33 manager->finish();
|
|
34
|
|
35 return 0;
|
|
36 }
|