123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- #ifndef OSAL_MEMORY_H
- #define OSAL_MEMORY_H
- #ifdef __cplusplus
- extern "C"
- {
- #endif
- #include "comdef.h"
-
- #if !defined ( OSALMEM_METRICS )
- #define OSALMEM_METRICS FALSE
- #endif
-
- typedef struct {
-
- unsigned short len : 15;
-
- unsigned short inUse : 1;
- } osalMemHdrHdr_t;
- typedef union {
-
- halDataAlign_t alignDummy;
- uint32 val;
- osalMemHdrHdr_t hdr;
- } osalMemHdr_t;
-
-
- void osal_mem_init( void );
-
- void osal_mem_kick( void );
-
- void *osal_mem_alloc( uint16 size );
-
- void osal_mem_free( void *ptr );
-
-
-
- void osal_mem_set_heap(osalMemHdr_t *hdr, uint32 size);
- #if ( OSALMEM_METRICS )
-
- uint16 osal_heap_block_max( void );
-
- uint16 osal_heap_block_cnt( void );
-
- uint16 osal_heap_block_free( void );
-
- uint16 osal_heap_mem_used( void );
- #endif
- #ifdef __cplusplus
- }
- #endif
- #endif
|