annotate TaskManager/kernel/memory/MemList.h @ 1546:61164c687b29 draft

fix GpuScheduler flip
author Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
date Tue, 05 Feb 2013 13:15:46 +0900
parents 205e4a4af635
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
369
93b33cecba37 change TaskManager.cc
aaa
parents: 368
diff changeset
1 #ifndef MEMLIST
93b33cecba37 change TaskManager.cc
aaa
parents: 368
diff changeset
2 #define MEMLIST
93b33cecba37 change TaskManager.cc
aaa
parents: 368
diff changeset
3
370
4748fd7dcd89 change TaskManger & memory/* & Random
aaa
parents: 369
diff changeset
4 #include <stdlib.h>
368
1a80a2aa696c change TaskManager
aaa
parents: 366
diff changeset
5 #include "MemorySegment.h"
1a80a2aa696c change TaskManager
aaa
parents: 366
diff changeset
6
373
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 370
diff changeset
7 class MemList : public MemorySegment {
369
93b33cecba37 change TaskManager.cc
aaa
parents: 368
diff changeset
8 public:
370
4748fd7dcd89 change TaskManger & memory/* & Random
aaa
parents: 369
diff changeset
9 MemorySegment* pool;
366
0251d06467de rename include/TaskManager/* and add memory
aaa
parents:
diff changeset
10 MemorySegment* first;
0251d06467de rename include/TaskManager/* and add memory
aaa
parents:
diff changeset
11 MemorySegment* last;
373
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 370
diff changeset
12
368
1a80a2aa696c change TaskManager
aaa
parents: 366
diff changeset
13 // TaskManager 側で create する
1a80a2aa696c change TaskManager
aaa
parents: 366
diff changeset
14 //MemList* createMemList(uint32 size, uint32 count);
373
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 370
diff changeset
15
368
1a80a2aa696c change TaskManager
aaa
parents: 366
diff changeset
16 MemList(MemorySegment* ms) {
373
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 370
diff changeset
17 first = last = this;
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 370
diff changeset
18 next = prev = this;
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 370
diff changeset
19 pool = ms;
370
4748fd7dcd89 change TaskManger & memory/* & Random
aaa
parents: 369
diff changeset
20 }
4748fd7dcd89 change TaskManger & memory/* & Random
aaa
parents: 369
diff changeset
21
4748fd7dcd89 change TaskManger & memory/* & Random
aaa
parents: 369
diff changeset
22 ~MemList() {
373
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 370
diff changeset
23 free(pool);
368
1a80a2aa696c change TaskManager
aaa
parents: 366
diff changeset
24 }
366
0251d06467de rename include/TaskManager/* and add memory
aaa
parents:
diff changeset
25
0251d06467de rename include/TaskManager/* and add memory
aaa
parents:
diff changeset
26 void addFirst(MemorySegment* e);
0251d06467de rename include/TaskManager/* and add memory
aaa
parents:
diff changeset
27 void addLast(MemorySegment* e);
0251d06467de rename include/TaskManager/* and add memory
aaa
parents:
diff changeset
28 MemorySegment* getFirst();
0251d06467de rename include/TaskManager/* and add memory
aaa
parents:
diff changeset
29 MemorySegment* getLast();
368
1a80a2aa696c change TaskManager
aaa
parents: 366
diff changeset
30 int remove(MemorySegment* e);
370
4748fd7dcd89 change TaskManger & memory/* & Random
aaa
parents: 369
diff changeset
31 MemorySegment* poll();
373
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 370
diff changeset
32 void moveToFirst(MemorySegment* e); // or use();
370
4748fd7dcd89 change TaskManger & memory/* & Random
aaa
parents: 369
diff changeset
33 MemorySegment* get(int index);
368
1a80a2aa696c change TaskManager
aaa
parents: 366
diff changeset
34 };
1a80a2aa696c change TaskManager
aaa
parents: 366
diff changeset
35
369
93b33cecba37 change TaskManager.cc
aaa
parents: 368
diff changeset
36 #endif