From 2501c64bb6654f5e4290709e0d83b94bfe51973f Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 27 Jul 2022 08:55:10 +0200 Subject: 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(-) (limited to 'cpukit') 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 \ -- cgit v1.2.3