WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
chip_mem.h 文件参考
#include <stdio.h>
#include "securec.h"
#include "non_os.h"
#include "panic.h"
#include "debug_print.h"
chip_mem.h 的引用(Include)关系图:

浏览源代码.

结构体

struct  conn_mem_subpool_stru
 
struct  conn_mem_subpool_cfg_stru
 
struct  conn_mem_pool_cfg_stru
 
struct  conn_mem_stru_tag
 
struct  conn_mem_pool_stru
 

宏定义

#define CONN_DOG_TAG_SIZE   4
 
#define CONN_DOG_TAG   0xdeadbeaf
 
#define conn_irq_disable   non_os_enter_critical
 
#define conn_irq_enable   non_os_exit_critical
 
#define CONN_IO_PRINT   PRINT
 
#define conn_likely(_expr)   (_expr)
 
#define conn_unlikely(_expr)   (_expr)
 
#define conn_bug_on(cond)
 
#define CONN_MEM_INFO_SIZE   4 /* sizeof(ptr) */
 
#define WLAN_MEM_MAX_SUBPOOL_NUM   32 /* Maximum memory sub-pool size supported by each memory pool */
 
#define conn_get_4byte_align_value(_ul_size)   (((_ul_size) + 0x03) & (~0x03))
 
#define conn_array_size(_ast_array)   (sizeof(_ast_array) / sizeof((_ast_array)[0]))
 
#define _PRE_MEM_DEBUG_MODE
 

类型定义

typedef struct conn_mem_stru_tag conn_mem_stru
 

枚举

enum  conn_mem_state_enum { CONN_MEM_STATE_FREE = 0 , CONN_MEM_STATE_ALLOC , CONN_MEM_STATE_BUTT }
 
enum  conn_mem_pool_id_enum { CONN_MEM_POOL_ID_LOCAL = 0 , CONN_MEM_POOL_ID_BUTT }
 

函数

int conn_mem_init_pool (unsigned char *start, unsigned int size)
 Prototype : conn_mem_init_pool Description : mem pool init function, only call once Input : void* start the pool start base address, start must aligned to 4 bytes unsigned int size pool total size, aligned to 4 bytes Return Value : 0 means succ, others failed
 
void conn_mem_print_pool_info (void)
 
void * conn_mem_alloc_enhanced (unsigned long return_addr, unsigned int us_len)
 Prototype : conn_mem_alloc_enhanced Description : mem alloc function, Input : unsigned long return_addr call function's address for debug unsigned int us_len request mem length Return Value : void* NULL means failed, others succ, alloc mem aligned to 4 bytes
 
void conn_mem_free_enhanced (const void *free_mem)
 Prototype : conn_mem_free_enhanced Description : mem free function, can't free the mem repeat, Input : void* free_mem , free the alloc mem, if zero, do nothing Return Value : void
 
void * conn_mem_realloc_enhanced (unsigned long return_addr, const void *mem, unsigned int us_len)
 Prototype : conn_mem_realloc_enhanced Description : mem realloc function Input : unsigned long return_addr call function's address for debug void* mem the old mem unsigned int us_len request mem length Return Value : void* NULL means failed, others succ, alloc mem aligned to 4 bytes
 

宏定义说明

◆ _PRE_MEM_DEBUG_MODE

#define _PRE_MEM_DEBUG_MODE

◆ conn_array_size

#define conn_array_size (   _ast_array)    (sizeof(_ast_array) / sizeof((_ast_array)[0]))

◆ conn_bug_on

#define conn_bug_on (   cond)
值:
do { \
if (cond) { \
panic(PANIC_IRMALLOC_FAIL, (uintptr_t)__LINE__); \
} \
} while (0)
@ PANIC_IRMALLOC_FAIL
Definition panic.h:23
unsigned int uintptr_t
Definition td_type.h:65

◆ CONN_DOG_TAG

#define CONN_DOG_TAG   0xdeadbeaf

◆ CONN_DOG_TAG_SIZE

#define CONN_DOG_TAG_SIZE   4

Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2022-2022. All rights reserved.

Description: Mem Pool Driver Header.
History:
2018-10-15, Create file.

◆ conn_get_4byte_align_value

#define conn_get_4byte_align_value (   _ul_size)    (((_ul_size) + 0x03) & (~0x03))

◆ CONN_IO_PRINT

#define CONN_IO_PRINT   PRINT

◆ conn_irq_disable

#define conn_irq_disable   non_os_enter_critical

◆ conn_irq_enable

#define conn_irq_enable   non_os_exit_critical

◆ conn_likely

#define conn_likely (   _expr)    (_expr)

◆ CONN_MEM_INFO_SIZE

#define CONN_MEM_INFO_SIZE   4 /* sizeof(ptr) */

◆ conn_unlikely

#define conn_unlikely (   _expr)    (_expr)

◆ WLAN_MEM_MAX_SUBPOOL_NUM

#define WLAN_MEM_MAX_SUBPOOL_NUM   32 /* Maximum memory sub-pool size supported by each memory pool */

类型定义说明

◆ conn_mem_stru

枚举类型说明

◆ conn_mem_pool_id_enum

枚举值
CONN_MEM_POOL_ID_LOCAL 
CONN_MEM_POOL_ID_BUTT 

◆ conn_mem_state_enum

枚举值
CONN_MEM_STATE_FREE 
CONN_MEM_STATE_ALLOC 
CONN_MEM_STATE_BUTT 

函数说明

◆ conn_mem_alloc_enhanced()

void * conn_mem_alloc_enhanced ( unsigned long  return_addr,
unsigned int  us_len 
)

Prototype : conn_mem_alloc_enhanced Description : mem alloc function, Input : unsigned long return_addr call function's address for debug unsigned int us_len request mem length Return Value : void* NULL means failed, others succ, alloc mem aligned to 4 bytes

◆ conn_mem_free_enhanced()

void conn_mem_free_enhanced ( const void *  free_mem)

Prototype : conn_mem_free_enhanced Description : mem free function, can't free the mem repeat, Input : void* free_mem , free the alloc mem, if zero, do nothing Return Value : void

◆ conn_mem_init_pool()

int conn_mem_init_pool ( unsigned char *  start,
unsigned int  size 
)

Prototype : conn_mem_init_pool Description : mem pool init function, only call once Input : void* start the pool start base address, start must aligned to 4 bytes unsigned int size pool total size, aligned to 4 bytes Return Value : 0 means succ, others failed

◆ conn_mem_print_pool_info()

void conn_mem_print_pool_info ( void  )

◆ conn_mem_realloc_enhanced()

void * conn_mem_realloc_enhanced ( unsigned long  return_addr,
const void *  mem,
unsigned int  us_len 
)

Prototype : conn_mem_realloc_enhanced Description : mem realloc function Input : unsigned long return_addr call function's address for debug void* mem the old mem unsigned int us_len request mem length Return Value : void* NULL means failed, others succ, alloc mem aligned to 4 bytes