Skip to content
Permalink
Browse files

arch: arm: expose start/end limits of the thread priv stack section

We introduce linker symbols to hold the start and end address of
the memory area holding the thread privilege stack buffers,
applicable when building with support for User Mode.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
  • Loading branch information...
ioannisg authored and andrewboie committed Jun 14, 2019
1 parent 88959e7 commit f15c12d482a9aa1c95daf6ad15c631e78b6a88ad
Showing with 13 additions and 0 deletions.
  1. +11 −0 include/linker/linker-defs.h
  2. +2 −0 include/linker/priv_stacks-noinit.ld
@@ -252,6 +252,17 @@ extern char _ramfunc_ram_size[];
extern char _ramfunc_rom_start[];
#endif /* CONFIG_ARCH_HAS_RAMFUNC_SUPPORT */

/* Memory owned by the kernel. Memory region for thread privilege stack buffers,
* currently only applicable on ARM Cortex-M architecture when building with
* support for User Mode.
*
* All thread privilege stack buffers will be placed into this section.
*/
#ifdef CONFIG_USERSPACE
extern char z_priv_stacks_ram_start[];
extern char z_priv_stacks_ram_end[];
#endif /* CONFIG_USERSPACE */

#endif /* ! _ASMLANGUAGE */

#endif /* ZEPHYR_INCLUDE_LINKER_LINKER_DEFS_H_ */
@@ -6,5 +6,7 @@

SECTION_DATA_PROLOGUE(priv_stacks_noinit,,)
{
z_priv_stacks_ram_start = .;
*(".priv_stacks.noinit")
z_priv_stacks_ram_end = .;
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)

0 comments on commit f15c12d

Please sign in to comment.
You can’t perform that action at this time.