6#ifndef ZEPHYR_INCLUDE_APP_MEMORY_APP_MEMDOMAIN_H_
7#define ZEPHYR_INCLUDE_APP_MEMORY_APP_MEMDOMAIN_H_
20#ifdef CONFIG_USERSPACE
30#define K_APP_DMEM_SECTION(id) data_smem_##id##_data
40#define K_APP_BMEM_SECTION(id) data_smem_##id##_bss
51#define K_APP_DMEM(id) Z_GENERIC_SECTION(K_APP_DMEM_SECTION(id))
61#define K_APP_BMEM(id) Z_GENERIC_SECTION(K_APP_BMEM_SECTION(id))
68#define Z_APP_START(id) z_data_smem_##id##_part_start
69#define Z_APP_SIZE(id) z_data_smem_##id##_part_size
70#define Z_APP_BSS_START(id) z_data_smem_##id##_bss_start
71#define Z_APP_BSS_SIZE(id) z_data_smem_##id##_bss_size
87#if defined(CONFIG_ARM) || defined(CONFIG_ARM64)
91#define Z_PROGBITS_SYM "%"
93#define Z_PROGBITS_SYM "@"
96#if defined(CONFIG_ARC) && defined(__CCAC__)
100#define Z_PUSHSECTION_DIRECTIV ".pushsect"
101#define Z_POPSECTION_DIRECTIVE ".popsect"
103#define Z_PUSHSECTION_DIRECTIV ".pushsection"
104#define Z_POPSECTION_DIRECTIVE ".popsection"
107#define Z_APPMEM_PLACEHOLDER(name) \
109 Z_PUSHSECTION_DIRECTIV " " STRINGIFY(K_APP_DMEM_SECTION(name)) \
110 ",\"aw\"," Z_PROGBITS_SYM "progbits\n\t" \
111 ".global " STRINGIFY(name) "_placeholder\n\t" \
112 STRINGIFY(name) "_placeholder:\n\t" \
113 Z_POPSECTION_DIRECTIVE "\n\t")
127#define K_APPMEM_PARTITION_DEFINE(name) \
128 extern char Z_APP_START(name)[]; \
129 extern char Z_APP_SIZE(name)[]; \
130 struct k_mem_partition name = { \
131 .start = (uintptr_t) &Z_APP_START(name)[0], \
132 .size = (size_t) &Z_APP_SIZE(name)[0], \
133 .attr = K_MEM_PARTITION_P_RW_U_RW \
135 extern char Z_APP_BSS_START(name)[]; \
136 extern char Z_APP_BSS_SIZE(name)[]; \
137 Z_GENERIC_SECTION(.app_regions.name) \
138 const struct z_app_region name##_region = { \
139 .bss_start = &Z_APP_BSS_START(name)[0], \
140 .bss_size = (size_t) &Z_APP_BSS_SIZE(name)[0] \
142 Z_APPMEM_PLACEHOLDER(name)
145#define K_APP_BMEM(ptn)
146#define K_APP_DMEM(ptn)
147#define K_APP_DMEM_SECTION(ptn) .data
148#define K_APP_BMEM_SECTION(ptn) .bss
149#define K_APPMEM_PARTITION_DEFINE(name)