qcacmn: Add qdf_talloc APIs

Add APIs for t(ree) alloc(ated) memory management.

These APIs allocate memory like malloc, but track those allocations via
a parent-child relationship, or tree. If the parent is freed while it
still has children, a panic will be triggered. This effectively gives
you the ability to limit the lifetime of an allocation by ensuring the
child allocation lifetime will be strictly less than the parent
allocation lifetime.

Change-Id: I6308c96061e125b2e5a9c424ec2d2298c1c503ab
CRs-Fixed: 2359469
此提交包含在:
Dustin Brown
2018-11-16 16:27:22 -08:00
提交者 nshrivas
父節點 ce57c688b9
當前提交 7c32e412b8
共有 8 個檔案被更改,包括 804 行新增6 行删除

查看文件

@@ -465,6 +465,32 @@ void qdf_mem_multi_pages_free(qdf_device_t osdev,
int qdf_mem_multi_page_link(qdf_device_t osdev,
struct qdf_mem_multi_page_t *pages,
uint32_t elem_size, uint32_t elem_count, uint8_t cacheable);
#ifdef WLAN_DEBUGFS
/**
* qdf_mem_kmalloc_inc() - increment kmalloc allocated bytes count
* @size: number of bytes to increment by
*
* Return: None
*/
void qdf_mem_kmalloc_inc(qdf_size_t size);
/**
* qdf_mem_kmalloc_dec() - decrement kmalloc allocated bytes count
* @size: number of bytes to decrement by
*
* Return: None
*/
void qdf_mem_kmalloc_dec(qdf_size_t size);
#else
static inline void qdf_mem_kmalloc_inc(qdf_size_t size) { }
static inline void qdf_mem_kmalloc_dec(qdf_size_t size) { }
#endif /* WLAN_DEBUGFS */
/**
* qdf_mem_skb_inc() - increment total skb allocation size
* @size: size to be added