Fix the header guards, comments, github labeler, CODEOWNERS and MAINTAINERS files. Signed-off-by: Carlo Caione <ccaione@baylibre.com>
59 lines
1.7 KiB
C
59 lines
1.7 KiB
C
/*
|
|
* Copyright (c) 2020 Carlo Caione <ccaione@baylibre.com>
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#ifndef ZEPHYR_INCLUDE_ARCH_ARM64_THREAD_STACK_H_
|
|
#define ZEPHYR_INCLUDE_ARCH_ARM64_THREAD_STACK_H_
|
|
|
|
#define ARCH_STACK_PTR_ALIGN 16
|
|
|
|
#if CONFIG_USERSPACE
|
|
#define Z_ARM64_STACK_BASE_ALIGN CONFIG_MMU_PAGE_SIZE
|
|
#define Z_ARM64_STACK_SIZE_ALIGN CONFIG_MMU_PAGE_SIZE
|
|
#else
|
|
#define Z_ARM64_STACK_BASE_ALIGN ARCH_STACK_PTR_ALIGN
|
|
#define Z_ARM64_STACK_SIZE_ALIGN ARCH_STACK_PTR_ALIGN
|
|
#endif
|
|
|
|
/*
|
|
* High memory addresses
|
|
*
|
|
* +-------------------+ <- thread.stack_info.start + thread.stack_info.size
|
|
* | TLS |
|
|
* +-------------------+ <- initial sp (computable with thread.stack_info.delta)
|
|
* | |
|
|
* | Used stack |
|
|
* | |
|
|
* +...................+ <- thread's current stack pointer
|
|
* | |
|
|
* | Unused stack |
|
|
* | |
|
|
* +-------------------+ <- thread.stack_info.start
|
|
* | Reserved memory | } K_(THREAD|KERNEL)_STACK_RESERVED
|
|
* +-------------------+ <- thread.stack_obj
|
|
*
|
|
* Low Memory addresses
|
|
*/
|
|
|
|
/* thread stack */
|
|
#define ARCH_THREAD_STACK_OBJ_ALIGN(size) Z_ARM64_STACK_BASE_ALIGN
|
|
#define ARCH_THREAD_STACK_SIZE_ADJUST(size) \
|
|
ROUND_UP((size), Z_ARM64_STACK_SIZE_ALIGN)
|
|
#define ARCH_THREAD_STACK_RESERVED CONFIG_PRIVILEGED_STACK_SIZE
|
|
|
|
/* kernel stack */
|
|
#define ARCH_KERNEL_STACK_RESERVED 0
|
|
#define ARCH_KERNEL_STACK_OBJ_ALIGN ARCH_STACK_PTR_ALIGN
|
|
|
|
#ifndef _ASMLANGUAGE
|
|
|
|
struct z_arm64_thread_stack_header {
|
|
char privilege_stack[CONFIG_PRIVILEGED_STACK_SIZE];
|
|
} __packed __aligned(Z_ARM64_STACK_BASE_ALIGN);
|
|
|
|
#endif /* _ASMLANGUAGE */
|
|
|
|
#endif /* ZEPHYR_INCLUDE_ARCH_ARM64_THREAD_STACK_H_ */
|