1 /*
2  * Copyright (c) 2016 Wind River Systems, Inc.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef ZEPHYR_KERNEL_INCLUDE_OFFSETS_SHORT_H_
8 #define ZEPHYR_KERNEL_INCLUDE_OFFSETS_SHORT_H_
9 
10 #include <zephyr/offsets.h>
11 #include <offsets_short_arch.h>
12 
13 /* kernel */
14 
15 /* main */
16 #ifndef CONFIG_SMP
17 /* Relies on _kernel.cpu being the first member of _kernel and having 1 element
18  */
19 #define _kernel_offset_to_nested \
20 	(___cpu_t_nested_OFFSET)
21 
22 #define _kernel_offset_to_irq_stack \
23 	(___cpu_t_irq_stack_OFFSET)
24 
25 #define _kernel_offset_to_current \
26 	(___cpu_t_current_OFFSET)
27 
28 #if defined(CONFIG_FPU_SHARING)
29 #define _kernel_offset_to_fp_ctx \
30 	(___cpu_t_fp_ctx_OFFSET)
31 #endif /* CONFIG_FPU_SHARING */
32 #endif /* CONFIG_SMP */
33 
34 #define _kernel_offset_to_idle \
35 	(___kernel_t_idle_OFFSET)
36 
37 #define _kernel_offset_to_current_fp \
38 	(___kernel_t_current_fp_OFFSET)
39 
40 #define _kernel_offset_to_ready_q_cache \
41 	(___kernel_t_ready_q_OFFSET + ___ready_q_t_cache_OFFSET)
42 
43 /* end - kernel */
44 
45 /* threads */
46 
47 /* main */
48 
49 #define _thread_offset_to_callee_saved \
50 	(___thread_t_callee_saved_OFFSET)
51 
52 #ifdef CONFIG_THREAD_LOCAL_STORAGE
53 #define _thread_offset_to_tls \
54 	(___thread_t_tls_OFFSET)
55 #endif /* CONFIG_THREAD_LOCAL_STORAGE */
56 
57 /* base */
58 
59 #define _thread_offset_to_user_options \
60 	(___thread_t_base_OFFSET + ___thread_base_t_user_options_OFFSET)
61 
62 /* end - threads */
63 
64 #endif /* ZEPHYR_KERNEL_INCLUDE_OFFSETS_SHORT_H_ */
65