Skip to content

Commit

Permalink
arch: arm: expose start/end limits of the thread priv stack section
Browse files Browse the repository at this point in the history
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 24, 2019
1 parent 88959e7 commit f15c12d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions include/linker/linker-defs.h
Expand Up @@ -252,6 +252,17 @@ extern char _ramfunc_ram_size[];
extern char _ramfunc_rom_start[]; extern char _ramfunc_rom_start[];
#endif /* CONFIG_ARCH_HAS_RAMFUNC_SUPPORT */ #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 /* ! _ASMLANGUAGE */


#endif /* ZEPHYR_INCLUDE_LINKER_LINKER_DEFS_H_ */ #endif /* ZEPHYR_INCLUDE_LINKER_LINKER_DEFS_H_ */
2 changes: 2 additions & 0 deletions include/linker/priv_stacks-noinit.ld
Expand Up @@ -6,5 +6,7 @@


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

0 comments on commit f15c12d

Please sign in to comment.