Split ARM and ARM64 architectures. Details: - CONFIG_ARM64 is decoupled from CONFIG_ARM (not a subset anymore) - Arch and include AArch64 files are in a dedicated directory (arch/arm64 and include/arch/arm64) - AArch64 boards and SoC are moved to soc/arm64 and boards/arm64 - AArch64-specific DTS files are moved to dts/arm64 - The A72 support for the bcm_vk/viper board is moved in the boards/bcm_vk/viper directory Signed-off-by: Carlo Caione <ccaione@baylibre.com>
44 lines
1.1 KiB
C
44 lines
1.1 KiB
C
/*
|
|
* Copyright (c) 2020 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#include <kernel.h>
|
|
#include <kernel_structs.h>
|
|
#include <kernel_internal.h>
|
|
#include <kernel_tls.h>
|
|
#include <app_memory/app_memdomain.h>
|
|
#include <sys/util.h>
|
|
|
|
size_t arch_tls_stack_setup(struct k_thread *new_thread, char *stack_ptr)
|
|
{
|
|
/*
|
|
* TLS area for ARM has some data fields following by
|
|
* thread data and bss. These fields are supposed to be
|
|
* used by toolchain and OS TLS code to aid in locating
|
|
* the TLS data/bss. Zephyr currently has no use for
|
|
* this so we can simply skip these. However, since GCC
|
|
* is generating code assuming these fields are there,
|
|
* we simply skip them when setting the TLS pointer.
|
|
*/
|
|
|
|
/*
|
|
* Since we are populating things backwards,
|
|
* setup the TLS data/bss area first.
|
|
*/
|
|
stack_ptr -= z_tls_data_size();
|
|
z_tls_copy(stack_ptr);
|
|
|
|
/* Skip two pointers due to toolchain */
|
|
stack_ptr -= sizeof(uintptr_t) * 2;
|
|
|
|
/*
|
|
* Set thread TLS pointer which is used in
|
|
* context switch to point to TLS area.
|
|
*/
|
|
new_thread->tls = POINTER_TO_UINT(stack_ptr);
|
|
|
|
return (z_tls_data_size() + (sizeof(uintptr_t) * 2));
|
|
}
|