Mercurial > hg > Game > Cerium
annotate TaskManager/Fifo/ReferencedDmaManager.cc @ 1553:21ddbc06dcde draft
fix GpuScheduler
author | Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 17 Feb 2013 19:42:36 +0900 |
parents | 34582cd8a7af |
children | 138e7edff3ae |
rev | line source |
---|---|
1219
a27c361c436b
add ReferencedDmaManager.cc
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 #include "ReferencedDmaManager.h" |
a27c361c436b
add ReferencedDmaManager.cc
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 #include "Scheduler.h" |
a27c361c436b
add ReferencedDmaManager.cc
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 #include "TaskManagerImpl.h" |
1418 | 4 #include <string.h> |
1219
a27c361c436b
add ReferencedDmaManager.cc
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 |
a27c361c436b
add ReferencedDmaManager.cc
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 void * |
1417 | 7 ReferencedDmaManager::dma_load(Scheduler *s, memaddr addr, uint32 size, uint32 mask) |
1219
a27c361c436b
add ReferencedDmaManager.cc
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 { |
1415
774ea7a71b0f
try to fix bound in ReferencedDmaManager
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1414
diff
changeset
|
9 return (void*)addr; |
1219
a27c361c436b
add ReferencedDmaManager.cc
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 } |
1257 | 11 |
1300 | 12 void * |
1417 | 13 ReferencedDmaManager::dma_load1(void *buf, memaddr addr, uint32 size, uint32 mask) |
14 { | |
1418 | 15 // void *from = (void*)addr; |
16 // if (buf != from) | |
17 // memcpy(buf, from, size); | |
1417 | 18 return (void*)addr; |
19 } | |
20 | |
21 | |
22 void * | |
23 ReferencedDmaManager::dma_loadList(Scheduler *s, ListDataPtr list, uint32 mask) | |
1300 | 24 { |
1415
774ea7a71b0f
try to fix bound in ReferencedDmaManager
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1414
diff
changeset
|
25 ListElementPtr elm = &list->element[0]; |
1417 | 26 return (void*)elm->addr; // ==readbuf |
1300 | 27 } |
1413
5b024efa2429
fix free on non copy DMA
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
28 |
5b024efa2429
fix free on non copy DMA
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
29 void |
1414
94ac6d8e73aa
fix free inifite loop
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1413
diff
changeset
|
30 ReferencedDmaManager::free_(void *buf) { |
1413
5b024efa2429
fix free on non copy DMA
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
31 } |
5b024efa2429
fix free on non copy DMA
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
32 |
1415
774ea7a71b0f
try to fix bound in ReferencedDmaManager
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1414
diff
changeset
|
33 /** |
774ea7a71b0f
try to fix bound in ReferencedDmaManager
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1414
diff
changeset
|
34 * DMA buffer offset in rbuf |
774ea7a71b0f
try to fix bound in ReferencedDmaManager
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1414
diff
changeset
|
35 * |
774ea7a71b0f
try to fix bound in ReferencedDmaManager
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1414
diff
changeset
|
36 * faked offset for real address must be set to get correct address by |
774ea7a71b0f
try to fix bound in ReferencedDmaManager
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1414
diff
changeset
|
37 * return (void*)((char*)readbuf + inListData.bound[index]); |
774ea7a71b0f
try to fix bound in ReferencedDmaManager
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1414
diff
changeset
|
38 * |
774ea7a71b0f
try to fix bound in ReferencedDmaManager
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1414
diff
changeset
|
39 */ |
774ea7a71b0f
try to fix bound in ReferencedDmaManager
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1414
diff
changeset
|
40 void |
774ea7a71b0f
try to fix bound in ReferencedDmaManager
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1414
diff
changeset
|
41 ReferencedDmaManager::bound(ListData *list) |
774ea7a71b0f
try to fix bound in ReferencedDmaManager
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1414
diff
changeset
|
42 { |
774ea7a71b0f
try to fix bound in ReferencedDmaManager
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1414
diff
changeset
|
43 ListElement *elm = list->element; |
774ea7a71b0f
try to fix bound in ReferencedDmaManager
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1414
diff
changeset
|
44 int *bound = list->bound; |
1511
34582cd8a7af
Fix compile error for cell
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1418
diff
changeset
|
45 #ifdef __CERIUM_CELL__ |
34582cd8a7af
Fix compile error for cell
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1418
diff
changeset
|
46 uint32 readbuf = elm[0].addr; |
34582cd8a7af
Fix compile error for cell
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1418
diff
changeset
|
47 #else |
1415
774ea7a71b0f
try to fix bound in ReferencedDmaManager
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1414
diff
changeset
|
48 memaddr readbuf = elm[0].addr; |
1511
34582cd8a7af
Fix compile error for cell
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1418
diff
changeset
|
49 #endif |
1415
774ea7a71b0f
try to fix bound in ReferencedDmaManager
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1414
diff
changeset
|
50 for(int i=0;i<list->length;i++) { |
774ea7a71b0f
try to fix bound in ReferencedDmaManager
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1414
diff
changeset
|
51 bound[i] = elm[i].addr-readbuf; |
774ea7a71b0f
try to fix bound in ReferencedDmaManager
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1414
diff
changeset
|
52 } |
774ea7a71b0f
try to fix bound in ReferencedDmaManager
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1414
diff
changeset
|
53 } |
1413
5b024efa2429
fix free on non copy DMA
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
54 |
1416 | 55 void * |
56 ReferencedDmaManager::get_writebuf(Scheduler *s,memaddr addr, uint32 size) | |
57 { | |
58 return (void*)addr; | |
59 } | |
60 | |
61 void * | |
62 ReferencedDmaManager::dma_store(void *buf, memaddr addr, uint32 size, uint32 mask) | |
63 { | |
1418 | 64 // void *to = (void*)addr; |
65 // if (buf != to) | |
66 // memcpy(to, buf, size); | |
1416 | 67 return (void*)addr; |
68 } | |
69 | |
70 void | |
71 ReferencedDmaManager::dma_storeList(ListDataPtr list, void *buff, uint32 mask) | |
72 { | |
73 } | |
74 | |
75 |