comparison example/MemList/main.cc @ 400:00fe05184a02

Fix examples.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 21 Sep 2009 18:47:06 +0900
parents 8c5fa57128cb
children 0decff4e867b
comparison
equal deleted inserted replaced
399:4bea73c83c35 400:00fe05184a02
6 #include "TaskManager.h" 6 #include "TaskManager.h"
7 #include "Func.h" 7 #include "Func.h"
8 #include "MemList.h" 8 #include "MemList.h"
9 #include "MemorySegment.h" 9 #include "MemorySegment.h"
10 10
11 //extern void task_init(void);
12
13 extern TaskManager *manager;
14 11
15 const char *usr_help_str = "Usage: ./hello [-cpu spe_num] [-count N]\n\ 12 const char *usr_help_str = "Usage: ./hello [-cpu spe_num] [-count N]\n\
16 -cpu Number of SPE (default 1) \n \ 13 -cpu Number of SPE (default 1) \n \
17 -count Number of task is print \"Hello, World!!\""; 14 -count Number of task is print \"Hello, World!!\"";
18 15
19 16
20 void 17 void
21 test1(MemList* active, MemList* freelist, uint32 size, uint32 count) 18 test1(TaskManager *manager, MemList* active, MemList* freelist, uint32 size, uint32 count)
22 { 19 {
23 /*! 20 /*!
24 active からランダムに要素を取り出してそこの size の領域を書き潰す 21 active からランダムに要素を取り出してそこの size の領域を書き潰す
25 そこを moveToFirst を繰り返すテスト 22 そこを moveToFirst を繰り返すテスト
26 */ 23 */
33 printf("test1\n"); 30 printf("test1\n");
34 } 31 }
35 32
36 33
37 int 34 int
38 TMmain(int argc, char *argv[]) 35 TMmain(TaskManager *manager, int argc, char *argv[])
39 { 36 {
40 uint32 size = 128; 37 uint32 size = 128;
41 uint32 count = 64; 38 uint32 count = 64;
42 39
43 MemList* active = manager->get_scheduler()->createMemList(size, 0); 40 MemList* active = manager->get_scheduler()->createMemList(size, 0);
54 } 51 }
55 52
56 assert(i==count); 53 assert(i==count);
57 printf("count = %d\n", i); 54 printf("count = %d\n", i);
58 55
59 test1(active, freelist, size, count); 56 test1(manager, active, freelist, size, count);
60 delete active; 57 delete active;
61 delete freelist; 58 delete freelist;
62 59
63 return 0; 60 return 0;
64 } 61 }