diff options
author | Guillaume Aubertin | 2012-08-03 08:41:43 -0500 |
---|---|---|
committer | Guillaume Aubertin | 2012-08-06 08:46:05 -0500 |
commit | 702c135832c645dc986d817641145ff7438d1a06 (patch) | |
tree | 3cd9fa2ed61ece4f25301970596a27a9991f706e | |
parent | 426e09975c78914141e4f67dd78e90a818d6562b (diff) | |
download | dce-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.c | 19 | ||||
-rw-r--r-- | ducati/ti/dce/ivahd.c | 17 |
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: */ |
51 | extern void start_ping_tasks(); | 53 | extern void start_ping_tasks(); |
52 | 54 | ||
55 | static 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 | |||
65 | void *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 | |||
53 | int main(int argc, char **argv) | 72 | int 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 | ||
265 | static 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 | |||
275 | void *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 | |||
282 | static Bool allocFxn(IALG_MemRec *memTab, Int numRecs); | 265 | static Bool allocFxn(IALG_MemRec *memTab, Int numRecs); |
283 | static void freeFxn(IALG_MemRec *memTab, Int numRecs); | 266 | static void freeFxn(IALG_MemRec *memTab, Int numRecs); |
284 | 267 | ||