[rtems commit] score: Fix objects local table initialization

Sebastian Huber sebh at rtems.org
Wed Jul 27 06:51:57 UTC 2022


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Jul 27 08:55:10 2022 +0200

score: Fix objects local table initialization

The objects local table must be statically zero-initialized so that
_Objects_Get() and _Objects_Get_no_protection() return NULL if no object is
associated with the identifier.

Update #4678.

---

 cpukit/include/rtems/score/objectdata.h | 3 +--
 cpukit/include/rtems/score/thread.h     | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/cpukit/include/rtems/score/objectdata.h b/cpukit/include/rtems/score/objectdata.h
index dc03f23461..ba2cb9c5b2 100644
--- a/cpukit/include/rtems/score/objectdata.h
+++ b/cpukit/include/rtems/score/objectdata.h
@@ -447,8 +447,7 @@ Objects_Information name##_Information = { \
  *   multiprocessing (RTEMS_MULTIPROCESSING) is enabled.
  */
 #define OBJECTS_INFORMATION_DEFINE( name, api, cls, type, max, nl, ex ) \
-static RTEMS_SECTION( ".noinit.rtems.content.local_table" ) \
-Objects_Control * \
+static Objects_Control * \
 name##_Local_table[ _Objects_Maximum_per_allocation( max ) ]; \
 static RTEMS_SECTION( ".noinit.rtems.content.objects" ) \
 type \
diff --git a/cpukit/include/rtems/score/thread.h b/cpukit/include/rtems/score/thread.h
index f5a56887a4..16430347af 100644
--- a/cpukit/include/rtems/score/thread.h
+++ b/cpukit/include/rtems/score/thread.h
@@ -1149,8 +1149,7 @@ Thread_Information name##_Information = { \
 Objects_Control *_Thread_Allocate_unlimited( Objects_Information *information );
 
 #define THREAD_INFORMATION_DEFINE( name, api, cls, max ) \
-static RTEMS_SECTION( ".noinit.rtems.content.local_table" ) \
-Objects_Control * \
+static Objects_Control * \
 name##_Local_table[ _Objects_Maximum_per_allocation( max ) ]; \
 static RTEMS_SECTION( ".noinit.rtems.content.objects" ) \
 Thread_Configured_control \



More information about the vc mailing list