Memory.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00046 #ifndef ti_sdo_ce_osal_Memory_
00047 #define ti_sdo_ce_osal_Memory_
00048
00049 #ifdef __cplusplus
00050 extern "C" {
00051 #endif
00052
00055
00056
00057
00058
00059 #define Memory_DEFAULTALIGNMENT ((UInt)(-1))
00060
00061
00062
00063
00064 #define Memory_GTNAME "OM"
00065
00073 typedef struct Memory_Stat {
00074 String name;
00075 Uint32 base;
00076 UInt size;
00077 UInt used;
00078 UInt length;
00079 } Memory_Stat;
00080
00088 typedef enum {
00089 Memory_MALLOC = 0,
00090 Memory_SEG = 1,
00091 Memory_CONTIGPOOL = 2,
00092 Memory_CONTIGHEAP =3
00093 } Memory_type;
00094
00100 typedef struct Memory_AllocParams {
00101 Memory_type type;
00105 UInt flags;
00110 UInt align;
00111 UInt seg;
00112 } Memory_AllocParams;
00113
00114
00115 #define Memory_CACHED 0x00000000
00119 #define Memory_NONCACHED 0x00000001
00124 #define Memory_CACHEDMASK 0x00000001
00149 extern Memory_AllocParams Memory_DEFAULTPARAMS;
00150
00151
00152
00153
00167 extern Ptr Memory_alloc(UInt size, Memory_AllocParams *params);
00168
00169
00170
00171
00188 extern Void Memory_cacheInv(Ptr addr, Int sizeInBytes);
00189
00190
00191
00192
00193
00204 extern Void Memory_cacheWb(Ptr addr, Int sizeInBytes);
00205
00206
00207
00208
00209
00220 extern Void Memory_cacheWbInv(Ptr addr, Int sizeInBytes);
00221
00222
00223
00224
00225
00257 extern Ptr Memory_contigAlloc(UInt size, UInt align);
00258
00259
00260
00261
00262
00281 extern Bool Memory_contigFree(Ptr addr, UInt size);
00282
00283
00286
00287
00288
00307 extern Bool Memory_contigStat(Memory_Stat *statbuf);
00308
00312
00313
00314
00334 extern Bool Memory_free(Ptr addr, UInt size, Memory_AllocParams *params);
00335
00336
00337
00338
00339
00355 extern Void Memory_dumpKnownContigBufsList(Void);
00356
00357
00358
00359
00360
00397 extern UInt32 Memory_getBufferPhysicalAddress(Ptr virtualAddress,
00398 Int sizeInBytes, Bool *isContiguous);
00399
00400
00401
00402
00416 extern Int Memory_getHeapId(String name);
00417
00418
00419
00420
00430 extern Int Memory_getNumHeaps();
00431
00432
00435 #ifdef ti_sdo_ce_osal_Memory_USEDEPRECATEDAPIS
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445 static inline UInt32 Memory_getPhysicalAddress(Ptr virtualAddress)
00446 {
00447 return(Memory_getBufferPhysicalAddress(virtualAddress, 4, NULL));
00448 }
00449
00450 #endif
00451
00455
00456
00457
00487 extern Ptr Memory_getBufferVirtualAddress(UInt32 physicalAddress,
00488 Int sizeInBytes);
00489
00492
00493
00494
00495 extern Bool Memory_init(Void);
00496
00497
00498
00499
00500
00501 extern Void Memory_exit(Void);
00502
00503
00504
00505
00506
00523 extern Bool Memory_redefine(Int segId, Uint32 base, Uint32 size);
00524
00527
00528
00529
00559 extern Void Memory_registerContigBuf(UInt32 virtualAddress, UInt32 sizeInBytes,
00560 UInt32 physicalAddress);
00561
00564
00565
00566
00580 extern Bool Memory_restoreHeap(Int segId);
00581
00582
00583
00584
00603 extern Ptr Memory_segAlloc(Int segId, UInt size, UInt align);
00604
00605
00606
00607
00608
00634 extern Bool Memory_segFree(Int segId, Ptr addr, UInt size);
00635
00636
00637
00638
00639
00659 extern Bool Memory_segStat(Int segId, Memory_Stat *statbuf);
00660
00663
00664
00665
00682 extern Void Memory_unregisterContigBuf(UInt32 virtualAddress,
00683 UInt32 sizeInBytes);
00684
00685
00687
00688 #ifdef __cplusplus
00689 }
00690 #endif
00691
00692 #endif
00693
00694
00695
00696