aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Aubertin2012-08-03 08:41:43 -0500
committerGuillaume Aubertin2012-08-06 08:46:05 -0500
commit702c135832c645dc986d817641145ff7438d1a06 (patch)
tree3cd9fa2ed61ece4f25301970596a27a9991f706e
parent426e09975c78914141e4f67dd78e90a818d6562b (diff)
downloaddce-702c135832c645dc986d817641145ff7438d1a06.tar.gz
dce-702c135832c645dc986d817641145ff7438d1a06.tar.xz
dce-702c135832c645dc986d817641145ff7438d1a06.zip
moving MEMUTILS_getPhysicalAddr to baseimage
This function is usually based in the baseimage, so we move it to libdce's baseimage to avoid conflicts when using dce as a library (ti.dce)
-rw-r--r--ducati/ti/dce/baseimage/main.c19
-rw-r--r--ducati/ti/dce/ivahd.c17
2 files changed, 19 insertions, 17 deletions
diff --git a/ducati/ti/dce/baseimage/main.c b/ducati/ti/dce/baseimage/main.c
index 841f331..8ad2975 100644
--- a/ducati/ti/dce/baseimage/main.c
+++ b/ducati/ti/dce/baseimage/main.c
@@ -39,9 +39,11 @@
39#include <ti/sysbios/BIOS.h> 39#include <ti/sysbios/BIOS.h>
40#include <ti/sysbios/knl/Task.h> 40#include <ti/sysbios/knl/Task.h>
41#include <ti/ipc/rpmsg/VirtQueue.h> 41#include <ti/ipc/rpmsg/VirtQueue.h>
42#include <ti/resources/IpcMemory.h>
42 43
43#include <ti/grcm/RcmTypes.h> 44#include <ti/grcm/RcmTypes.h>
44#include <ti/grcm/RcmServer.h> 45#include <ti/grcm/RcmServer.h>
46#include <ti/dce/dce_priv.h>
45 47
46#include <stdio.h> 48#include <stdio.h>
47#include <string.h> 49#include <string.h>
@@ -50,6 +52,23 @@
50/* Legacy function to allow Linux side rpmsg sample tests to work: */ 52/* Legacy function to allow Linux side rpmsg sample tests to work: */
51extern void start_ping_tasks(); 53extern void start_ping_tasks();
52 54
55static unsigned int SyslinkMemUtils_VirtToPhys(Ptr Addr)
56{
57 unsigned int pa;
58
59 if( !Addr || IpcMemory_virtToPhys((unsigned int) Addr, &pa)) {
60 return (0);
61 }
62 return (pa);
63}
64
65void *MEMUTILS_getPhysicalAddr(Ptr vaddr)
66{
67 unsigned int paddr = SyslinkMemUtils_VirtToPhys(vaddr);
68 DEBUG("virtual addr:%x\tphysical addr:%x", vaddr, paddr);
69 return (void *)paddr;
70}
71
53int main(int argc, char **argv) 72int main(int argc, char **argv)
54{ 73{
55 extern void start_load_task(void); 74 extern void start_load_task(void);
diff --git a/ducati/ti/dce/ivahd.c b/ducati/ti/dce/ivahd.c
index 45a0d9d..bb5e33f 100644
--- a/ducati/ti/dce/ivahd.c
+++ b/ducati/ti/dce/ivahd.c
@@ -262,23 +262,6 @@ void ivahd_release(void)
262 Hwi_restore(hwiKey); 262 Hwi_restore(hwiKey);
263} 263}
264 264
265static unsigned int SyslinkMemUtils_VirtToPhys(Ptr Addr)
266{
267 unsigned int pa;
268
269 if( !Addr || IpcMemory_virtToPhys((unsigned int) Addr, &pa)) {
270 return (0);
271 }
272 return (pa);
273}
274
275void *MEMUTILS_getPhysicalAddr(Ptr vaddr)
276{
277 unsigned int paddr = SyslinkMemUtils_VirtToPhys(vaddr);
278 DEBUG("virtual addr:%x\tphysical addr:%x", vaddr, paddr);
279 return (void *)paddr;
280}
281
282static Bool allocFxn(IALG_MemRec *memTab, Int numRecs); 265static Bool allocFxn(IALG_MemRec *memTab, Int numRecs);
283static void freeFxn(IALG_MemRec *memTab, Int numRecs); 266static void freeFxn(IALG_MemRec *memTab, Int numRecs);
284 267