hv: remove dynamic memory allocation APIs

This patch removes dynamic memory allocation APIs, including:
- calloc
- malloc
- free

The corresponding data structures, MACROs, and Kconfig items
are also removed.

v1 -> v2: no change

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
This commit is contained in:
Shiqing Gao
2019-05-09 13:30:11 +08:00
committed by ACRN System Integration
parent 773889bb65
commit dbb41575e7
4 changed files with 0 additions and 285 deletions

View File

@@ -1,29 +0,0 @@
/*
* Copyright (C) 2018 Intel Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef MEM_MGT_H
#define MEM_MGT_H
/* Macros */
#define BITMAP_WORD_SIZE 32U
struct mem_pool {
void *start_addr; /* Start Address of Memory Pool */
spinlock_t spinlock; /* To protect Memory Allocation */
uint32_t size; /* Size of Memory Pool in Bytes */
uint32_t buff_size; /* Size of one Buffer in Bytes */
uint32_t total_buffs; /* Total Buffers in Memory Pool */
uint32_t bmp_size; /* Size of Bitmap Array */
uint32_t *bitmap; /* Pointer to allocation bitmap */
uint32_t *contiguity_bitmap; /* Pointer to contiguity bitmap */
};
/* APIs exposing memory allocation/deallocation abstractions */
void *malloc(uint32_t num_bytes);
void *calloc(uint32_t num_elements, uint32_t element_size);
void free(const void *ptr);
#endif /* MEM_MGT_H */