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
00224
00225
00226
00235 extern Void Memory_cacheWbInvAll();
00236
00239
00240
00241
00273 extern Ptr Memory_contigAlloc(UInt size, UInt align);
00274
00275
00276
00277
00278
00297 extern Bool Memory_contigFree(Ptr addr, UInt size);
00298
00299
00302
00303
00304
00323 extern Bool Memory_contigStat(Memory_Stat *statbuf);
00324
00328
00329
00330
00350 extern Bool Memory_free(Ptr addr, UInt size, Memory_AllocParams *params);
00351
00352
00353
00354
00355
00371 extern Void Memory_dumpKnownContigBufsList(Void);
00372
00373
00374
00375
00376
00413 extern UInt32 Memory_getBufferPhysicalAddress(Ptr virtualAddress,
00414 Int sizeInBytes, Bool *isContiguous);
00415
00416
00417
00418
00432 extern Int Memory_getHeapId(String name);
00433
00434
00435
00436
00446 extern Int Memory_getNumHeaps();
00447
00448
00451 #ifdef ti_sdo_ce_osal_Memory_USEDEPRECATEDAPIS
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461 static inline UInt32 Memory_getPhysicalAddress(Ptr virtualAddress)
00462 {
00463 return(Memory_getBufferPhysicalAddress(virtualAddress, 4, NULL));
00464 }
00465
00466 #endif
00467
00471
00472
00473
00503 extern Ptr Memory_getBufferVirtualAddress(UInt32 physicalAddress,
00504 Int sizeInBytes);
00505
00508
00509
00510
00511 extern Bool Memory_init(Void);
00512
00513
00514
00515
00516
00517 extern Void Memory_exit(Void);
00518
00519
00520
00521
00522
00539 extern Bool Memory_redefine(Int segId, Uint32 base, Uint32 size);
00540
00543
00544
00545
00575 extern Void Memory_registerContigBuf(UInt32 virtualAddress, UInt32 sizeInBytes,
00576 UInt32 physicalAddress);
00577
00580
00581
00582
00596 extern Bool Memory_restoreHeap(Int segId);
00597
00598
00599
00600
00619 extern Ptr Memory_segAlloc(Int segId, UInt size, UInt align);
00620
00621
00622
00623
00624
00650 extern Bool Memory_segFree(Int segId, Ptr addr, UInt size);
00651
00652
00653
00654
00655
00675 extern Bool Memory_segStat(Int segId, Memory_Stat *statbuf);
00676
00679
00680
00681
00698 extern Void Memory_unregisterContigBuf(UInt32 virtualAddress,
00699 UInt32 sizeInBytes);
00700
00701
00703
00704 #ifdef __cplusplus
00705 }
00706 #endif
00707
00708 #endif
00709
00710
00711
00712
00713