354
|
1 #include <stdio.h>
|
|
2 #include "Hello.h"
|
|
3 #include "Func.h"
|
|
4
|
|
5 /* これは必須 */
|
|
6 SchedDefineTask(Hello);
|
|
7
|
|
8 #define PP_STORE 3
|
|
9 #define SIZE (4096*sizeof(int))
|
|
10
|
|
11 int
|
|
12 Hello::run(void *rbuf, void *wbuf)
|
|
13 {
|
|
14 int task_id = get_param(0);
|
|
15 int *ptr = 0;
|
|
16 #if 1
|
|
17 ptr = (int*)smanager->allocate(SIZE);
|
|
18
|
|
19 smanager->mainMem_alloc(0, SIZE);
|
|
20
|
|
21 int i;
|
|
22 for(i=0;i<4096;i++) {
|
|
23 ptr[i] = i;
|
|
24 }
|
|
25 #endif
|
|
26
|
|
27 void *next = 0;
|
|
28 #if 1
|
|
29 smanager->mainMem_wait();
|
|
30 next = (void *)smanager->mainMem_get(0);
|
|
31
|
|
32 smanager->dma_wait(PP_STORE);
|
|
33 smanager->dma_store(ptr, (uint32)next,
|
|
34 SIZE, PP_STORE);
|
|
35 smanager->dma_wait(PP_STORE);
|
|
36 uint32 wait_id = smanager->get_segment(next, SIZE);
|
|
37 void* cur = smanager->wait_segment(wait_id);
|
|
38 //smanager->put_segment(wait_id);
|
|
39 //comparePtr *next;
|
|
40 #endif
|
|
41
|
|
42
|
|
43 fprintf(stderr,"sizeof(int) = [%d] sizeof(void*)=[%d]\n", (int)sizeof(int),(int)sizeof(void*));
|
|
44 fprintf(stderr,"[%d] Main Mem %0x len %d\n", task_id, (unsigned int)next,(int)SIZE);
|
|
45
|
|
46 free(ptr);
|
|
47 return 0;
|
|
48 }
|