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 <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 #endif /* CONFIG_SMP */ 28 29 #define _kernel_offset_to_idle \ 30 (___kernel_t_idle_OFFSET) 31 32 #define _kernel_offset_to_current_fp \ 33 (___kernel_t_current_fp_OFFSET) 34 35 #define _kernel_offset_to_ready_q_cache \ 36 (___kernel_t_ready_q_OFFSET + ___ready_q_t_cache_OFFSET) 37 38 /* end - kernel */ 39 40 /* threads */ 41 42 /* main */ 43 44 #define _thread_offset_to_callee_saved \ 45 (___thread_t_callee_saved_OFFSET) 46 47 #ifdef CONFIG_THREAD_LOCAL_STORAGE 48 #define _thread_offset_to_tls \ 49 (___thread_t_tls_OFFSET) 50 #endif /* CONFIG_THREAD_LOCAL_STORAGE */ 51 52 /* base */ 53 54 #define _thread_offset_to_thread_state \ 55 (___thread_t_base_OFFSET + ___thread_base_t_thread_state_OFFSET) 56 57 #define _thread_offset_to_user_options \ 58 (___thread_t_base_OFFSET + ___thread_base_t_user_options_OFFSET) 59 60 #define _thread_offset_to_prio \ 61 (___thread_t_base_OFFSET + ___thread_base_t_prio_OFFSET) 62 63 #define _thread_offset_to_sched_locked \ 64 (___thread_t_base_OFFSET + ___thread_base_t_sched_locked_OFFSET) 65 66 #define _thread_offset_to_preempt \ 67 (___thread_t_base_OFFSET + ___thread_base_t_preempt_OFFSET) 68 69 #define _thread_offset_to_esf \ 70 (___thread_t_arch_OFFSET + ___thread_arch_t_esf_OFFSET) 71 72 #define _thread_offset_to_stack_start \ 73 (___thread_t_stack_info_OFFSET + ___thread_stack_info_t_start_OFFSET) 74 /* end - threads */ 75 76 #endif /* ZEPHYR_KERNEL_INCLUDE_OFFSETS_SHORT_H_ */ 77