summaryrefslogtreecommitdiff
path: root/scripts/sysgen
diff options
context:
space:
mode:
authorDaniel Leung <daniel.leung@intel.com>2015-08-04 10:15:43 -0700
committerAnas Nashif <anas.nashif@intel.com>2016-02-05 20:15:18 -0500
commit0abe07a0cdc262e55907d1b6d6600dec11c50579 (patch)
treed8c112433fc7a0b2f2c68c25f4068c7df203a10a /scripts/sysgen
parent201aa8c7082575378dfd7ba11163e35cb3d309c5 (diff)
microkernel: introduce support for private memory maps
This enable defining memory maps in source code in addition to defining in MDEF files. This introduces the macro DEFINE_MEM_MAP(mem_map_name, ...). The memory maps created this way are the same, in functionality, as those defined in MDEF files. They can be manipulated by the standard microkernel memory map APIs. Define the memory map using: DEFINE_MEM_MAP(mem_map1, blocks, block_size); and "mem_map1" can be used, for example: task_mem_map_alloc(mem_map1, ...); or, task_mem_map_free(mem_map1, ...); etc. To use the memory map defined in another source file, simply add: extern const kmemory_map_t mem_map1; to the desired C or header file. Change-Id: I9c551b90f9d0a95f961fd8ec1c5278c2ea44312d Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Diffstat (limited to 'scripts/sysgen')
-rwxr-xr-xscripts/sysgen6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/sysgen b/scripts/sysgen
index a2740aff4..b79785896 100755
--- a/scripts/sysgen
+++ b/scripts/sysgen
@@ -642,7 +642,8 @@ def kernel_main_c_maps():
block_size = map[2]
kernel_main_c_out(
"struct _k_mem_map_struct _k_mem_map_obj_%s = " % (name) +
- " { %d, %d, __MAP_%s_buffer };\n" % (blocks, block_size, map[0]) +
+ " __K_MEM_MAP_INITIALIZER(%d, %d, __MAP_%s_buffer);\n" %
+ (blocks, block_size, map[0]) +
"kmemory_map_t _k_mem_map_ptr_%s " % (name) +
" __section(_k_mem_map_ptr, public, mem_map) =\n" +
" (kmemory_map_t)&_k_mem_map_obj_%s;\n" % (name))
@@ -742,8 +743,7 @@ def kernel_main_c_node_init():
kernel_main_c_out("\n" +
"void _k_init_node(void)\n{\n")
kernel_main_c_out(" _k_pipe_init();\n")
- if (len(map_list) > 0):
- kernel_main_c_out(" _k_mem_map_init();\n")
+ kernel_main_c_out(" _k_mem_map_init();\n")
if (len(pool_list) > 0):
kernel_main_c_out(" _k_mem_pool_init();\n")
kernel_main_c_out("}\n")