46
|
1 #ifndef INCLUDED_BUFFER_MANAGER
|
|
2 #define INCLUDED_BUFFER_MANAGER
|
|
3
|
|
4 #ifndef INCLUDED_TASK
|
|
5 # include "task.h"
|
|
6 #endif
|
|
7
|
|
8 #ifndef INCLUDED_TYPES
|
|
9 # include "types.h"
|
|
10 #endif
|
|
11
|
|
12 #ifndef INCLUDED_TASK_LIST_INFO
|
|
13 # include "TaskListInfo.h"
|
|
14 #endif
|
|
15
|
|
16 #ifndef INCLUDED_TASK_QUEUE_INFO
|
|
17 # include "TaskQueueInfo.h"
|
|
18 #endif
|
|
19
|
54
|
20 #ifndef INCLUDED_HTASK_INFO
|
46
|
21 # include "HTaskInfo.h"
|
|
22 #endif
|
|
23
|
54
|
24 #ifndef INCLUDED_DMA_BUFFER
|
|
25 # include "DmaBuffer.h"
|
|
26 #endif
|
|
27
|
46
|
28 class BufferManager {
|
|
29 public:
|
|
30 /* constructor */
|
|
31 BufferManager(int num = 1);
|
|
32 virtual ~BufferManager(void);
|
|
33
|
|
34 /* variables */
|
63
|
35 TaskListInfo *taskListImpl;
|
|
36 TaskQueueInfo *taskQueueImpl;
|
46
|
37 HTaskInfo *htaskImpl;
|
|
38
|
|
39 int machineNum;
|
|
40 TaskQueuePtr activeTaskQueue;
|
|
41 TaskQueuePtr waitTaskQueue;
|
63
|
42 TaskListPtr mainTaskList;
|
46
|
43
|
|
44 /* function */
|
58
|
45 virtual void init(void);
|
46
|
46
|
|
47 TaskQueuePtr create_taskQueue(HTaskPtr);
|
80
|
48 HTaskPtr create_task(int cmd, int siz, DmaBuffer *in, DmaBuffer *out);
|
|
49 //HTaskPtr create_task(int cmd, int siz, unsigned int in, unsigned int out);
|
46
|
50 void free_taskQueue(TaskQueuePtr);
|
|
51 void free_task(HTaskPtr);
|
|
52
|
|
53 // task list
|
|
54 virtual TaskListPtr get_available_taskList(void);
|
|
55
|
|
56 void finish(void);
|
|
57
|
|
58 virtual void clear_taskList(void);
|
|
59
|
|
60 virtual void append_activeTask(HTaskPtr);
|
|
61 virtual void append_waitTask(HTaskPtr);
|
|
62
|
|
63 void check_task_finish(HTaskPtr task);
|
|
64 void notify_wait_taskQueue(HTaskPtr depend, TaskQueuePtr list);
|
|
65 TaskQueuePtr remove_taskQueue(TaskQueuePtr list, TaskQueuePtr task);
|
|
66 TaskQueuePtr remove_taskQueue_eq_task(TaskQueuePtr list, HTaskPtr task);
|
|
67
|
|
68 private:
|
|
69 };
|
|
70
|
|
71 #endif
|