annotate example/MemList/main.cc @ 366:09f33c51a204

rename include/TaskManager/* and add memory
author aaa
date Mon, 27 Jul 2009 15:51:18 +0900
parents 87462f8d3761
children 126f90e8582c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
364
87462f8d3761 uint32 to memaddr(uint64)
tkaito@localhost.localdomain
parents:
diff changeset
1 #include <stdio.h>
87462f8d3761 uint32 to memaddr(uint64)
tkaito@localhost.localdomain
parents:
diff changeset
2 #include <stdlib.h>
87462f8d3761 uint32 to memaddr(uint64)
tkaito@localhost.localdomain
parents:
diff changeset
3 #include <string.h>
87462f8d3761 uint32 to memaddr(uint64)
tkaito@localhost.localdomain
parents:
diff changeset
4 #include "TaskManager.h"
87462f8d3761 uint32 to memaddr(uint64)
tkaito@localhost.localdomain
parents:
diff changeset
5 #include "Func.h"
87462f8d3761 uint32 to memaddr(uint64)
tkaito@localhost.localdomain
parents:
diff changeset
6
87462f8d3761 uint32 to memaddr(uint64)
tkaito@localhost.localdomain
parents:
diff changeset
7 extern void task_init(void);
87462f8d3761 uint32 to memaddr(uint64)
tkaito@localhost.localdomain
parents:
diff changeset
8
87462f8d3761 uint32 to memaddr(uint64)
tkaito@localhost.localdomain
parents:
diff changeset
9 static int count = 1;
87462f8d3761 uint32 to memaddr(uint64)
tkaito@localhost.localdomain
parents:
diff changeset
10
87462f8d3761 uint32 to memaddr(uint64)
tkaito@localhost.localdomain
parents:
diff changeset
11 extern TaskManager *manager;
87462f8d3761 uint32 to memaddr(uint64)
tkaito@localhost.localdomain
parents:
diff changeset
12
87462f8d3761 uint32 to memaddr(uint64)
tkaito@localhost.localdomain
parents:
diff changeset
13 const char *usr_help_str = "Usage: ./hello [-cpu spe_num] [-count N]\n\
87462f8d3761 uint32 to memaddr(uint64)
tkaito@localhost.localdomain
parents:
diff changeset
14 -cpu Number of SPE (default 1) \n\
87462f8d3761 uint32 to memaddr(uint64)
tkaito@localhost.localdomain
parents:
diff changeset
15 -count Number of task is print \"Hello, World!!\"";
87462f8d3761 uint32 to memaddr(uint64)
tkaito@localhost.localdomain
parents:
diff changeset
16
87462f8d3761 uint32 to memaddr(uint64)
tkaito@localhost.localdomain
parents:
diff changeset
17 // get のテストとか
87462f8d3761 uint32 to memaddr(uint64)
tkaito@localhost.localdomain
parents:
diff changeset
18
87462f8d3761 uint32 to memaddr(uint64)
tkaito@localhost.localdomain
parents:
diff changeset
19 int
87462f8d3761 uint32 to memaddr(uint64)
tkaito@localhost.localdomain
parents:
diff changeset
20 main(int argc, char *argv[])
87462f8d3761 uint32 to memaddr(uint64)
tkaito@localhost.localdomain
parents:
diff changeset
21 {
366
09f33c51a204 rename include/TaskManager/* and add memory
aaa
parents: 364
diff changeset
22 uint32 size = 128;
09f33c51a204 rename include/TaskManager/* and add memory
aaa
parents: 364
diff changeset
23 uint32 count = 64;
09f33c51a204 rename include/TaskManager/* and add memory
aaa
parents: 364
diff changeset
24
09f33c51a204 rename include/TaskManager/* and add memory
aaa
parents: 364
diff changeset
25 MemList* active = createMemList(size, 0);
09f33c51a204 rename include/TaskManager/* and add memory
aaa
parents: 364
diff changeset
26 MemList* freelist = createMemList(size, count);
09f33c51a204 rename include/TaskManager/* and add memory
aaa
parents: 364
diff changeset
27
09f33c51a204 rename include/TaskManager/* and add memory
aaa
parents: 364
diff changeset
28 // 配列!
09f33c51a204 rename include/TaskManager/* and add memory
aaa
parents: 364
diff changeset
29 for (int i = 0; i < count; i++) {
09f33c51a204 rename include/TaskManager/* and add memory
aaa
parents: 364
diff changeset
30 MemorySegment* e;
09f33c51a204 rename include/TaskManager/* and add memory
aaa
parents: 364
diff changeset
31 active->addFirst()
09f33c51a204 rename include/TaskManager/* and add memory
aaa
parents: 364
diff changeset
32 }
09f33c51a204 rename include/TaskManager/* and add memory
aaa
parents: 364
diff changeset
33
09f33c51a204 rename include/TaskManager/* and add memory
aaa
parents: 364
diff changeset
34 return 0;
364
87462f8d3761 uint32 to memaddr(uint64)
tkaito@localhost.localdomain
parents:
diff changeset
35 }