42
|
1 #ifndef INCLUDED_SCHED_TASK
|
|
2 #define INCLUDED_SCHED_TASK
|
|
3
|
302
|
4 #include "SchedTaskImpl.h"
|
|
5
|
|
6 class SchedTask : public SchedTaskImpl {
|
|
7 public:
|
109
|
8
|
302
|
9 /* variables */
|
|
10
|
|
11 virtual ~SchedTask() {
|
|
12 }
|
|
13
|
109
|
14 /* constructor */
|
88
|
15
|
109
|
16 BASE_NEW_DELETE(SchedTask);
|
42
|
17
|
298
|
18 // ここをユーザが継承して
|
|
19 // それぞれのタスクに対応した処理を記述する
|
302
|
20 virtual int run(void* r, void *w) { return 0;}
|
109
|
21
|
184
|
22 //--- User API ---
|
302
|
23
|
|
24 int get_cpuid() {return SchedTaskImpl::get_cpuid();}
|
194
|
25
|
302
|
26 void* get_input(void *buff, int index) {return SchedTaskImpl::get_input(buff,index);}
|
|
27 void* get_output(void *buff, int index) {return SchedTaskImpl::get_output(buff,index);}
|
|
28 uint32 get_inputAddr(int index) {return SchedTaskImpl::get_inputAddr(index);}
|
|
29 uint32 get_outputAddr(int index) {return SchedTaskImpl::get_outputAddr(index);}
|
|
30 int get_inputSize(int index) {return SchedTaskImpl::get_inputSize(index);}
|
|
31 int get_outputSize(int index) {return SchedTaskImpl::get_outputSize(index);}
|
|
32 int get_param(int index) {return SchedTaskImpl::get_param(index);}
|
109
|
33
|
302
|
34 TaskPtr create_task(int cmd) {return SchedTaskImpl::create_task(cmd);}
|
|
35 void wait_task(TaskPtr waitTask) {SchedTaskImpl::wait_task(waitTask);}
|
109
|
36
|
302
|
37 void* global_alloc(int id, int size) {return SchedTaskImpl::global_alloc(id,size);}
|
|
38 void* global_get(int id) {return SchedTaskImpl::global_get(id);}
|
|
39 void global_free(int id) {SchedTaskImpl::global_free(id);}
|
109
|
40
|
302
|
41 void mainMem_alloc(int id, int size) {SchedTaskImpl::mainMem_alloc(id,size);}
|
|
42 void mainMem_wait() { SchedTaskImpl::mainMem_wait();}
|
|
43 void* mainMem_get(int id) {return SchedTaskImpl::mainMem_get(id);}
|
109
|
44
|
302
|
45 void *allocate(int size) {return SchedTaskImpl::allocate(size);}
|
109
|
46
|
302
|
47 void dma_load(void *buf, uint32 addr, uint32 size, uint32 mask) {SchedTaskImpl::dma_load(buf,addr,size,mask);}
|
|
48 void dma_store(void *buf,uint32 addr, uint32 size, uint32 mask) {SchedTaskImpl::dma_load(buf,addr,size,mask);}
|
|
49 void dma_wait(uint32 mask) {SchedTaskImpl::dma_wait(mask);}
|
|
50 };
|
109
|
51
|
184
|
52 extern SchedTask* createSchedTask(TaskPtr);
|
302
|
53
|
|
54 #endif
|