7#ifndef ZEPHYR_INCLUDE_ARCH_ARM64_THREAD_STACK_H_
8#define ZEPHYR_INCLUDE_ARCH_ARM64_THREAD_STACK_H_
12#define ARCH_STACK_PTR_ALIGN 16
14#if defined(CONFIG_USERSPACE) || defined(CONFIG_ARM64_STACK_PROTECTION)
15#define Z_ARM64_STACK_BASE_ALIGN MEM_DOMAIN_ALIGN_AND_SIZE
16#define Z_ARM64_STACK_SIZE_ALIGN MEM_DOMAIN_ALIGN_AND_SIZE
18#define Z_ARM64_STACK_BASE_ALIGN ARCH_STACK_PTR_ALIGN
19#define Z_ARM64_STACK_SIZE_ALIGN ARCH_STACK_PTR_ALIGN
22#if defined(CONFIG_ARM64_STACK_PROTECTION)
23#define Z_ARM64_STACK_GUARD_SIZE MEM_DOMAIN_ALIGN_AND_SIZE
24#define Z_ARM64_K_STACK_BASE_ALIGN MEM_DOMAIN_ALIGN_AND_SIZE
26#define Z_ARM64_STACK_GUARD_SIZE 0
27#define Z_ARM64_K_STACK_BASE_ALIGN ARCH_STACK_PTR_ALIGN
55#define ARCH_THREAD_STACK_OBJ_ALIGN(size) Z_ARM64_STACK_BASE_ALIGN
56#define ARCH_THREAD_STACK_SIZE_ADJUST(size) \
57 ROUND_UP((size), Z_ARM64_STACK_SIZE_ALIGN)
58#define ARCH_THREAD_STACK_RESERVED CONFIG_PRIVILEGED_STACK_SIZE + \
59 Z_ARM64_STACK_GUARD_SIZE
62#define ARCH_KERNEL_STACK_RESERVED Z_ARM64_STACK_GUARD_SIZE
63#define ARCH_KERNEL_STACK_OBJ_ALIGN Z_ARM64_K_STACK_BASE_ALIGN
67struct z_arm64_thread_stack_header {
68 char privilege_stack[CONFIG_PRIVILEGED_STACK_SIZE];
69} __packed __aligned(Z_ARM64_STACK_BASE_ALIGN);