Codec Engine Application Programming Interface (API)  ce-w08
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Memory.h
Go to the documentation of this file.
1 /*
2  * Copyright 2013 by Texas Instruments Incorporated.
3  *
4  */
5 
6 /*
7  * Copyright (c) 2013, Texas Instruments Incorporated
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  *
14  * * Redistributions of source code must retain the above copyright
15  * notice, this list of conditions and the following disclaimer.
16  *
17  * * Redistributions in binary form must reproduce the above copyright
18  * notice, this list of conditions and the following disclaimer in the
19  * documentation and/or other materials provided with the distribution.
20  *
21  * * Neither the name of Texas Instruments Incorporated nor the names of
22  * its contributors may be used to endorse or promote products derived
23  * from this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
27  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
29  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
32  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
33  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
34  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
35  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  *
37  */
38 /*
39  * ======== Memory.h ========
40  */
56 #ifndef ti_sdo_ce_osal_Memory_
57 #define ti_sdo_ce_osal_Memory_
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
65 
73 #define ti_sdo_ce_osal_Memory_DEFAULTALIGNMENT ((UInt)(-1))
74 
83 #define Memory_MODNAME "ti.sdo.ce.osal.Memory"
84 
90 #define ti_sdo_ce_osal_Memory_GTNAME "OM"
91 
101 typedef struct ti_sdo_ce_osal_Memory_Stat {
102  String name;
103  Uint32 base;
104  UInt size;
105  UInt used;
106  UInt length;
107 } ti_sdo_ce_osal_Memory_Stat;
108 
118 typedef enum {
136 
150  UInt flags;
166  UInt align;
167  UInt seg;
169 
170 
178 #define ti_sdo_ce_osal_Memory_CACHED 0x00000000
179 
187 #define ti_sdo_ce_osal_Memory_NONCACHED 0x00000001
188 
196 #define ti_sdo_ce_osal_Memory_CACHEDMASK 0x00000001
197 
223 
224 /*
225  * ======== Memory_alloc ========
226  */
242 extern Ptr ti_sdo_ce_osal_Memory_alloc(UInt size,
244 
245 /*
246  * ======== Memory_cacheInv ========
247  */
266 extern Void ti_sdo_ce_osal_Memory_cacheInv(Ptr addr, Int sizeInBytes);
267 
268 
269 /*
270  * ======== Memory_cacheWb ========
271  */
284 extern Void ti_sdo_ce_osal_Memory_cacheWb(Ptr addr, Int sizeInBytes);
285 
286 
287 /*
288  * ======== Memory_cacheWbInv ========
289  */
302 extern Void ti_sdo_ce_osal_Memory_cacheWbInv(Ptr addr, Int sizeInBytes);
303 
304 
305 /*
306  * ======== Memory_cacheWbInvAll ========
307  */
319 
320 
321 /*
322  * ======== Memory_contigAlloc ========
323  */
358 extern Ptr ti_sdo_ce_osal_Memory_contigAlloc(UInt size, UInt align);
359 
360 
361 /*
362  * ======== Memory_contigFree ========
363  */
385 extern Bool ti_sdo_ce_osal_Memory_contigFree(Ptr addr, UInt size);
386 
387 
390 /*
391  * ======== Memory_contigStat ========
392  */
411 extern Bool ti_sdo_ce_osal_Memory_contigStat(ti_sdo_ce_osal_Memory_Stat *stat);
412 
416 /*
417  * ======== Memory_free ========
418  */
444 extern Bool ti_sdo_ce_osal_Memory_free(Ptr addr, UInt size,
446 
447 
448 /*
449  * ======== Memory_dumpKnownContigBufs ========
450  */
467 
468 
469 /*
470  * ======== Memory_getBufferPhysicalAddress ========
471  */
510 extern UInt32 ti_sdo_ce_osal_Memory_getBufferPhysicalAddress(Ptr virtualAddress,
511  Int sizeInBytes, Bool *isContiguous);
512 
513 /*
514  * ======== Memory_getHeapId ========
515  */
530 extern Int ti_sdo_ce_osal_Memory_getHeapId(String name);
531 
532 /*
533  * ======== Memory_getNumHeaps ========
534  */
544 
545 
546 /*
547  * ======== Memory_getBufferVirtualAddress ========
548  */
584 extern Ptr ti_sdo_ce_osal_Memory_getBufferVirtualAddress(UInt32 physicalAddress,
585  Int sizeInBytes);
586 
589 /*
590  * ======== Memory_init ========
591  */
592 extern Bool ti_sdo_ce_osal_Memory_init(Void);
593 
594 
595 /*
596  * ======== Memory_exit ========
597  */
598 extern Void ti_sdo_ce_osal_Memory_exit(Void);
599 
600 
603 /*
604  * ======== Memory_registerContigBuf ========
605  */
635 extern Void ti_sdo_ce_osal_Memory_registerContigBuf(UInt32 virtualAddress,
636  UInt32 sizeInBytes, UInt32 physicalAddress);
637 
640 /*
641  * ======== Memory_redefine ========
642  */
659 extern Bool ti_sdo_ce_osal_Memory_redefine(Int segId, Uint32 base, Uint32 size);
660 
661 /*
662  * ======== Memory_restoreHeap ========
663  */
677 extern Bool ti_sdo_ce_osal_Memory_restoreHeap(Int segId);
678 
679 /*
680  * ======== Memory_segAlloc ========
681  */
702 extern Ptr ti_sdo_ce_osal_Memory_segAlloc(Int segId, UInt size, UInt align);
703 
704 
705 /*
706  * ======== Memory_segFree ========
707  */
736 extern Bool ti_sdo_ce_osal_Memory_segFree(Int segId, Ptr addr, UInt size);
737 
738 
739 /*
740  * ======== Memory_segStat ========
741  */
763 extern Bool ti_sdo_ce_osal_Memory_segStat(Int segId,
764  ti_sdo_ce_osal_Memory_Stat *statbuf);
765 
768 /*
769  * ======== Memory_unregisterContigBuf ========
770  */
787 extern Void ti_sdo_ce_osal_Memory_unregisterContigBuf(UInt32 virtualAddress,
788  UInt32 sizeInBytes);
789 
792 /*
793  * ======== PREFIX ALIASES ========
794  * Same strategy as XDC uses
795  */
796 #if !defined(__nested__) && !defined(ti_sdo_ce_osal_Memory__nolocalnames)
797 
798 /* module prefix */
799 #define Memory_DEFAULTALIGNMENT ti_sdo_ce_osal_Memory_DEFAULTALIGNMENT
800 #define Memory_GTNAME ti_sdo_ce_osal_Memory_GTNAME
801 #define Memory_Stat ti_sdo_ce_osal_Memory_Stat
802 #define Memory_type ti_sdo_ce_osal_Memory_type
803 #define Memory_MALLOC ti_sdo_ce_osal_Memory_MALLOC
804 #define Memory_SEG ti_sdo_ce_osal_Memory_SEG
805 #define Memory_CONTIGPOOL ti_sdo_ce_osal_Memory_CONTIGPOOL
806 #define Memory_CONTIGHEAP ti_sdo_ce_osal_Memory_CONTIGHEAP
807 #define Memory_AllocParams ti_sdo_ce_osal_Memory_AllocParams
808 #define Memory_CACHED ti_sdo_ce_osal_Memory_CACHED
809 #define Memory_NONCACHED ti_sdo_ce_osal_Memory_NONCACHED
810 #define Memory_CACHEDMASK ti_sdo_ce_osal_Memory_CACHEDMASK
811 #define Memory_DEFAULTPARAMS ti_sdo_ce_osal_Memory_DEFAULTPARAMS
812 
813 #define Memory_alloc ti_sdo_ce_osal_Memory_alloc
814 #define Memory_cacheInv ti_sdo_ce_osal_Memory_cacheInv
815 #define Memory_cacheWb ti_sdo_ce_osal_Memory_cacheWb
816 #define Memory_cacheWbInv ti_sdo_ce_osal_Memory_cacheWbInv
817 #define Memory_cacheWbInvAll ti_sdo_ce_osal_Memory_cacheWbInvAll
818 #define Memory_contigAlloc ti_sdo_ce_osal_Memory_contigAlloc
819 #define Memory_contigFree ti_sdo_ce_osal_Memory_contigFree
820 #define Memory_contigStat ti_sdo_ce_osal_Memory_contigStat
821 #define Memory_dumpKnownContigBufsList ti_sdo_ce_osal_Memory_dumpKnownContigBufsList
822 #define Memory_free ti_sdo_ce_osal_Memory_free
823 #define Memory_getBufferPhysicalAddress ti_sdo_ce_osal_Memory_getBufferPhysicalAddress
824 #define Memory_getBufferVirtualAddress ti_sdo_ce_osal_Memory_getBufferVirtualAddress
825 #define Memory_getHeapId ti_sdo_ce_osal_Memory_getHeapId
826 #define Memory_getNumHeaps ti_sdo_ce_osal_Memory_getNumHeaps
827 #define Memory_init ti_sdo_ce_osal_Memory_init
828 #define Memory_exit ti_sdo_ce_osal_Memory_exit
829 #define Memory_redefine ti_sdo_ce_osal_Memory_redefine
830 #define Memory_registerContigBuf ti_sdo_ce_osal_Memory_registerContigBuf
831 #define Memory_unregisterContigBuf ti_sdo_ce_osal_Memory_unregisterContigBuf
832 #define Memory_restoreHeap ti_sdo_ce_osal_Memory_restoreHeap
833 #define Memory_segAlloc ti_sdo_ce_osal_Memory_segAlloc
834 #define Memory_segFree ti_sdo_ce_osal_Memory_segFree
835 #define Memory_segStat ti_sdo_ce_osal_Memory_segStat
836 #define Memory_skipVirtualAddressTranslation ti_sdo_ce_osal_Memory_skipVirtualAddressTranslation
837 #define Memory_maxCbListSize ti_sdo_ce_osal_Memory_maxCbListSize
838 #endif
839 
843 
844 #ifdef __cplusplus
845 }
846 #endif
847 
848 #endif
849 /*
850  * @(#) ti.sdo.ce.osal; 2, 0, 2,3; 6-13-2013 00:16:36; /db/atree/library/trees/ce/ce-w08/src/ xlibrary
851 
852  */
853 
Copyright 2013, Texas Instruments Incorporated