summaryrefslogtreecommitdiff
path: root/scripts/sysgen
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2016-10-13 15:44:48 -0500
committerAnas Nashif <nashif@linux.intel.com>2016-10-25 00:10:34 +0000
commit480a131ad94f8ddb375ec7cef5c7f7c0bb3e6a06 (patch)
tree3e827b4f65e5793f1fbaffa733c003930304b096 /scripts/sysgen
parent904cf972632de023cedc49e801c4c071cc35f79d (diff)
unified: Support heap memory pool
Fleshes out the prototype heap memory pool support to make it fully operational. Noteworthy changes are listed below: Tweaks arguments to k_malloc() and k_free() to be more like malloc() and free(). Similarly, modifies k_free() to take no action when passed a NULL pointer. Now stores the complete block descriptor at the start of any block allocated from the heap memory pool. This increases memory overhead by 4 bytes per block, but streamlines the allocation and freeing algorithms. It also ensures that the routines will work if the block descriptor internals are changed in the future. Now allows the heap memory pool to be defined using the HEAP_MEM_POOL_SIZE configuration option. This will be the official configuration approach in the unified kernel. Also allows the heap memory pool to be defined using the (undocumented) HEAP_SIZE entry in the MDEF. This is provided for legacy reasons only. Co-locates memory pool initialization code to keep the line that causes memory pool initialization to be done during booting right next to the routine that does the initialization. Change-Id: Ifea9d88142fb434d4bea38bb1fcc4856a3853d8d Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Diffstat (limited to 'scripts/sysgen')
-rwxr-xr-xscripts/sysgen5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/sysgen b/scripts/sysgen
index 9efdd78b3..5296118c9 100755
--- a/scripts/sysgen
+++ b/scripts/sysgen
@@ -898,6 +898,11 @@ def kernel_main_c_pools():
pool_descriptors += "K_MEM_POOL_DEFINE(_k_mem_pool_obj_%s, %d, %d, %d, 4);\n" % \
(pool[0], min_block_size, max_block_size,
num_maximal_blocks)
+
+ if (heap_pos_in_pool_list != -1):
+ kernel_main_c_out(
+ "\nkmemory_pool_t _heap_mem_pool_ptr = " +
+ "&_k_mem_pool_obj__HEAP_MEM_POOL;\n")
kernel_main_c_out(pool_descriptors)