Zephyr API Documentation
4.1.99
A Scalable Open Source RTOS
4.1.99
Toggle main menu visibility
Main Page
Related Pages
Topics
Data Structures
Data Structures
Data Structure Index
Data Fields
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
Enumerator
Files
File List
Globals
All
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
$
a
b
c
d
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
x
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Macros
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
▼
Zephyr API Documentation
►
Introduction
Deprecated List
►
Topics
►
Data Structures
▼
Files
▼
File List
►
doc
►
kernel
►
lib
►
subsys
▼
zephyr
►
acpi
►
app_memory
▼
arch
►
arc
►
arm
►
arm64
►
common
►
mips
►
nios2
►
posix
►
riscv
►
sparc
►
x86
▼
xtensa
►
arch.h
►
arch_inlines.h
►
atomic_xtensa.h
►
cache.h
►
exception.h
►
gdbstub.h
►
irq.h
►
mpu.h
►
syscall.h
thread.h
►
thread_stack.h
►
xtensa_mmu.h
arch_inlines.h
►
arch_interface.h
►
cache.h
cpu.h
exception.h
structs.h
syscall.h
►
audio
►
bluetooth
►
canbus
►
console
►
crypto
►
data
►
debug
►
devicetree
►
dfu
►
display
►
drivers
►
dsp
►
dt-bindings
►
fs
►
input
►
internal
►
ipc
►
kernel
►
linker
►
llext
►
logging
►
lorawan
►
math
►
mctp
►
mem_mgmt
►
mgmt
►
misc
►
modbus
►
modem
►
multi_heap
►
net
►
platform
►
pm
►
portability
►
posix
►
psa
►
random
►
retention
►
rtio
►
sd
►
sensing
►
settings
►
shell
►
sip_svc
►
stats
►
storage
►
sys
►
task_wdt
►
timing
►
toolchain
►
tracing
►
usb
►
usb_c
►
xen
►
zbus
►
zvfs
►
bindesc.h
►
cache.h
►
device.h
►
devicetree.h
►
fatal.h
►
fatal_types.h
►
init.h
►
irq.h
►
irq_multilevel.h
►
irq_nextlevel.h
►
irq_offload.h
►
kernel.h
kernel_includes.h
►
kernel_structs.h
►
kernel_version.h
►
net_buf.h
►
shared_irq.h
►
smf.h
►
spinlock.h
►
sw_isr_table.h
►
sys_clock.h
►
syscall.h
►
toolchain.h
types.h
►
Globals
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
Loading...
Searching...
No Matches
thread_stack.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2022 Intel Corporation
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
#ifndef ZEPHYR_INCLUDE_ARCH_XTENSA_THREAD_STACK_H_
8
#define ZEPHYR_INCLUDE_ARCH_XTENSA_THREAD_STACK_H_
9
10
#include <xtensa/config/core-isa.h>
11
#include <
zephyr/toolchain.h
>
12
#include <
zephyr/sys/util.h
>
13
14
#ifdef CONFIG_KERNEL_COHERENCE
15
#define ARCH_STACK_PTR_ALIGN XCHAL_DCACHE_LINESIZE
16
#else
17
#define ARCH_STACK_PTR_ALIGN 16
18
#endif
19
20
21
#ifdef CONFIG_USERSPACE
22
#ifdef CONFIG_XTENSA_MMU
23
#define XTENSA_STACK_BASE_ALIGN CONFIG_MMU_PAGE_SIZE
24
#define XTENSA_STACK_SIZE_ALIGN CONFIG_MMU_PAGE_SIZE
25
#endif
26
#ifdef CONFIG_XTENSA_MPU
27
#define XTENSA_STACK_BASE_ALIGN XCHAL_MPU_ALIGN
28
#define XTENSA_STACK_SIZE_ALIGN XCHAL_MPU_ALIGN
29
#endif
30
#else
31
#define XTENSA_STACK_BASE_ALIGN ARCH_STACK_PTR_ALIGN
32
#define XTENSA_STACK_SIZE_ALIGN ARCH_STACK_PTR_ALIGN
33
#endif
34
35
/*
36
*
37
* High memory addresses
38
*
39
* +-------------------+ <- thread.stack_info.start + thread.stack_info.size
40
* | TLS |
41
* +-------------------+ <- initial sp (computable with thread.stack_info.delta)
42
* | |
43
* | Thread stack |
44
* | |
45
* +-------------------+ <- thread.stack_info.start
46
* | Privileged stack | } CONFIG_MMU_PAGE_SIZE
47
* +-------------------+ <- thread.stack_obj
48
*
49
* Low Memory addresses
50
*/
51
52
#ifndef _ASMLANGUAGE
53
54
/* thread stack */
55
struct
xtensa_thread_stack_header
{
56
#if defined(CONFIG_XTENSA_MMU) || defined(CONFIG_XTENSA_MPU)
57
char
privilege_stack[CONFIG_PRIVILEGED_STACK_SIZE];
58
#endif
/* CONFIG_XTENSA_MPU */
59
} __packed __aligned(XTENSA_STACK_BASE_ALIGN);
55
struct
xtensa_thread_stack_header
{
…
};
60
61
#if defined(CONFIG_XTENSA_MMU) || defined(CONFIG_XTENSA_MPU)
62
#define ARCH_THREAD_STACK_RESERVED \
63
sizeof(struct xtensa_thread_stack_header)
64
#endif
/* CONFIG_XTENSA_MMU || CONFIG_XTENSA_MPU */
65
66
#define ARCH_THREAD_STACK_OBJ_ALIGN(size) XTENSA_STACK_BASE_ALIGN
67
#define ARCH_THREAD_STACK_SIZE_ADJUST(size) \
68
ROUND_UP((size), XTENSA_STACK_SIZE_ALIGN)
67
#define ARCH_THREAD_STACK_SIZE_ADJUST(size) \
…
69
70
/* kernel stack */
71
#define ARCH_KERNEL_STACK_OBJ_ALIGN ARCH_STACK_PTR_ALIGN
72
73
#endif
/* _ASMLANGUAGE */
74
75
#endif
xtensa_thread_stack_header
Definition
thread_stack.h:55
util.h
Misc utilities.
toolchain.h
Macros to abstract toolchain specific capabilities.
zephyr
arch
xtensa
thread_stack.h
Generated on Mon Mar 17 2025 00:05:49 for Zephyr API Documentation by
1.12.0