[rtems commit] score: Move Thread_Control::Registers member

Sebastian Huber sebh at rtems.org
Fri Oct 14 09:41:34 UTC 2022


Module:    rtems
Branch:    master
Commit:    15bba4aecfca407d67e495b7a26c84929202d05f
Changeset: http://git.rtems.org/rtems/commit/?id=15bba4aecfca407d67e495b7a26c84929202d05f

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Oct 14 10:46:06 2022 +0200

score: Move Thread_Control::Registers member

Place this member placed directly after the end of the common block so that
the structure offsets are as small as possible.  This helps on instruction
set architectures with a very limited range for intermediate values.  For
example, see the __aeabi_read_tp() implementation for ARM Thumb-1.

Update #3835.

---

 cpukit/include/rtems/score/thread.h | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/cpukit/include/rtems/score/thread.h b/cpukit/include/rtems/score/thread.h
index 40fefbc79a..f82d4b954c 100644
--- a/cpukit/include/rtems/score/thread.h
+++ b/cpukit/include/rtems/score/thread.h
@@ -858,6 +858,15 @@ struct _Thread_Control {
 #endif
      /*================= end of common block =================*/
 
+  /**
+   * @brief This member contains the context of this thread.
+   *
+   * This member is placed directly after the end of the common block so that
+   * the structure offsets are as small as possible.  This helps on instruction
+   * set architectures with a very limited range for intermediate values.
+   */
+  Context_Control Registers;
+
 #if defined(RTEMS_SMP) && defined(RTEMS_PROFILING)
   /**
    * @brief Potpourri lock statistics.
@@ -913,8 +922,6 @@ struct _Thread_Control {
 
   Thread_Action_control                 Post_switch_actions;
 
-  /** This field contains the context of this thread. */
-  Context_Control                       Registers;
 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
   /** This field points to the floating point context for this thread.
    *  If NULL, the thread is integer only.



More information about the vc mailing list