offsets_short.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright (c) 2016 Wind River Systems, Inc.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef ZEPHYR_KERNEL_INCLUDE_OFFSETS_SHORT_H_
  7. #define ZEPHYR_KERNEL_INCLUDE_OFFSETS_SHORT_H_
  8. #include <offsets.h>
  9. #include <offsets_short_arch.h>
  10. /* kernel */
  11. /* main */
  12. #ifndef CONFIG_SMP
  13. /* Relies on _kernel.cpu being the first member of _kernel and having 1 element
  14. */
  15. #define _kernel_offset_to_nested \
  16. (___cpu_t_nested_OFFSET)
  17. #define _kernel_offset_to_irq_stack \
  18. (___cpu_t_irq_stack_OFFSET)
  19. #define _kernel_offset_to_current \
  20. (___cpu_t_current_OFFSET)
  21. #endif /* CONFIG_SMP */
  22. #define _kernel_offset_to_idle \
  23. (___kernel_t_idle_OFFSET)
  24. #define _kernel_offset_to_current_fp \
  25. (___kernel_t_current_fp_OFFSET)
  26. #define _kernel_offset_to_ready_q_cache \
  27. (___kernel_t_ready_q_OFFSET + ___ready_q_t_cache_OFFSET)
  28. /* end - kernel */
  29. /* threads */
  30. /* main */
  31. #define _thread_offset_to_callee_saved \
  32. (___thread_t_callee_saved_OFFSET)
  33. #ifdef CONFIG_THREAD_LOCAL_STORAGE
  34. #define _thread_offset_to_tls \
  35. (___thread_t_tls_OFFSET)
  36. #endif /* CONFIG_THREAD_LOCAL_STORAGE */
  37. /* base */
  38. #define _thread_offset_to_thread_state \
  39. (___thread_t_base_OFFSET + ___thread_base_t_thread_state_OFFSET)
  40. #define _thread_offset_to_user_options \
  41. (___thread_t_base_OFFSET + ___thread_base_t_user_options_OFFSET)
  42. #define _thread_offset_to_prio \
  43. (___thread_t_base_OFFSET + ___thread_base_t_prio_OFFSET)
  44. #define _thread_offset_to_sched_locked \
  45. (___thread_t_base_OFFSET + ___thread_base_t_sched_locked_OFFSET)
  46. #define _thread_offset_to_preempt \
  47. (___thread_t_base_OFFSET + ___thread_base_t_preempt_OFFSET)
  48. #define _thread_offset_to_esf \
  49. (___thread_t_arch_OFFSET + ___thread_arch_t_esf_OFFSET)
  50. #define _thread_offset_to_stack_start \
  51. (___thread_t_stack_info_OFFSET + ___thread_stack_info_t_start_OFFSET)
  52. /* end - threads */
  53. #endif /* ZEPHYR_KERNEL_INCLUDE_OFFSETS_SHORT_H_ */