1 /*
2 * Copyright (c) 2018 Lexmark International, Inc.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7 #include "zephyr/kernel/thread_stack.h"
8 #include <zephyr/kernel.h>
9 #include <cortex_a_r/stack.h>
10 #include <string.h>
11 #include <kernel_internal.h>
12
13 K_KERNEL_STACK_ARRAY_DEFINE(z_arm_fiq_stack, CONFIG_MP_MAX_NUM_CPUS,
14 CONFIG_ARMV7_FIQ_STACK_SIZE);
15 K_KERNEL_STACK_ARRAY_DEFINE(z_arm_abort_stack, CONFIG_MP_MAX_NUM_CPUS,
16 CONFIG_ARMV7_EXCEPTION_STACK_SIZE);
17 K_KERNEL_STACK_ARRAY_DEFINE(z_arm_undef_stack, CONFIG_MP_MAX_NUM_CPUS,
18 CONFIG_ARMV7_EXCEPTION_STACK_SIZE);
19 K_KERNEL_STACK_ARRAY_DEFINE(z_arm_svc_stack, CONFIG_MP_MAX_NUM_CPUS,
20 CONFIG_ARMV7_SVC_STACK_SIZE);
21 K_KERNEL_STACK_ARRAY_DEFINE(z_arm_sys_stack, CONFIG_MP_MAX_NUM_CPUS,
22 CONFIG_ARMV7_SYS_STACK_SIZE);
23
24 #if defined(CONFIG_INIT_STACKS)
z_arm_init_stacks(void)25 void z_arm_init_stacks(void)
26 {
27 memset(z_arm_fiq_stack, 0xAA, CONFIG_ARMV7_FIQ_STACK_SIZE);
28 memset(z_arm_svc_stack, 0xAA, CONFIG_ARMV7_SVC_STACK_SIZE);
29 memset(z_arm_abort_stack, 0xAA, CONFIG_ARMV7_EXCEPTION_STACK_SIZE);
30 memset(z_arm_undef_stack, 0xAA, CONFIG_ARMV7_EXCEPTION_STACK_SIZE);
31 memset(K_KERNEL_STACK_BUFFER(z_interrupt_stacks[0]), 0xAA,
32 K_KERNEL_STACK_SIZEOF(z_interrupt_stacks[0]));
33 }
34 #endif
35