arch/risc-v: unify idle stack calculation

As the stack layout is unified, it is possible to
use a unify formula to calculate the top of idle
stack.

Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
This commit is contained in:
Inochi Amaoto 2024-05-09 20:15:23 +08:00 committed by Petro Karashchenko
parent 09bfaa7292
commit afb5a66847
16 changed files with 3 additions and 125 deletions

View File

@ -66,8 +66,6 @@ static struct boot2_partition_table_s g_boot2_partition_table used_data;
* Public Data
****************************************************************************/
uintptr_t g_idle_topstack = (uintptr_t)_ebss + SMP_STACK_SIZE;
/****************************************************************************
* Public Functions
****************************************************************************/

View File

@ -58,13 +58,6 @@ extern void __trap_vec(void);
* Public Data
****************************************************************************/
/* NOTE: g_idle_topstack needs to point the top of the idle stack
* for last CPU and this value is used in up_initial_state()
*/
uintptr_t g_idle_topstack = BL808_IDLESTACK_BASE +
SMP_STACK_SIZE * CONFIG_SMP_NCPUS;
/****************************************************************************
* Private Functions
****************************************************************************/

View File

@ -48,18 +48,6 @@
* Public Data
****************************************************************************/
/* g_idle_topstack: _sbss is the start of the BSS region as defined by the
* linker script. _ebss lies at the end of the BSS region. The idle task
* stack starts at the end of BSS and is of size CONFIG_IDLETHREAD_STACKSIZE.
* The IDLE thread is the thread that the system boots on and, eventually,
* becomes the IDLE, do nothing task that runs only when there is nothing
* else to run. The heap continues from there until the end of memory.
* g_idle_topstack is a read-only variable the provides this computed
* address.
*/
uintptr_t g_idle_topstack = C906_IDLESTACK_TOP;
/****************************************************************************
* Public Functions
****************************************************************************/

View File

@ -174,8 +174,6 @@ HDR_ATTR static void (*_entry_point)(void) = __start;
* Public Data
****************************************************************************/
uintptr_t g_idle_topstack = (uintptr_t)_ebss + SMP_STACK_SIZE;
/****************************************************************************
* Private Functions
****************************************************************************/

View File

@ -47,6 +47,9 @@
* Public Data
****************************************************************************/
uintptr_t g_idle_topstack = (uintptr_t)_ebss +
SMP_STACK_SIZE * CONFIG_SMP_NCPUS;
const uint8_t *g_cpux_idlestack[CONFIG_SMP_NCPUS];
/****************************************************************************

View File

@ -127,8 +127,6 @@ HDR_ATTR static void (*_entry_point)(void) = __start;
* Public Data
****************************************************************************/
uintptr_t g_idle_topstack = (uintptr_t)_ebss + SMP_STACK_SIZE;
/****************************************************************************
* Private Functions
****************************************************************************/

View File

@ -47,18 +47,6 @@
* Public Data
****************************************************************************/
/* g_idle_topstack: _sbss is the start of the BSS region as defined by the
* linker script. _ebss lies at the end of the BSS region. The idle task
* stack starts at the end of BSS and is of size CONFIG_IDLETHREAD_STACKSIZE.
* The IDLE thread is the thread that the system boots on and, eventually,
* becomes the IDLE, do nothing task that runs only when there is nothing
* else to run. The heap continues from there until the end of memory.
* g_idle_topstack is a read-only variable the provides this computed
* address.
*/
uintptr_t g_idle_topstack = FE310_IDLESTACK_TOP;
/****************************************************************************
* Public Functions
****************************************************************************/

View File

@ -42,18 +42,6 @@
* Public Data
****************************************************************************/
/* g_idle_topstack: _sbss is the start of the BSS region as defined by the
* linker script. _ebss lies at the end of the BSS region. The idle task
* stack starts at the end of BSS and is of size CONFIG_IDLETHREAD_STACKSIZE.
* The IDLE thread is the thread that the system boots on and, eventually,
* becomes the IDLE, do nothing task that runs only when there is nothing
* else to run. The heap continues from there until the end of memory.
* g_idle_topstack is a read-only variable the provides this computed
* address.
*/
uintptr_t g_idle_topstack = HPM_IDLESTACK_TOP;
/****************************************************************************
* Public Functions
****************************************************************************/

View File

