kernel: delete separate logic for priv stacks

This never needed to be put in a separate gperf table.
Privilege mode stacks can be generated by the main
gen_kobject_list.py logic, which we do here.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2020-03-11 10:56:19 -07:00 committed by Andrew Boie
commit 28be793cb6
21 changed files with 124 additions and 474 deletions

View file

@ -39,5 +39,13 @@
*(".kobject_data.rodata*")
#endif
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
#endif /* CONFIG_USERSPACE */
#ifdef CONFIG_GEN_PRIV_STACKS
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)
#endif /* CONFIG_GEN_PRIV_STACKS */
#endif /* CONFIG_USERSPACE */

View file

@ -1,12 +0,0 @@
/*
* Copyright (c) 2017 Linaro Limited.
*
* SPDX-License-Identifier: Apache-2.0
*/
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)

View file

@ -1,13 +0,0 @@
/*
* Copyright (c) 2017 Linaro Limited.
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifdef CONFIG_USERSPACE
/* Kept in RAM on non-XIP */
#ifdef CONFIG_XIP
*(".priv_stacks.rodata*")
#endif
#endif /* CONFIG_USERSPACE */

View file

@ -1,38 +0,0 @@
/*
* Copyright (c) 2017 Linaro Limited.
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifdef CONFIG_USERSPACE
/* We need to reserve room for the gperf generated hash functions.
* Fortunately, unlike the data tables, the size of the code is
* reasonably predictable.
*/
_priv_stacks_text_area_start = .;
*(".priv_stacks.text*")
_priv_stacks_text_area_end = .;
_priv_stacks_text_area_used = _priv_stacks_text_area_end - _priv_stacks_text_area_start;
#ifndef LINKER_PASS2
PROVIDE(z_priv_stack_find = .);
#endif
/* In a valid build the MAX function will always evaluate to the
second argument below, but to give the user a good error message
when the area overflows we need to temporarily corrupt the
location counter, and then detect the overflow with an assertion
later on. */
. = MAX(., _priv_stacks_text_area_start + CONFIG_PRIVILEGED_STACK_TEXT_AREA);
ASSERT(
CONFIG_PRIVILEGED_STACK_TEXT_AREA >= _priv_stacks_text_area_used,
"The configuration system has incorrectly set
'CONFIG_PRIVILEGED_STACK_TEXT_AREA' to
CONFIG_PRIVILEGED_STACK_TEXT_AREA, which is not big enough. You must
through Kconfig either disable 'CONFIG_USERSPACE', or set
'CONFIG_PRIVILEGED_STACK_TEXT_AREA' to a value larger than
CONFIG_PRIVILEGED_STACK_TEXT_AREA."
);
#endif /* CONFIG_USERSPACE */

View file

@ -1,36 +0,0 @@
/*
* Copyright (c) 2017 Linaro Limited
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifdef CONFIG_USERSPACE
/* Constraints:
*
* - changes to the size of this section between build phases
* *must not* shift the memory address of any kernel objects,
* since it contains a hashtable of the memory addresses of those
* kernel objects
*
* - It is OK if this section itself is shifted in between builds; for
* example some arches may precede this section with generated MMU
* page tables which are also unpredictable in size.
*
* The size of the
* gperf tables is both a function of the number of kernel objects,
* *and* the specific memory addresses being hashed. It is not something
* that can be predicted without actually building and compiling it.
*/
SECTION_DATA_PROLOGUE(priv_stacks,,)
{
*(".priv_stacks.data*")
/* This is also unpredictable in size, and has the same constraints.
* On XIP systems this will get put at the very end of ROM.
*/
#ifndef CONFIG_XIP
*(".priv_stacks.rodata*")
#endif
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
#endif /* CONFIG_USERSPACE */