@ -42,18 +42,6 @@
* Public Data
****************************************************************************/
/* g_idle_topstack: _sbss is the start of the BSS region as defined by the
* linker script. _ebss lies at the end of the BSS region. The idle task
* stack starts at the end of BSS and is of size CONFIG_IDLETHREAD_STACKSIZE.
* The IDLE thread is the thread that the system boots on and, eventually,
* becomes the IDLE, do nothing task that runs only when there is nothing
* else to run. The heap continues from there until the end of memory.
* g_idle_topstack is a read-only variable the provides this computed
* address.
*/
uintptr_t g_idle_topstack = HPM6750_IDLESTACK_TOP;
/****************************************************************************
* Public Functions
****************************************************************************/

View File

@ -52,13 +52,6 @@ extern void __trap_vec(void);
* Public Data
****************************************************************************/
/* NOTE: g_idle_topstack needs to point the top of the idle stack
* for last CPU and this value is used in up_initial_state()
*/
uintptr_t g_idle_topstack = JH7110_IDLESTACK_BASE +
SMP_STACK_SIZE * CONFIG_SMP_NCPUS;
/****************************************************************************
* Public Functions
****************************************************************************/

View File

@ -48,13 +48,6 @@
* Public Data
****************************************************************************/
/* NOTE: g_idle_topstack needs to point the top of the idle stack
* for CPU0 and this value is used in up_initial_state()
*/
uintptr_t g_idle_topstack = K210_IDLESTACK_BASE +
SMP_STACK_SIZE * CONFIG_SMP_NCPUS;
/****************************************************************************
* Public Functions
****************************************************************************/

View File

@ -101,13 +101,6 @@ static void k230_copy_init_data(void)
* Public Data
****************************************************************************/
/* NOTE: g_idle_topstack needs to point the top of the idle stack
* for last CPU and this value is used in up_initial_state()
*/
uintptr_t g_idle_topstack = K230_IDLESTACK_BASE +
SMP_STACK_SIZE * CONFIG_SMP_NCPUS;
/****************************************************************************
* Public Functions
****************************************************************************/

View File

@ -56,18 +56,6 @@
* Public Data
****************************************************************************/
/* g_idle_topstack: _sbss is the start of the BSS region as defined by the
* linker script. _ebss lies at the end of the BSS region. The idle task
* stack starts at the end of BSS and is of size CONFIG_IDLETHREAD_STACKSIZE.
* The IDLE thread is the thread that the system boots on and, eventually,
* becomes the IDLE, do nothing task that runs only when there is nothing
* else to run. The heap continues from there until the end of memory.
* g_idle_topstack is a read-only variable the provides this computed
* address.
*/
uintptr_t g_idle_topstack = LITEX_IDLESTACK_TOP;
/****************************************************************************
* Public Functions
****************************************************************************/

View File

@ -57,18 +57,6 @@
* Public Data
****************************************************************************/
/* g_idle_topstack: _sbss is the start of the BSS region as defined by the
* linker script. _ebss lies at the end of the BSS region. The idle task
* stack starts at the end of BSS and is of size CONFIG_IDLETHREAD_STACKSIZE.
* The IDLE thread is the thread that the system boots on and, eventually,
* becomes the IDLE, do nothing task that runs only when there is nothing
* else to run. The heap continues from there until the end of memory.
* g_idle_topstack is a read-only variable the provides this computed
* address.
*/
uintptr_t g_idle_topstack = MPFS_IDLESTACK_TOP;
/****************************************************************************
* Public Functions
****************************************************************************/

View File

@ -109,13 +109,6 @@ static bool boot_secondary = false;
* Public Data
****************************************************************************/
/* NOTE: g_idle_topstack needs to point the top of the idle stack
* for last CPU and this value is used in up_initial_state()
*/
uintptr_t g_idle_topstack = QEMU_RV_IDLESTACK_BASE +
SMP_STACK_SIZE * CONFIG_SMP_NCPUS;
/****************************************************************************
* Public Functions
****************************************************************************/

View File

@ -50,18 +50,6 @@
* Public Data
****************************************************************************/
/* g_idle_topstack: _sbss is the start of the BSS region as defined by the
* linker script. _ebss lies at the end of the BSS region. The idle task
* stack starts at the end of BSS and is of size CONFIG_IDLETHREAD_STACKSIZE.
* The IDLE thread is the thread that the system boots on and, eventually,
* becomes the IDLE, do nothing task that runs only when there is nothing
* else to run. The heap continues from there until the end of memory.
* g_idle_topstack is a read-only variable the provides this computed
* address.
*/
uintptr_t g_idle_topstack = RV32M1_IDLESTACK_TOP;
/****************************************************************************
* Public Functions
****************************************************************************/