Changeset 21275b58 in rtems


Ignore:
Timestamp:
Nov 22, 2018, 6:14:51 PM (7 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
6b0a729b
Parents:
0f5b2c09
git-author:
Sebastian Huber <sebastian.huber@…> (11/22/18 18:14:51)
git-committer:
Sebastian Huber <sebastian.huber@…> (12/14/18 06:03:29)
Message:

score: Static Objects_Information initialization

Statically allocate the objects information together with the initial
set of objects either via <rtems/confdefs.h>. Provide default object
informations with zero objects via librtemscpu.a. This greatly
simplifies the workspace size estimate. RTEMS applications which do not
use the unlimited objects option are easier to debug since all objects
reside now in statically allocated objects of the right types.

Close #3621.

Files:
1 added
3 deleted
100 edited

Legend:

Unmodified
Added
Removed
  • cpukit/Makefile.am

    r0f5b2c09 r21275b58  
    510510librtemscpu_a_SOURCES += posix/src/keygetspecific.c
    511511librtemscpu_a_SOURCES += posix/src/keysetspecific.c
     512librtemscpu_a_SOURCES += posix/src/keyzerokvp.c
    512513librtemscpu_a_SOURCES += posix/src/lio_listio.c
    513514librtemscpu_a_SOURCES += posix/src/mlockall.c
  • cpukit/include/rtems/confdefs.h

    r0f5b2c09 r21275b58  
    4545#include <rtems/posix/key.h>
    4646#include <rtems/posix/mqueue.h>
     47#include <rtems/posix/psignal.h>
    4748#include <rtems/posix/pthread.h>
    4849#include <rtems/posix/semaphore.h>
    4950#include <rtems/posix/shm.h>
     51#include <rtems/posix/timer.h>
    5052
    5153#include <limits.h>
     
    13551357#define _Configure_Max_Objects(_max) \
    13561358  (_Configure_Zero_or_One(_max) * rtems_resource_maximum_per_allocation(_max))
    1357 
    1358 /**
    1359  * This macro accounts for how memory for a set of configured objects is
    1360  * allocated from the Executive Workspace.
    1361  *
    1362  * NOTE: It does NOT attempt to address the more complex case of unlimited
    1363  *       objects.
    1364  */
    1365 #define _Configure_Object_RAM(_number, _size) ( \
    1366     _Configure_From_workspace(_Configure_Max_Objects(_number) * (_size)) + \
    1367     _Configure_From_workspace( \
    1368       _Configure_Zero_or_One(_number) * ( \
    1369         (_Configure_Max_Objects(_number) + 1) * sizeof(Objects_Control *) + \
    1370         _Configure_Align_up(sizeof(void *), CPU_ALIGNMENT) + \
    1371         _Configure_Align_up(sizeof(uint32_t), CPU_ALIGNMENT) \
    1372       ) \
    1373     ) \
    1374   )
    13751359/**@}*/
    13761360
     
    18541838        _Configure_From_workspace((_proxies) \
    18551839          * (sizeof(Thread_Proxy_control) \
    1856             + THREAD_QUEUE_HEADS_SIZE(_CONFIGURE_SCHEDULER_COUNT)))
     1840            + sizeof(Thread_queue_Configured_heads)))
    18571841
    18581842      #ifndef CONFIGURE_MP_MPCI_TABLE_POINTER
     
    19721956        rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
    19731957    #endif
    1974 /*
    1975     #if !defined(CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS)
    1976       #define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS \
    1977         rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
    1978     #endif
    1979 */
    19801958  #endif /* RTEMS_POSIX_API */
    19811959#endif /* CONFIGURE_UNLIMITED_OBJECTS */
     
    20071985  /** This specifies the maximum number of Classic API timers. */
    20081986  #define CONFIGURE_MAXIMUM_TIMERS             0
    2009   /*
    2010    * This macro is calculated to specify the memory required for
    2011    * Classic API timers.
    2012    */
    2013   #define _CONFIGURE_MEMORY_FOR_TIMERS(_timers) 0
    2014 #else
    2015   #define _CONFIGURE_MEMORY_FOR_TIMERS(_timers) \
    2016     _Configure_Object_RAM(_timers, sizeof(Timer_Control) )
    2017 #endif
     1987#endif
     1988
     1989#define _CONFIGURE_TIMERS \
     1990  (CONFIGURE_MAXIMUM_TIMERS + _CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER)
    20181991
    20191992#ifndef CONFIGURE_MAXIMUM_SEMAPHORES
     
    20382011#endif
    20392012
    2040 /*
    2041  * This macro is calculated to specify the memory required for
    2042  * Classic API Semaphores.
    2043  *
    2044  * If there are no user or support semaphores defined, then we can assume
    2045  * that no memory need be allocated at all for semaphores.
    2046  */
    2047 #if CONFIGURE_MAXIMUM_SEMAPHORES == 0
    2048   #define _CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) 0
    2049 #else
    2050   #define _CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) \
    2051     _Configure_Object_RAM(_semaphores, sizeof(Semaphore_Control) ) + \
    2052       _CONFIGURE_MEMORY_FOR_MRSP_SEMAPHORES
    2053 #endif
    2054 
    20552013#ifndef CONFIGURE_MAXIMUM_MESSAGE_QUEUES
    20562014  /**
     
    20592017   */
    20602018  #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES             0
    2061   /*
    2062    * This macro is calculated to specify the RTEMS Workspace required for
    2063    * the Classic API Message Queues.
    2064    */
    2065   #define _CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) 0
    2066 #else
    2067   #define _CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) \
    2068     _Configure_Object_RAM(_queues, sizeof(Message_queue_Control) )
    20692019#endif
    20702020
     
    20752025   */
    20762026  #define CONFIGURE_MAXIMUM_PARTITIONS                 0
    2077   /*
    2078    * This macro is calculated to specify the memory required for
    2079    * Classic API
    2080    */
    2081   #define _CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) 0
    2082 #else
    2083   #define _CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) \
    2084     _Configure_Object_RAM(_partitions, sizeof(Partition_Control) )
    20852027#endif
    20862028
     
    20912033   */
    20922034  #define CONFIGURE_MAXIMUM_REGIONS              0
    2093   /*
    2094    * This macro is calculated to specify the memory required for
    2095    * Classic API Regions.
    2096    */
    2097   #define _CONFIGURE_MEMORY_FOR_REGIONS(_regions) 0
    2098 #else
    2099   #define _CONFIGURE_MEMORY_FOR_REGIONS(_regions) \
    2100     _Configure_Object_RAM(_regions, sizeof(Region_Control) )
    21012035#endif
    21022036
     
    21072041   */
    21082042  #define CONFIGURE_MAXIMUM_PORTS            0
    2109   /**
    2110    * This macro is calculated to specify the memory required for
    2111    * Classic API Dual-Ported Memory Ports.
    2112    */
    2113   #define _CONFIGURE_MEMORY_FOR_PORTS(_ports) 0
    2114 #else
    2115   #define _CONFIGURE_MEMORY_FOR_PORTS(_ports) \
    2116     _Configure_Object_RAM(_ports, sizeof(Dual_ported_memory_Control) )
    21172043#endif
    21182044
     
    21232049   */
    21242050  #define CONFIGURE_MAXIMUM_PERIODS              0
    2125   /*
    2126    * This macro is calculated to specify the memory required for
    2127    * Classic API Rate Monotonic Periods.
    2128    */
    2129   #define _CONFIGURE_MEMORY_FOR_PERIODS(_periods) 0
    2130 #else
    2131   #define _CONFIGURE_MEMORY_FOR_PERIODS(_periods) \
    2132     _Configure_Object_RAM(_periods, sizeof(Rate_monotonic_Control) )
    21332051#endif
    21342052
     
    21462064 */
    21472065#define _CONFIGURE_BARRIERS \
    2148    (CONFIGURE_MAXIMUM_BARRIERS + _CONFIGURE_BARRIERS_FOR_FIFOS)
    2149 
    2150 /*
    2151  * This macro is calculated to specify the memory required for
    2152  * Classic API Barriers.
    2153  */
    2154 #if _CONFIGURE_BARRIERS == 0
    2155   #define _CONFIGURE_MEMORY_FOR_BARRIERS(_barriers) 0
    2156 #else
    2157   #define _CONFIGURE_MEMORY_FOR_BARRIERS(_barriers) \
    2158     _Configure_Object_RAM(_barriers, sizeof(Barrier_Control) )
    2159 #endif
     2066  (CONFIGURE_MAXIMUM_BARRIERS + _CONFIGURE_BARRIERS_FOR_FIFOS)
    21602067
    21612068#ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS
     
    21652072   */
    21662073  #define CONFIGURE_MAXIMUM_USER_EXTENSIONS                 0
    2167   /*
    2168    * This macro is calculated to specify the memory required for
    2169    * Classic API User Extensions.
    2170    */
    2171   #define _CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) 0
    2172 #else
    2173   #define _CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) \
    2174     _Configure_Object_RAM(_extensions, sizeof(Extension_Control) )
    21752074#endif
    21762075
     
    22982197  (CONFIGURE_MAXIMUM_POSIX_KEYS + _CONFIGURE_LIBIO_POSIX_KEYS)
    22992198
    2300 /*
    2301  * This macro is calculated to specify the memory required for
    2302  * POSIX API keys.
    2303  */
    2304 #define _CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys, _key_value_pairs) \
    2305    (_Configure_Object_RAM(_keys, sizeof(POSIX_Keys_Control) ) \
    2306     + _Configure_From_workspace( \
    2307       _Configure_Max_Objects(_key_value_pairs) \
    2308         * sizeof(POSIX_Keys_Key_value_pair)))
    2309 
    23102199/**
    23112200 * This configuration parameter specifies the maximum number of
     
    23212210 */
    23222211#define _Configure_POSIX_Named_Object_RAM(_number, _size) \
    2323   (_Configure_Object_RAM(_number, _size) \
    2324     + _Configure_Max_Objects(_number) \
    2325       * _Configure_From_workspace(_POSIX_PATH_MAX + 1))
     2212  (_Configure_Max_Objects(_number) \
     2213    * _Configure_From_workspace(_POSIX_PATH_MAX + 1))
    23262214
    23272215/**
     
    23712259  _Configure_POSIX_Named_Object_RAM(_shms, sizeof(POSIX_Shm_Control) )
    23722260
    2373 /*
    2374  *  The rest of the POSIX threads API features are only available when
    2375  *  POSIX is enabled.
    2376  */
    2377 #ifdef RTEMS_POSIX_API
    2378   #include <sys/types.h>
    2379   #include <signal.h>
    2380   #include <rtems/posix/psignal.h>
    2381   #include <rtems/posix/threadsup.h>
    2382   #include <rtems/posix/timer.h>
    2383 
    2384   /**
    2385    * This configuration parameter specifies the maximum number of
    2386    * POSIX API timers.
    2387    */
    2388   #ifndef CONFIGURE_MAXIMUM_POSIX_TIMERS
    2389     #define CONFIGURE_MAXIMUM_POSIX_TIMERS 0
    2390   #endif
    2391 
    2392   /*
    2393    * This macro is calculated to specify the memory required for
    2394    * POSIX API timers.
    2395    */
    2396   #define _CONFIGURE_MEMORY_FOR_POSIX_TIMERS(_timers) \
    2397     _Configure_Object_RAM(_timers, sizeof(POSIX_Timer_Control) )
    2398 
    2399   /**
    2400    * This configuration parameter specifies the maximum number of
    2401    * POSIX API queued signals.
    2402    */
    2403   #ifndef CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS
    2404     #define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 0
    2405   #endif
    2406 
    2407   /*
    2408    * This macro is calculated to specify the memory required for
    2409    * POSIX API queued signals.
    2410    */
    2411   #define _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) \
    2412     _Configure_From_workspace( \
    2413       (_queued_signals) * (sizeof(POSIX_signals_Siginfo_node)) )
    2414 #endif /* RTEMS_POSIX_API */
     2261/**
     2262 * This configuration parameter specifies the maximum number of
     2263 * POSIX API timers.
     2264 */
     2265#ifndef CONFIGURE_MAXIMUM_POSIX_TIMERS
     2266  #define CONFIGURE_MAXIMUM_POSIX_TIMERS 0
     2267#endif
     2268
     2269#if !defined(RTEMS_POSIX_API) && CONFIGURE_MAXIMUM_POSIX_TIMERS != 0
     2270  #error "CONFIGURE_MAXIMUM_POSIX_TIMERS must be zero if POSIX API is disabled"
     2271#endif
     2272
     2273/**
     2274 * This configuration parameter specifies the maximum number of
     2275 * POSIX API queued signals.
     2276 */
     2277#ifndef CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS
     2278  #define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 0
     2279#endif
     2280
     2281#if !defined(RTEMS_POSIX_API) && CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS != 0
     2282  #error "CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS must be zero if POSIX API is disabled"
     2283#endif
     2284
     2285#if CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS > 0
     2286  #define _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS \
     2287    _Configure_From_workspace( (CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS) * \
     2288      sizeof( POSIX_signals_Siginfo_node ) )
     2289#else
     2290  #define _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS 0
     2291#endif
    24152292
    24162293#ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE
     
    25372414     CONFIGURE_MAXIMUM_GOROUTINES)
    25382415
    2539 #ifdef RTEMS_POSIX_API
    2540   /*
    2541    * This macro is calculated to specify the memory required for
    2542    * the POSIX API in its entirety.
    2543    */
    2544   #define _CONFIGURE_MEMORY_FOR_POSIX \
    2545     (_CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( \
    2546         CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS) + \
    2547       _CONFIGURE_MEMORY_FOR_POSIX_TIMERS(CONFIGURE_MAXIMUM_POSIX_TIMERS))
    2548 #else
    2549   /*
    2550    * This macro is calculated to specify the memory required for
    2551    * the POSIX API in its entirety.
    2552    */
    2553   #define _CONFIGURE_MEMORY_FOR_POSIX 0
    2554 #endif
    2555 
    25562416/*
    25572417 * We must be able to split the free block used for the second last allocation
     
    25612421#define _CONFIGURE_HEAP_HANDLER_OVERHEAD \
    25622422  _Configure_Align_up( HEAP_BLOCK_HEADER_SIZE, CPU_HEAP_ALIGNMENT )
     2423
     2424/**
     2425 * This calculates the amount of memory reserved for the IDLE tasks.
     2426 * In an SMP system, each CPU core has its own idle task.
     2427 */
     2428#define _CONFIGURE_IDLE_TASKS_COUNT _CONFIGURE_MAXIMUM_PROCESSORS
    25632429
    25642430/*
     
    25742440 */
    25752441#define _CONFIGURE_MEMORY_FOR_TASKS(_tasks, _number_FP_tasks) \
    2576   ( \
    2577     _Configure_Object_RAM(_tasks, sizeof(Configuration_Thread_control)) \
    2578       + _Configure_From_workspace(_Configure_Max_Objects(_tasks) \
    2579         * THREAD_QUEUE_HEADS_SIZE(_CONFIGURE_SCHEDULER_COUNT)) \
    2580       + _Configure_Max_Objects(_number_FP_tasks) \
    2581         * _Configure_From_workspace(CONTEXT_FP_SIZE) \
    2582   )
     2442  (_Configure_Max_Objects(_number_FP_tasks) \
     2443    * _Configure_From_workspace(CONTEXT_FP_SIZE))
    25832444
    25842445/*
     
    26282489  #define CONFIGURE_MEMORY_OVERHEAD 0
    26292490#endif
    2630 
    2631 /**
    2632  * This calculates the amount of memory reserved for the IDLE tasks.
    2633  * In an SMP system, each CPU core has its own idle task.
    2634  */
    2635 #define _CONFIGURE_IDLE_TASKS_COUNT _CONFIGURE_MAXIMUM_PROCESSORS
    26362491
    26372492/**
     
    26712526
    26722527/**
    2673  * This macro provides a summation of the memory required by the
    2674  * Classic API as configured.
    2675  */
    2676 #define _CONFIGURE_MEMORY_FOR_CLASSIC \
    2677    (_CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS + \
    2678     _CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER ) + \
    2679    _CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES) + \
    2680    _CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) + \
    2681    _CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS) + \
    2682    _CONFIGURE_MEMORY_FOR_REGIONS( CONFIGURE_MAXIMUM_REGIONS ) + \
    2683    _CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS) + \
    2684    _CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS) + \
    2685    _CONFIGURE_MEMORY_FOR_BARRIERS(_CONFIGURE_BARRIERS) + \
    2686    _CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(CONFIGURE_MAXIMUM_USER_EXTENSIONS) \
    2687   )
    2688 
    2689 /**
    26902528 * This calculates the memory required for the executive workspace.
    26912529 *
     
    26992537   _CONFIGURE_MEMORY_FOR_TASKS( \
    27002538     _CONFIGURE_POSIX_THREADS, _CONFIGURE_POSIX_THREADS) + \
    2701    _CONFIGURE_MEMORY_FOR_CLASSIC + \
    2702    _CONFIGURE_MEMORY_FOR_POSIX_KEYS( \
    2703       _CONFIGURE_POSIX_KEYS, \
    2704       CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS ) + \
     2539   _CONFIGURE_MEMORY_FOR_MRSP_SEMAPHORES + \
    27052540   _CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( \
    27062541     CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES) + \
     
    27092544   _CONFIGURE_MEMORY_FOR_POSIX_SHMS( \
    27102545     CONFIGURE_MAXIMUM_POSIX_SHMS) + \
    2711    _CONFIGURE_MEMORY_FOR_POSIX + \
     2546   _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS + \
    27122547   _CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS + \
    27132548   _CONFIGURE_MEMORY_FOR_MP + \
     
    28832718  const size_t _Thread_Maximum_name_size = CONFIGURE_MAXIMUM_THREAD_NAME_SIZE;
    28842719
    2885   typedef struct {
     2720  struct Thread_Configured_control {
    28862721    Thread_Control Control;
    28872722    #if CONFIGURE_MAXIMUM_USER_EXTENSIONS > 0
     
    29032738      struct { /* Empty */ } Newlib;
    29042739    #endif
    2905   } Configuration_Thread_control;
    2906 
    2907   const size_t _Thread_Control_size = sizeof( Configuration_Thread_control );
     2740  };
    29082741
    29092742  const Thread_Control_add_on _Thread_Control_add_ons[] = {
    29102743    {
    2911       offsetof( Configuration_Thread_control, Control.Scheduler.nodes ),
    2912       offsetof( Configuration_Thread_control, Scheduler_nodes )
     2744      offsetof( Thread_Configured_control, Control.Scheduler.nodes ),
     2745      offsetof( Thread_Configured_control, Scheduler_nodes )
    29132746    }, {
    29142747      offsetof(
    2915         Configuration_Thread_control,
     2748        Thread_Configured_control,
    29162749        Control.API_Extensions[ THREAD_API_RTEMS ]
    29172750      ),
    2918       offsetof( Configuration_Thread_control, API_RTEMS )
     2751      offsetof( Thread_Configured_control, API_RTEMS )
    29192752    }, {
    29202753      offsetof(
    2921         Configuration_Thread_control,
     2754        Thread_Configured_control,
    29222755        Control.libc_reent
    29232756      ),
    2924       offsetof( Configuration_Thread_control, Newlib )
     2757      offsetof( Thread_Configured_control, Newlib )
    29252758    }
    29262759    #if CONFIGURE_MAXIMUM_THREAD_NAME_SIZE > 1
    29272760      , {
    29282761        offsetof(
    2929           Configuration_Thread_control,
     2762          Thread_Configured_control,
    29302763          Control.Join_queue.Queue.name
    29312764        ),
    2932         offsetof( Configuration_Thread_control, name )
     2765        offsetof( Thread_Configured_control, name )
    29332766      }
    29342767    #endif
     
    29362769      , {
    29372770        offsetof(
    2938           Configuration_Thread_control,
     2771          Thread_Configured_control,
    29392772          Control.API_Extensions[ THREAD_API_POSIX ]
    29402773        ),
    2941         offsetof( Configuration_Thread_control, API_POSIX )
     2774        offsetof( Thread_Configured_control, API_POSIX )
    29422775      }
    29432776    #endif
     
    29472780    RTEMS_ARRAY_SIZE( _Thread_Control_add_ons );
    29482781
     2782  #if defined(RTEMS_SMP)
     2783    struct Thread_queue_Configured_heads {
     2784      Thread_queue_Heads Heads;
     2785        Thread_queue_Priority_queue Priority[ _CONFIGURE_SCHEDULER_COUNT ];
     2786    };
     2787
     2788    const size_t _Thread_queue_Heads_size =
     2789      sizeof( Thread_queue_Configured_heads );
     2790  #endif
     2791
    29492792  const uint32_t _Watchdog_Nanoseconds_per_tick =
    2950     1000 * CONFIGURE_MICROSECONDS_PER_TICK;
     2793    (uint32_t) 1000 * CONFIGURE_MICROSECONDS_PER_TICK;
    29512794
    29522795  const uint32_t _Watchdog_Ticks_per_second = _CONFIGURE_TICKS_PER_SECOND;
     2796
     2797  const size_t _Thread_Initial_thread_count = _CONFIGURE_IDLE_TASKS_COUNT +
     2798    _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT +
     2799    rtems_resource_maximum_per_allocation( _CONFIGURE_TASKS ) +
     2800    rtems_resource_maximum_per_allocation( _CONFIGURE_POSIX_THREADS );
     2801
     2802  THREAD_INFORMATION_DEFINE(
     2803    _Thread,
     2804    OBJECTS_INTERNAL_API,
     2805    OBJECTS_INTERNAL_THREADS,
     2806    _CONFIGURE_IDLE_TASKS_COUNT + _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT
     2807  );
     2808
     2809  #if _CONFIGURE_BARRIERS > 0
     2810    BARRIER_INFORMATION_DEFINE( _CONFIGURE_BARRIERS );
     2811  #endif
     2812
     2813  #if CONFIGURE_MAXIMUM_MESSAGE_QUEUES > 0
     2814    MESSAGE_QUEUE_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_MESSAGE_QUEUES );
     2815  #endif
     2816
     2817  #if CONFIGURE_MAXIMUM_PARTITIONS > 0
     2818    PARTITION_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_PARTITIONS );
     2819  #endif
     2820
     2821  #if CONFIGURE_MAXIMUM_PERIODS > 0
     2822    RATE_MONOTONIC_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_PERIODS );
     2823  #endif
     2824
     2825  #if CONFIGURE_MAXIMUM_PORTS > 0
     2826    DUAL_PORTED_MEMORY_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_PORTS );
     2827  #endif
     2828
     2829  #if CONFIGURE_MAXIMUM_REGIONS > 0
     2830    REGION_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_REGIONS );
     2831  #endif
     2832
     2833  #if CONFIGURE_MAXIMUM_SEMAPHORES > 0
     2834    SEMAPHORE_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_SEMAPHORES );
     2835  #endif
     2836
     2837  #if _CONFIGURE_TIMERS > 0
     2838    TIMER_INFORMATION_DEFINE( _CONFIGURE_TIMERS );
     2839  #endif
     2840
     2841  #if _CONFIGURE_TASKS > 0
     2842    THREAD_INFORMATION_DEFINE(
     2843      _RTEMS_tasks,
     2844      OBJECTS_CLASSIC_API,
     2845      OBJECTS_RTEMS_TASKS,
     2846      _CONFIGURE_TASKS
     2847    );
     2848  #endif
     2849
     2850  #if CONFIGURE_MAXIMUM_USER_EXTENSIONS > 0
     2851    EXTENSION_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_USER_EXTENSIONS );
     2852  #endif
    29532853
    29542854  /**
     
    29562856   */
    29572857  rtems_api_configuration_table Configuration_RTEMS_API = {
    2958     _CONFIGURE_TASKS,
    2959     CONFIGURE_MAXIMUM_TIMERS + _CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER,
    2960     CONFIGURE_MAXIMUM_SEMAPHORES,
    2961     CONFIGURE_MAXIMUM_MESSAGE_QUEUES,
    2962     CONFIGURE_MAXIMUM_PARTITIONS,
    2963     CONFIGURE_MAXIMUM_REGIONS,
    2964     CONFIGURE_MAXIMUM_PORTS,
    2965     CONFIGURE_MAXIMUM_PERIODS,
    2966     _CONFIGURE_BARRIERS,
    29672858    CONFIGURE_INIT_TASK_TABLE_SIZE,
    29682859    CONFIGURE_INIT_TASK_TABLE
    29692860  };
    29702861
     2862  #if CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS > 0
     2863    POSIX_Keys_Key_value_pair _POSIX_Keys_Key_value_pairs[
     2864      rtems_resource_maximum_per_allocation(
     2865        CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS
     2866      )
     2867    ];
     2868
     2869    const uint32_t _POSIX_Keys_Key_value_pair_maximum =
     2870      CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS;
     2871  #endif
     2872
     2873  #if _CONFIGURE_POSIX_KEYS > 0
     2874    POSIX_KEYS_INFORMATION_DEFINE( _CONFIGURE_POSIX_KEYS );
     2875  #endif
     2876
    29712877  #if CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES > 0
    2972     const uint32_t _Configuration_POSIX_Maximum_message_queues =
    2973       CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES;
     2878    POSIX_MESSAGE_QUEUE_INFORMATION_DEFINE(
     2879      CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES
     2880    );
    29742881  #endif
    29752882
    29762883  #if CONFIGURE_MAXIMUM_POSIX_SEMAPHORES > 0
    2977     const uint32_t _Configuration_POSIX_Maximum_named_semaphores =
    2978       CONFIGURE_MAXIMUM_POSIX_SEMAPHORES;
     2884    POSIX_SEMAPHORE_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_POSIX_SEMAPHORES );
    29792885  #endif
    29802886
    29812887  #if CONFIGURE_MAXIMUM_POSIX_SHMS > 0
    2982     const uint32_t _Configuration_POSIX_Maximum_shms =
    2983       CONFIGURE_MAXIMUM_POSIX_SHMS;
     2888    POSIX_SHM_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_POSIX_SHMS );
    29842889  #endif
    29852890
    29862891  #if _CONFIGURE_POSIX_THREADS > 0
    2987     const uint32_t _Configuration_POSIX_Maximum_threads =
    2988       _CONFIGURE_POSIX_THREADS;
     2892    THREAD_INFORMATION_DEFINE(
     2893      _POSIX_Threads,
     2894      OBJECTS_POSIX_API,
     2895      OBJECTS_POSIX_THREADS,
     2896      CONFIGURE_MAXIMUM_POSIX_THREADS
     2897    );
    29892898  #endif
    29902899
     
    29962905
    29972906    #if CONFIGURE_MAXIMUM_POSIX_TIMERS > 0
    2998       const uint32_t _Configuration_POSIX_Maximum_timers =
    2999         CONFIGURE_MAXIMUM_POSIX_TIMERS;
     2907      POSIX_TIMER_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_POSIX_TIMERS );
    30002908    #endif
    30012909  #endif
     
    30222930    _CONFIGURE_STACK_SPACE_SIZE,               /* required stack space */
    30232931    CONFIGURE_MAXIMUM_USER_EXTENSIONS,        /* maximum dynamic extensions */
    3024     _CONFIGURE_POSIX_KEYS,                     /* POSIX keys are always */
    3025     CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS,  /*   enabled */
    30262932    CONFIGURE_MICROSECONDS_PER_TICK,          /* microseconds per clock tick */
    30272933    CONFIGURE_TICKS_PER_TIMESLICE,            /* ticks per timeslice quantum */
     
    31833089    uint32_t PER_INTEGER_TASK;
    31843090    uint32_t FP_OVERHEAD;
    3185     uint32_t CLASSIC;
    3186     uint32_t POSIX;
    31873091
    31883092    /* System overhead pieces */
    31893093    uint32_t MEMORY_FOR_IDLE_TASK;
    31903094
    3191     /* Classic API Pieces */
    3192     uint32_t CLASSIC_TASKS;
    3193     uint32_t TIMERS;
    3194     uint32_t SEMAPHORES;
    3195     uint32_t MESSAGE_QUEUES;
    3196     uint32_t PARTITIONS;
    3197     uint32_t REGIONS;
    3198     uint32_t PORTS;
    3199     uint32_t PERIODS;
    3200     uint32_t BARRIERS;
    3201     uint32_t USER_EXTENSIONS;
    3202 
    3203     /* POSIX API managers that are always enabled */
    3204     uint32_t POSIX_KEYS;
    3205 
    32063095    /* POSIX API Pieces */
    3207 #ifdef RTEMS_POSIX_API
    3208     uint32_t POSIX_TIMERS;
    32093096    uint32_t POSIX_QUEUED_SIGNALS;
    3210 #endif
    3211     uint32_t POSIX_MESSAGE_QUEUES;
    3212     uint32_t POSIX_SEMAPHORES;
    3213     uint32_t POSIX_SHMS;
    32143097
    32153098    /* Stack space sizes */
     
    32313114    _CONFIGURE_MEMORY_FOR_TASKS(1, 0),
    32323115    _CONFIGURE_MEMORY_FOR_TASKS(0, 1),
    3233     _CONFIGURE_MEMORY_FOR_CLASSIC,
    3234     _CONFIGURE_MEMORY_FOR_POSIX,
    32353116
    32363117    /* System overhead pieces */
    32373118    _CONFIGURE_MEMORY_FOR_INTERNAL_TASKS,
    32383119
    3239     /* Classic API Pieces */
    3240     _CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS, 0),
    3241     _CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS),
    3242     _CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES),
    3243     _CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES),
    3244     _CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS),
    3245     _CONFIGURE_MEMORY_FOR_REGIONS( CONFIGURE_MAXIMUM_REGIONS ),
    3246     _CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS),
    3247     _CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS),
    3248     _CONFIGURE_MEMORY_FOR_BARRIERS(_CONFIGURE_BARRIERS),
    3249     _CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(CONFIGURE_MAXIMUM_USER_EXTENSIONS),
    3250     _CONFIGURE_MEMORY_FOR_POSIX_KEYS( _CONFIGURE_POSIX_KEYS, \
    3251                                      CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS ),
    3252 
    32533120    /* POSIX API Pieces */
    3254 #ifdef RTEMS_POSIX_API
    3255     _CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ),
    3256     _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(
    3257       CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ),
    3258 #endif
    3259     _CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(
    3260       CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ),
    3261     _CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ),
    3262     _CONFIGURE_MEMORY_FOR_POSIX_SHMS( CONFIGURE_MAXIMUM_POSIX_SHMS ),
     3121    _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS,
    32633122
    32643123    /* Stack space sizes */
     
    33103169    !defined(RTEMS_MULTIPROCESSING)
    33113170#error "CONFIGURATION ERROR: RTEMS not configured for multiprocessing!!"
    3312 #endif
    3313 
    3314 /*
    3315  *  If an attempt was made to configure POSIX objects and
    3316  *  the POSIX API was not configured into RTEMS, error out.
    3317  *
    3318  *  @note POSIX Keys are always available so the parameters
    3319  *        CONFIGURE_MAXIMUM_POSIX_KEYS and
    3320  *        CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS  are not in this list.
    3321  */
    3322 #if !defined(RTEMS_POSIX_API)
    3323   #if ((CONFIGURE_MAXIMUM_POSIX_TIMERS != 0) || \
    3324        (CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS != 0))
    3325   #error "CONFIGURATION ERROR: POSIX API support not configured!!"
    3326   #endif
    33273171#endif
    33283172
  • cpukit/include/rtems/config.h

    r0f5b2c09 r21275b58  
    128128  uintptr_t                      stack_space_size;
    129129
    130   /**
    131    * This field specifies the maximum number of dynamically installed
    132    * used extensions.
    133    */
    134   uint32_t                       maximum_extensions;
    135 
    136   /**
    137    * This field contains the maximum number of POSIX API
    138    * keys which are configured for this application.
    139    */
    140   uint32_t                       maximum_keys;
    141 
    142130  /**
    143131   * This field contains the maximum number of POSIX API
  • cpukit/include/rtems/extensiondata.h

    r0f5b2c09 r21275b58  
    3838}   Extension_Control;
    3939
     40/**
     41 * @brief The Classic Extensions objects information.
     42 */
     43extern Objects_Information _Extension_Information;
     44
     45/**
     46 * @brief Macro to define the objects information for the Classic Extensions
     47 * objects.
     48 *
     49 * This macro should only be used by <rtems/confdefs.h>.
     50 *
     51 * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
     52 * may be set).
     53 */
     54#define EXTENSION_INFORMATION_DEFINE( max ) \
     55  OBJECTS_INFORMATION_DEFINE( \
     56    _Extension, \
     57    OBJECTS_CLASSIC_API, \
     58    OBJECTS_RTEMS_EXTENSIONS, \
     59    Extension_Control, \
     60    max, \
     61    OBJECTS_NO_STRING_NAME, \
     62    NULL \
     63  )
     64
    4065/** @} */
    4166
  • cpukit/include/rtems/extensionimpl.h

    r0f5b2c09 r21275b58  
    3434 */
    3535
    36 extern Objects_Information  _Extension_Information;
    37 
    3836RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Allocate( void )
    3937{
  • cpukit/include/rtems/posix/key.h

    r0f5b2c09 r21275b58  
    7272
    7373/**
     74 * @brief The initial set of POSIX key and value pairs.
     75 *
     76 * This array is provided via <rtems/confdefs.h> in case POSIX key and value
     77 * pairs are configured.  The POSIX key and value pair count in this array must
     78 * be equal to
     79 * _Objects_Maximum_per_allocation( _POSIX_Keys_Key_value_pair_maximum ).
     80 */
     81extern POSIX_Keys_Key_value_pair _POSIX_Keys_Key_value_pairs[];
     82
     83/**
     84 * @brief The POSIX key and value pairs maximum.
     85 *
     86 * This value is provided via <rtems/confdefs.h> in case POSIX key and value
     87 * pairs are configured.  The OBJECTS_UNLIMITED_OBJECTS flag may be set.
     88 */
     89extern const uint32_t _POSIX_Keys_Key_value_pair_maximum;
     90
     91/**
    7492 * @brief The data structure used to manage a POSIX key.
    7593 */
     
    86104 }  POSIX_Keys_Control;
    87105
     106/**
     107 * @brief The POSIX Key objects information.
     108 */
     109extern Objects_Information _POSIX_Keys_Information;
     110
     111/**
     112 * @brief Macro to define the objects information for the POSIX Key objects.
     113 *
     114 * This macro should only be used by <rtems/confdefs.h>.
     115 *
     116 * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
     117 * may be set).
     118 */
     119#define POSIX_KEYS_INFORMATION_DEFINE( max ) \
     120  OBJECTS_INFORMATION_DEFINE( \
     121    _POSIX_Keys, \
     122    OBJECTS_POSIX_API, \
     123    OBJECTS_POSIX_KEYS, \
     124    POSIX_Keys_Control, \
     125    max, \
     126    OBJECTS_NO_STRING_NAME, \
     127    NULL \
     128  )
     129
    88130/** @} */
    89131
  • cpukit/include/rtems/posix/keyimpl.h

    r0f5b2c09 r21275b58  
    3636 * @{
    3737 */
    38 
    39 /**
    40  * @brief The information control block used to manage this class of objects.
    41  */
    42 extern Objects_Information _POSIX_Keys_Information;
    4338
    4439/**
  • cpukit/include/rtems/posix/mqueue.h

    r0f5b2c09 r21275b58  
    3232#define _RTEMS_POSIX_MQUEUE_H
    3333
    34 #include <signal.h>
    35 #include <mqueue.h> /* struct mq_attr */
    3634#include <rtems/score/coremsg.h>
    3735#include <rtems/score/objectdata.h>
     36
     37#include <limits.h>
     38#include <mqueue.h>
     39#include <signal.h>
    3840
    3941#ifdef __cplusplus
     
    6264}  POSIX_Message_queue_Control;
    6365
    64 extern const uint32_t _Configuration_POSIX_Maximum_message_queues;
     66/**
     67 * @brief The POSIX Message Queue objects information.
     68 */
     69extern Objects_Information _POSIX_Message_queue_Information;
     70
     71/**
     72 * @brief Macro to define the objects information for the POSIX Message Queue
     73 * objects.
     74 *
     75 * This macro should only be used by <rtems/confdefs.h>.
     76 *
     77 * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
     78 * may be set).
     79 */
     80#define POSIX_MESSAGE_QUEUE_INFORMATION_DEFINE( max ) \
     81  OBJECTS_INFORMATION_DEFINE( \
     82    _POSIX_Message_queue, \
     83    OBJECTS_POSIX_API, \
     84    OBJECTS_POSIX_MESSAGE_QUEUES, \
     85    POSIX_Message_queue_Control, \
     86    max, \
     87    _POSIX_PATH_MAX, \
     88    NULL \
     89  )
    6590
    6691/** @} */
  • cpukit/include/rtems/posix/mqueueimpl.h

    r0f5b2c09 r21275b58  
    3030extern "C" {
    3131#endif
    32 
    33 /**
    34  *  This defines the information control block used to manage
    35  *  this class of objects.
    36  */
    37 extern Objects_Information _POSIX_Message_queue_Information;
    3832
    3933/**
  • cpukit/include/rtems/posix/pthread.h

    r0f5b2c09 r21275b58  
    3939extern const size_t _Configuration_POSIX_Minimum_stack_size;
    4040
    41 extern const uint32_t _Configuration_POSIX_Maximum_threads;
    42 
    4341/**
    4442 * @brief POSIX threads initialize user threads body.
     
    4846 */
    4947extern void _POSIX_Threads_Initialize_user_threads_body(void);
     48
     49/**
     50 * The following defines the information control block used to manage
     51 * this class of objects.
     52 */
     53extern Thread_Information _POSIX_Threads_Information;
    5054
    5155/** @} */
  • cpukit/include/rtems/posix/pthreadimpl.h

    r0f5b2c09 r21275b58  
    4242 */
    4343#define PTHREAD_MINIMUM_STACK_SIZE _Configuration_POSIX_Minimum_stack_size
    44 
    45 /**
    46  * The following defines the information control block used to manage
    47  * this class of objects.
    48  */
    49 extern Thread_Information _POSIX_Threads_Information;
    5044
    5145#if defined(RTEMS_POSIX_API)
  • cpukit/include/rtems/posix/semaphore.h

    r0f5b2c09 r21275b58  
    2020#define _RTEMS_POSIX_SEMAPHORE_H
    2121
     22#include <rtems/score/objectdata.h>
     23
     24#include <limits.h>
    2225#include <semaphore.h>
    23 #include <rtems/score/objectdata.h>
    2426
    2527#ifdef __cplusplus
     
    4749}  POSIX_Semaphore_Control;
    4850
    49 extern const uint32_t _Configuration_POSIX_Maximum_named_semaphores;
     51/**
     52 * @brief The POSIX Semaphore objects information.
     53 */
     54extern Objects_Information _POSIX_Semaphore_Information;
     55
     56/**
     57 * @brief Macro to define the objects information for the POSIX Semaphore
     58 * objects.
     59 *
     60 * This macro should only be used by <rtems/confdefs.h>.
     61 *
     62 * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
     63 * may be set).
     64 */
     65#define POSIX_SEMAPHORE_INFORMATION_DEFINE( max ) \
     66  OBJECTS_INFORMATION_DEFINE( \
     67    _POSIX_Semaphore, \
     68    OBJECTS_POSIX_API, \
     69    OBJECTS_POSIX_SEMAPHORES, \
     70    POSIX_Semaphore_Control, \
     71    max, \
     72    _POSIX_PATH_MAX, \
     73    NULL \
     74  )
    5075
    5176/** @} */
  • cpukit/include/rtems/posix/semaphoreimpl.h

    r0f5b2c09 r21275b58  
    3434 */
    3535#define POSIX_SEMAPHORE_MAGIC 0x5d367fe7UL
    36 
    37 /**
    38  *  This defines the information control block used to manage
    39  *  this class of objects.
    40  */
    41 extern Objects_Information _POSIX_Semaphore_Information;
    4236
    4337RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *
  • cpukit/include/rtems/posix/shm.h

    r0f5b2c09 r21275b58  
    127127} POSIX_Shm_Control;
    128128
    129 extern const uint32_t _Configuration_POSIX_Maximum_shms;
     129/**
     130 * @brief The POSIX Shared Memory objects information.
     131 */
     132extern Objects_Information _POSIX_Shm_Information;
     133
     134/**
     135 * @brief Macro to define the objects information for the POSIX Shared Memory
     136 * objects.
     137 *
     138 * This macro should only be used by <rtems/confdefs.h>.
     139 *
     140 * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
     141 * may be set).
     142 */
     143#define POSIX_SHM_INFORMATION_DEFINE( max ) \
     144  OBJECTS_INFORMATION_DEFINE( \
     145    _POSIX_Shm, \
     146    OBJECTS_POSIX_API, \
     147    OBJECTS_POSIX_SHMS, \
     148    POSIX_Shm_Control, \
     149    max, \
     150    _POSIX_PATH_MAX, \
     151    NULL \
     152  )
    130153
    131154/**
  • cpukit/include/rtems/posix/shmimpl.h

    r0f5b2c09 r21275b58  
    3131 * @{
    3232 */
    33 
    34 extern Objects_Information _POSIX_Shm_Information;
    3533
    3634RTEMS_INLINE_ROUTINE POSIX_Shm_Control *_POSIX_Shm_Allocate_unprotected( void )
  • cpukit/include/rtems/posix/sigset.h

    r0f5b2c09 r21275b58  
    2020#define _RTEMS_POSIX_SIGSET_H
    2121
    22 #include <signal.h> // sigset_t
     22#include <stdbool.h>
     23#include <signal.h>
    2324
    2425/*
  • cpukit/include/rtems/posix/timer.h

    r0f5b2c09 r21275b58  
    5151} POSIX_Timer_Control;
    5252
    53 extern const uint32_t _Configuration_POSIX_Maximum_timers;
     53/**
     54 * @brief The POSIX Timer objects information.
     55 */
     56extern Objects_Information _POSIX_Timer_Information;
     57
     58/**
     59 * @brief Macro to define the objects information for the POSIX Timer objects.
     60 *
     61 * This macro should only be used by <rtems/confdefs.h>.
     62 *
     63 * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
     64 * may be set).
     65 */
     66#define POSIX_TIMER_INFORMATION_DEFINE( max ) \
     67  OBJECTS_INFORMATION_DEFINE( \
     68    _POSIX_Timer, \
     69    OBJECTS_POSIX_API, \
     70    OBJECTS_POSIX_TIMERS, \
     71    POSIX_Timer_Control, \
     72    max, \
     73    OBJECTS_NO_STRING_NAME, \
     74    NULL \
     75  )
    5476
    5577/** @} */
  • cpukit/include/rtems/posix/timerimpl.h

    r0f5b2c09 r21275b58  
    5151#error "POSIX_TIMER_RELATIVE == TIMER_ABSTIME"
    5252#endif
    53 
    54 /**
    55  *  The following defines the information control block used to manage
    56  *  this class of objects.
    57  */
    58 extern Objects_Information _POSIX_Timer_Information;
    5953
    6054/**
  • cpukit/include/rtems/rtems/barrierdata.h

    r0f5b2c09 r21275b58  
    4545}   Barrier_Control;
    4646
     47/**
     48 * @brief The Classic Barrier objects information.
     49 */
     50extern Objects_Information _Barrier_Information;
     51
     52/**
     53 * @brief Macro to define the objects information for the Classic Barrier
     54 * objects.
     55 *
     56 * This macro should only be used by <rtems/confdefs.h>.
     57 *
     58 * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
     59 * may be set).
     60 */
     61#define BARRIER_INFORMATION_DEFINE( max ) \
     62  OBJECTS_INFORMATION_DEFINE( \
     63    _Barrier, \
     64    OBJECTS_CLASSIC_API, \
     65    OBJECTS_RTEMS_BARRIERS, \
     66    Barrier_Control, \
     67    max, \
     68    OBJECTS_NO_STRING_NAME, \
     69    NULL \
     70  )
     71
    4772/** @} */
    4873
  • cpukit/include/rtems/rtems/barrierimpl.h

    r0f5b2c09 r21275b58  
    3434 *  @{
    3535 */
    36 
    37 /**
    38  *  The following defines the information control block used to manage
    39  *  this class of objects.
    40  */
    41 extern Objects_Information _Barrier_Information;
    4236
    4337/**
  • cpukit/include/rtems/rtems/config.h

    r0f5b2c09 r21275b58  
    4848 */
    4949typedef struct {
    50   /**
    51    * This field contains the maximum number of Classic API
    52    * Tasks which are configured for this application.
    53    */
    54   uint32_t                    maximum_tasks;
    55 
    56   /**
    57    * This field contains the maximum number of Classic API
    58    * Timers which are configured for this application.
    59    */
    60   uint32_t                    maximum_timers;
    61 
    62   /**
    63    * This field contains the maximum number of Classic API
    64    * Semaphores which are configured for this application.
    65    */
    66   uint32_t                    maximum_semaphores;
    67 
    68   /**
    69    * This field contains the maximum number of Classic API
    70    * Message Queues which are configured for this application.
    71    */
    72   uint32_t                    maximum_message_queues;
    73 
    74   /**
    75    * This field contains the maximum number of Classic API
    76    * Partitions which are configured for this application.
    77    */
    78   uint32_t                    maximum_partitions;
    79 
    80   /**
    81    * This field contains the maximum number of Classic API
    82    * Regions which are configured for this application.
    83    */
    84   uint32_t                    maximum_regions;
    85 
    86   /**
    87    * This field contains the maximum number of Classic API
    88    * Dual Ported Memory Areas which are configured for this
    89    * application.
    90    */
    91   uint32_t                    maximum_ports;
    92 
    93   /**
    94    * This field contains the maximum number of Classic API
    95    * Rate Monotonic Periods which are configured for this
    96    * application.
    97    */
    98   uint32_t                    maximum_periods;
    99 
    100   /**
    101    * This field contains the maximum number of Classic API
    102    * Barriers which are configured for this application.
    103    */
    104   uint32_t                    maximum_barriers;
    10550
    10651  /**
  • cpukit/include/rtems/rtems/dpmemdata.h

    r0f5b2c09 r21275b58  
    4747}   Dual_ported_memory_Control;
    4848
     49/**
     50 * @brief The Classic Dual Ported Memory objects information.
     51 */
     52extern Objects_Information _Dual_ported_memory_Information;
     53
     54/**
     55 * @brief Macro to define the objects information for the Classic Dual Ported
     56 * Memory objects.
     57 *
     58 * This macro should only be used by <rtems/confdefs.h>.
     59 *
     60 * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
     61 * may be set).
     62 */
     63#define DUAL_PORTED_MEMORY_INFORMATION_DEFINE( max ) \
     64  OBJECTS_INFORMATION_DEFINE( \
     65    _Dual_ported_memory, \
     66    OBJECTS_CLASSIC_API, \
     67    OBJECTS_RTEMS_PORTS, \
     68    Dual_ported_memory_Control, \
     69    max, \
     70    OBJECTS_NO_STRING_NAME, \
     71    NULL \
     72  )
     73
    4974/** @} */
    5075
  • cpukit/include/rtems/rtems/dpmemimpl.h

    r0f5b2c09 r21275b58  
    3232 * @{
    3333 */
    34 
    35 /**
    36  *  @brief Define the internal Dual Ported Memory information
    37  *  The following define the internal Dual Ported Memory information.
    38  */
    39 extern Objects_Information _Dual_ported_memory_Information;
    4034
    4135/**
  • cpukit/include/rtems/rtems/messagedata.h

    r0f5b2c09 r21275b58  
    4545}   Message_queue_Control;
    4646
     47/**
     48 * @brief The Classic Message Queue objects information.
     49 */
     50extern Objects_Information _Message_queue_Information;
     51
     52#if defined(RTEMS_MULTIPROCESSING)
     53/**
     54 *  @brief _Message_queue_MP_Send_extract_proxy
     55 *
     56 *  This routine is invoked when a task is deleted and it
     57 *  has a proxy which must be removed from a thread queue and
     58 *  the remote node must be informed of this.
     59 */
     60void _Message_queue_MP_Send_extract_proxy (
     61  Thread_Control *the_thread,
     62  Objects_Id      id
     63);
     64#endif
     65
     66/**
     67 * @brief Macro to define the objects information for the Classic Message Queue
     68 * objects.
     69 *
     70 * This macro should only be used by <rtems/confdefs.h>.
     71 *
     72 * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
     73 * may be set).
     74 */
     75#define MESSAGE_QUEUE_INFORMATION_DEFINE( max ) \
     76  OBJECTS_INFORMATION_DEFINE( \
     77    _Message_queue, \
     78    OBJECTS_CLASSIC_API, \
     79    OBJECTS_RTEMS_MESSAGE_QUEUES, \
     80    Message_queue_Control, \
     81    max, \
     82    OBJECTS_NO_STRING_NAME, \
     83    _Message_queue_MP_Send_extract_proxy \
     84  )
     85
    4786/** @} */
    4887
  • cpukit/include/rtems/rtems/messageimpl.h

    r0f5b2c09 r21275b58  
    5151  MESSAGE_QUEUE_URGENT_REQUEST = 1
    5252}  Message_queue_Submit_types;
    53 
    54 /**
    55  *  The following defines the information control block used to
    56  *  manage this class of objects.
    57  */
    58 extern Objects_Information _Message_queue_Information;
    5953
    6054/**
  • cpukit/include/rtems/rtems/msgmp.h

    r0f5b2c09 r21275b58  
    190190);
    191191
    192 /**
    193  *  @brief _Message_queue_MP_Send_extract_proxy
    194  *
    195  *  This routine is invoked when a task is deleted and it
    196  *  has a proxy which must be removed from a thread queue and
    197  *  the remote node must be informed of this.
    198  */
    199 void _Message_queue_MP_Send_extract_proxy (
    200   Thread_Control *the_thread,
    201   Objects_Id      id
    202 );
    203 
    204192/**@}*/
    205193
  • cpukit/include/rtems/rtems/partdata.h

    r0f5b2c09 r21275b58  
    5454}   Partition_Control;
    5555
     56/**
     57 * @brief The Classic Partition objects information.
     58 */
     59extern Objects_Information _Partition_Information;
     60
     61#if defined(RTEMS_MULTIPROCESSING)
     62/**
     63 *  @brief Partition_MP_Send_extract_proxy
     64 *
     65 *  This routine is invoked when a task is deleted and it
     66 *  has a proxy which must be removed from a thread queue and
     67 *  the remote node must be informed of this.
     68 */
     69void _Partition_MP_Send_extract_proxy (
     70  Thread_Control *the_thread,
     71  Objects_Id      id
     72);
     73#endif
     74
     75/**
     76 * @brief Macro to define the objects information for the Classic Partition
     77 * objects.
     78 *
     79 * This macro should only be used by <rtems/confdefs.h>.
     80 *
     81 * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
     82 * may be set).
     83 */
     84#define PARTITION_INFORMATION_DEFINE( max ) \
     85  OBJECTS_INFORMATION_DEFINE( \
     86    _Partition, \
     87    OBJECTS_CLASSIC_API, \
     88    OBJECTS_RTEMS_PARTITIONS, \
     89    Partition_Control, \
     90    max, \
     91    OBJECTS_NO_STRING_NAME, \
     92    _Partition_MP_Send_extract_proxy \
     93  )
     94
    5695/** @} */
    5796
  • cpukit/include/rtems/rtems/partimpl.h

    r0f5b2c09 r21275b58  
    3333 * @{
    3434 */
    35 
    36 /**
    37  *  The following defines the information control block used to
    38  *  manage this class of objects.
    39  */
    40 extern Objects_Information _Partition_Information;
    4135
    4236/**
  • cpukit/include/rtems/rtems/partmp.h

    r0f5b2c09 r21275b58  
    123123 */
    124124
    125 /**
    126  *  @brief Partition_MP_Send_extract_proxy
    127  *
    128  *  This routine is invoked when a task is deleted and it
    129  *  has a proxy which must be removed from a thread queue and
    130  *  the remote node must be informed of this.
    131  */
    132 void _Partition_MP_Send_extract_proxy (
    133   Thread_Control *the_thread,
    134   Objects_Id      id
    135 );
    136 
    137125#ifdef __cplusplus
    138126}
  • cpukit/include/rtems/rtems/ratemondata.h

    r0f5b2c09 r21275b58  
    131131}   Rate_monotonic_Control;
    132132
     133/**
     134 * @brief The Classic Rate Monotonic objects information.
     135 */
     136extern Objects_Information _Rate_monotonic_Information;
     137
     138/**
     139 * @brief Macro to define the objects information for the Classic Rate
     140 * Monotonic objects.
     141 *
     142 * This macro should only be used by <rtems/confdefs.h>.
     143 *
     144 * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
     145 * may be set).
     146 */
     147#define RATE_MONOTONIC_INFORMATION_DEFINE( max ) \
     148  OBJECTS_INFORMATION_DEFINE( \
     149    _Rate_monotonic, \
     150    OBJECTS_CLASSIC_API, \
     151    OBJECTS_RTEMS_PERIODS, \
     152    Rate_monotonic_Control, \
     153    max, \
     154    OBJECTS_NO_STRING_NAME, \
     155    NULL \
     156  )
     157
    133158/** @} */
    134159
  • cpukit/include/rtems/rtems/ratemonimpl.h

    r0f5b2c09 r21275b58  
    4848#define RATE_MONOTONIC_READY_AGAIN \
    4949  ( THREAD_WAIT_CLASS_PERIOD | THREAD_WAIT_STATE_READY_AGAIN )
    50 
    51 /**
    52  *  @brief Rate Monotonic Period Class Management Structure
    53  *
    54  *  This instance of Objects_Information is used to manage the
    55  *  set of rate monotonic period instances.
    56  */
    57 extern Objects_Information _Rate_monotonic_Information;
    5850
    5951/**
  • cpukit/include/rtems/rtems/regiondata.h

    r0f5b2c09 r21275b58  
    4747}  Region_Control;
    4848
     49/**
     50 * @brief The Classic Region objects information.
     51 */
     52extern Objects_Information _Region_Information;
     53
     54/**
     55 * @brief Macro to define the objects information for the Classic Region
     56 * objects.
     57 *
     58 * This macro should only be used by <rtems/confdefs.h>.
     59 *
     60 * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
     61 * may be set).
     62 */
     63#define REGION_INFORMATION_DEFINE( max ) \
     64  OBJECTS_INFORMATION_DEFINE( \
     65    _Region, \
     66    OBJECTS_CLASSIC_API, \
     67    OBJECTS_RTEMS_REGIONS, \
     68    Region_Control, \
     69    max, \
     70    OBJECTS_NO_STRING_NAME, \
     71    NULL \
     72  )
     73
    4974/** @} */
    5075
  • cpukit/include/rtems/rtems/regionimpl.h

    r0f5b2c09 r21275b58  
    3838#define REGION_OF_THREAD_QUEUE_QUEUE( queue ) \
    3939  RTEMS_CONTAINER_OF( queue, Region_Control, Wait_queue.Queue )
    40 
    41 /**
    42  *  The following defines the information control block used to
    43  *  manage this class of objects.
    44  */
    45 extern Objects_Information _Region_Information;
    4640
    4741/**
  • cpukit/include/rtems/rtems/semdata.h

    r0f5b2c09 r21275b58  
    9393}   Semaphore_Control;
    9494
     95/**
     96 * @brief The Classic Semaphore objects information.
     97 */
     98extern Objects_Information _Semaphore_Information;
     99
     100#if defined(RTEMS_MULTIPROCESSING)
     101/**
     102 *  @brief Semaphore MP Send Extract Proxy
     103 *
     104 *  This routine is invoked when a task is deleted and it
     105 *  has a proxy which must be removed from a thread queue and
     106 *  the remote node must be informed of this.
     107 */
     108void _Semaphore_MP_Send_extract_proxy (
     109  Thread_Control *the_thread,
     110  Objects_Id      id
     111);
     112#endif
     113
     114/**
     115 * @brief Macro to define the objects information for the Classic Semaphore
     116 * objects.
     117 *
     118 * This macro should only be used by <rtems/confdefs.h>.
     119 *
     120 * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
     121 * may be set).
     122 */
     123#define SEMAPHORE_INFORMATION_DEFINE( max ) \
     124  OBJECTS_INFORMATION_DEFINE( \
     125    _Semaphore, \
     126    OBJECTS_CLASSIC_API, \
     127    OBJECTS_RTEMS_SEMAPHORES, \
     128    Semaphore_Control, \
     129    max, \
     130    OBJECTS_NO_STRING_NAME, \
     131    _Semaphore_MP_Send_extract_proxy \
     132  )
     133
    95134/** @} */
    96135
  • cpukit/include/rtems/rtems/semimpl.h

    r0f5b2c09 r21275b58  
    5656  SEMAPHORE_DISCIPLINE_FIFO
    5757} Semaphore_Discipline;
    58 
    59 /**
    60  *  The following defines the information control block used to manage
    61  *  this class of objects.
    62  */
    63 extern Objects_Information _Semaphore_Information;
    6458
    6559RTEMS_INLINE_ROUTINE const Thread_queue_Operations *_Semaphore_Get_operations(
  • cpukit/include/rtems/rtems/semmp.h

    r0f5b2c09 r21275b58  
    121121
    122122/**
    123  *  @brief Semaphore MP Send Extract Proxy
    124  *
    125  *  This routine is invoked when a task is deleted and it
    126  *  has a proxy which must be removed from a thread queue and
    127  *  the remote node must be informed of this.
    128  */
    129 void _Semaphore_MP_Send_extract_proxy (
    130   Thread_Control *the_thread,
    131   Objects_Id      id
    132 );
    133 
    134 /**
    135123 * @brief Semaphore Core Mutex MP Support
    136124 *
  • cpukit/include/rtems/rtems/tasksdata.h

    r0f5b2c09 r21275b58  
    6868extern void _RTEMS_tasks_Initialize_user_tasks_body( void );
    6969
     70/**
     71 *  The following instantiates the information control block used to
     72 *  manage this class of objects.
     73 */
     74extern Thread_Information _RTEMS_tasks_Information;
     75
    7076/** @} */
    7177
  • cpukit/include/rtems/rtems/tasksimpl.h

    r0f5b2c09 r21275b58  
    3434 * @{
    3535 */
    36 
    37 /**
    38  *  The following instantiates the information control block used to
    39  *  manage this class of objects.
    40  */
    41 extern Thread_Information _RTEMS_tasks_Information;
    4236
    4337/**
  • cpukit/include/rtems/rtems/timerdata.h

    r0f5b2c09 r21275b58  
    5858}   Timer_Control;
    5959
     60/**
     61 * @brief The Classic Timer objects information.
     62 */
     63extern Objects_Information  _Timer_Information;
     64
     65/**
     66 * @brief Macro to define the objects information for the Classic Timer
     67 * objects.
     68 *
     69 * This macro should only be used by <rtems/confdefs.h>.
     70 *
     71 * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
     72 * may be set).
     73 */
     74#define TIMER_INFORMATION_DEFINE( max ) \
     75  OBJECTS_INFORMATION_DEFINE( \
     76    _Timer, \
     77    OBJECTS_CLASSIC_API, \
     78    OBJECTS_RTEMS_TIMERS, \
     79    Timer_Control, \
     80    max, \
     81    OBJECTS_NO_STRING_NAME, \
     82    NULL \
     83  )
     84
    6085/** @} */
    6186
  • cpukit/include/rtems/rtems/timerimpl.h

    r0f5b2c09 r21275b58  
    5252 */
    5353extern Timer_server_Control *volatile _Timer_server;
    54 
    55 /**
    56  *  The following defines the information control block used to manage
    57  *  this class of objects.
    58  */
    59 extern Objects_Information  _Timer_Information;
    6054
    6155/**
  • cpukit/include/rtems/score/freechain.h

    r0f5b2c09 r21275b58  
    1818
    1919#include <rtems/score/basedefs.h>
    20 #include <rtems/score/chain.h>
     20#include <rtems/score/chainimpl.h>
    2121
    2222#ifdef __cplusplus
     
    5959 *
    6060 * @param[in] freechain The freechain control to initialize.
    61  * @param[in] allocator The allocator function.
     61 * @param[in] initial_nodes Array with the initial nodes.
    6262 * @param[in] number_nodes The initial number of nodes.
    6363 * @param[in] node_size The node size.
    6464 */
    65 void _Freechain_Initialize(
     65RTEMS_INLINE_ROUTINE void _Freechain_Initialize(
    6666  Freechain_Control   *freechain,
    67   Freechain_Allocator  allocator,
     67  void                *initial_nodes,
    6868  size_t               number_nodes,
    6969  size_t               node_size
    70 );
     70)
     71{
     72  _Chain_Initialize(
     73    &freechain->Free,
     74    initial_nodes,
     75    number_nodes,
     76    node_size
     77  );
     78}
    7179
    7280/**
  • cpukit/include/rtems/score/interr.h

    r0f5b2c09 r21275b58  
    174174  /* INTERNAL_ERROR_IMPLEMENTATION_BLOCKING_OPERATION_CANCEL = 17, */
    175175  /* INTERNAL_ERROR_THREAD_QUEUE_ENQUEUE_FROM_BAD_STATE = 18, */
    176   INTERNAL_ERROR_UNLIMITED_AND_MAXIMUM_IS_0 = 19,
     176  /* INTERNAL_ERROR_UNLIMITED_AND_MAXIMUM_IS_0 = 19, */
    177177  /* INTERNAL_ERROR_SHUTDOWN_WHEN_NOT_UP = 20, */
    178178  INTERNAL_ERROR_GXX_KEY_ADD_FAILED = 21,
  • cpukit/include/rtems/score/object.h

    r0f5b2c09 r21275b58  
    308308 * @return This method returns an object Id constructed from the arguments.
    309309 */
    310 RTEMS_INLINE_ROUTINE Objects_Id _Objects_Build_id(
    311   Objects_APIs     the_api,
    312   uint16_t         the_class,
    313   uint8_t          node,
    314   uint16_t         index
    315 )
    316 {
    317   return (( (Objects_Id) the_api )   << OBJECTS_API_START_BIT)   |
    318          (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
    319          (( (Objects_Id) node )      << OBJECTS_NODE_START_BIT)  |
    320          (( (Objects_Id) index )     << OBJECTS_INDEX_START_BIT);
    321 }
     310#define _Objects_Build_id( the_api, the_class, node, index ) \
     311  ( (Objects_Id) ( (Objects_Id) the_api   << OBJECTS_API_START_BIT )   | \
     312                 ( (Objects_Id) the_class << OBJECTS_CLASS_START_BIT ) | \
     313                 ( (Objects_Id) node      << OBJECTS_NODE_START_BIT )  | \
     314                 ( (Objects_Id) index     << OBJECTS_INDEX_START_BIT ) )
    322315
    323316/**
     
    329322 * @retval false The object count is fixed.
    330323 */
    331 RTEMS_INLINE_ROUTINE bool _Objects_Is_unlimited( uint32_t maximum )
    332 {
    333   return (maximum & OBJECTS_UNLIMITED_OBJECTS) != 0;
    334 }
     324#define _Objects_Is_unlimited( maximum ) \
     325  ( ( ( maximum ) & OBJECTS_UNLIMITED_OBJECTS ) != 0 )
    335326
    336327/*
  • cpukit/include/rtems/score/objectdata.h

    r0f5b2c09 r21275b58  
    2020
    2121#include <rtems/score/object.h>
    22 #include <rtems/score/chain.h>
     22#include <rtems/score/chainimpl.h>
    2323#include <rtems/score/rbtree.h>
    2424
     
    4646} Objects_Control;
    4747
     48/**
     49 *  This enumerated type is used in the class field of the object ID
     50 *  for RTEMS internal object classes.
     51 */
     52typedef enum {
     53  OBJECTS_INTERNAL_NO_CLASS =  0,
     54  OBJECTS_INTERNAL_THREADS  =  1
     55} Objects_Internal_API;
     56
     57/**
     58 *  This enumerated type is used in the class field of the object ID
     59 *  for the RTEMS Classic API.
     60 */
     61typedef enum {
     62  OBJECTS_CLASSIC_NO_CLASS     = 0,
     63  OBJECTS_RTEMS_TASKS          = 1,
     64  OBJECTS_RTEMS_TIMERS         = 2,
     65  OBJECTS_RTEMS_SEMAPHORES     = 3,
     66  OBJECTS_RTEMS_MESSAGE_QUEUES = 4,
     67  OBJECTS_RTEMS_PARTITIONS     = 5,
     68  OBJECTS_RTEMS_REGIONS        = 6,
     69  OBJECTS_RTEMS_PORTS          = 7,
     70  OBJECTS_RTEMS_PERIODS        = 8,
     71  OBJECTS_RTEMS_EXTENSIONS     = 9,
     72  OBJECTS_RTEMS_BARRIERS       = 10
     73} Objects_Classic_API;
     74
     75/**
     76 *  This enumerated type is used in the class field of the object ID
     77 *  for the POSIX API.
     78 */
     79typedef enum {
     80  OBJECTS_POSIX_NO_CLASS            = 0,
     81  OBJECTS_POSIX_THREADS             = 1,
     82  OBJECTS_POSIX_KEYS                = 2,
     83  OBJECTS_POSIX_INTERRUPTS          = 3,
     84  OBJECTS_POSIX_MESSAGE_QUEUES      = 5,
     85  OBJECTS_POSIX_SEMAPHORES          = 7,
     86  OBJECTS_POSIX_TIMERS              = 9,
     87  OBJECTS_POSIX_SHMS                = 12
     88} Objects_POSIX_API;
     89
     90/**
     91 * @brief Constant for the object information string name length to indicate
     92 * that this object class has no string names.
     93 */
     94#define OBJECTS_NO_STRING_NAME 0
     95
    4896#if defined( RTEMS_MULTIPROCESSING )
     97struct _Thread_Control;
     98
    4999/**
    50100 * @brief This defines the Global Object Control Block used to manage objects
     
    87137  uint32_t name;
    88138} Objects_MP_Control;
    89 #endif
     139
     140/**
     141 *  The following type defines the callout used when a local task
     142 *  is extracted from a remote thread queue (i.e. it's proxy must
     143 *  extracted from the remote queue).
     144 */
     145typedef void ( *Objects_Thread_queue_Extract_callout )(
     146  struct _Thread_Control *,
     147  Objects_Id
     148);
     149#endif
     150
     151/**
     152 *  The following defines the structure for the information used to
     153 *  manage each class of objects.
     154 */
     155typedef struct {
     156  /** This is the maximum valid id of this object class. */
     157  Objects_Id        maximum_id;
     158  /** This points to the table of local objects. */
     159  Objects_Control **local_table;
     160  /** This is the number of objects on the Inactive list. */
     161  Objects_Maximum   inactive;
     162  /** This is the number of objects in a block. */
     163  Objects_Maximum   objects_per_block;
     164  /** This is the size in bytes of each object instance. */
     165  uint16_t          object_size;
     166  /**
     167   * @brief This is the maximum length of names.
     168   *
     169   * A length of zero indicates that this object has a no string name
     170   * (OBJECTS_NO_STRING_NAME).
     171   */
     172  uint16_t          name_length;
     173  /** This is the chain of inactive control blocks. */
     174  Chain_Control     Inactive;
     175  /** This is the number of inactive objects per block. */
     176  Objects_Maximum  *inactive_per_block;
     177  /** This is a table to the chain of inactive object memory blocks. */
     178  Objects_Control **object_blocks;
     179  Objects_Control  *initial_objects;
     180  #if defined(RTEMS_MULTIPROCESSING)
     181    /** This is this object class' method called when extracting a thread. */
     182    Objects_Thread_queue_Extract_callout extract;
     183
     184    /**
     185     * @brief The global objects of this object information sorted by object
     186     * identifier.
     187     */
     188    RBTree_Control   Global_by_id;
     189
     190    /**
     191     * @brief The global objects of this object information sorted by object
     192     * name.
     193     *
     194     * Objects with the same name are sorted according to their identifier.
     195     */
     196    RBTree_Control   Global_by_name;
     197  #endif
     198}   Objects_Information;
     199
     200#if defined(RTEMS_MULTIPROCESSING)
     201#define OBJECTS_INFORMATION_MP( name, extract ) \
     202  , \
     203  extract, \
     204  RBTREE_INITIALIZER_EMPTY( name.Global_by_id ), \
     205  RBTREE_INITIALIZER_EMPTY( name.Global_by_name )
     206#else
     207#define OBJECTS_INFORMATION_MP( name, extract )
     208#endif
     209
     210/**
     211 * @brief Statically initializes an objects information.
     212 *
     213 * The initialized objects information contains no objects.
     214 *
     215 * @param name The object class C designator namespace prefix, e.g. _Semaphore.
     216 * @param api The object API number, e.g. OBJECTS_CLASSIC_API.
     217 * @param cls The object class number, e.g. OBJECTS_RTEMS_SEMAPHORES.
     218 * @param nl The object name string length, use OBJECTS_NO_STRING_NAME for
     219 *   objects without a string name.
     220 */
     221#define OBJECTS_INFORMATION_DEFINE_ZERO( name, api, cls, nl ) \
     222Objects_Information name##_Information = { \
     223  _Objects_Build_id( api, cls, 1, 0 ), \
     224  NULL, \
     225  0, \
     226  0, \
     227  0, \
     228  nl, \
     229  CHAIN_INITIALIZER_EMPTY( name##_Information.Inactive ), \
     230  NULL, \
     231  NULL, \
     232  NULL \
     233  OBJECTS_INFORMATION_MP( name##_Information, NULL ) \
     234}
     235
     236/**
     237 * @brief Statically initializes an objects information.
     238 *
     239 * The initialized objects information references a table with statically
     240 * allocated objects as specified by the object maximum parameter.  These
     241 * objects must be registered via a call to _Objects_Information().
     242 *
     243 * @param name The object class C designator namespace prefix, e.g. _Semaphore.
     244 * @param api The object API number, e.g. OBJECTS_CLASSIC_API.
     245 * @param cls The object class number, e.g. OBJECTS_RTEMS_SEMAPHORES.
     246 * @param type The object class type.
     247 * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
     248 *   may be set).
     249 * @param nl The object name string length, use OBJECTS_NO_STRING_NAME for
     250 *   objects without a string name.
     251 * @param ex The optional object extraction method.  Used only if
     252 *   multiprocessing (RTEMS_MULTIPROCESSING) is enabled.
     253 */
     254#define OBJECTS_INFORMATION_DEFINE( name, api, cls, type, max, nl, ex ) \
     255static Objects_Control * \
     256name##_Local_table[ _Objects_Maximum_per_allocation( max ) ]; \
     257static type name##_Objects[ _Objects_Maximum_per_allocation( max ) ]; \
     258Objects_Information name##_Information = { \
     259  _Objects_Build_id( api, cls, 1, _Objects_Maximum_per_allocation( max ) ), \
     260  name##_Local_table, \
     261  0, \
     262  _Objects_Is_unlimited( max ) ? _Objects_Maximum_per_allocation( max ) : 0, \
     263  sizeof( type ), \
     264  nl, \
     265  CHAIN_INITIALIZER_EMPTY( name##_Information.Inactive ), \
     266  NULL, \
     267  NULL, \
     268  &name##_Objects[ 0 ].Object \
     269  OBJECTS_INFORMATION_MP( name##_Information, ex ) \
     270}
    90271
    91272/** @} */
  • cpukit/include/rtems/score/objectimpl.h

    r0f5b2c09 r21275b58  
    4444);
    4545
    46 /**
    47  *  This enumerated type is used in the class field of the object ID
    48  *  for RTEMS internal object classes.
    49  */
    50 typedef enum {
    51   OBJECTS_INTERNAL_NO_CLASS =  0,
    52   OBJECTS_INTERNAL_THREADS  =  1
    53 } Objects_Internal_API;
    54 
    5546/** This macro is used to generically specify the last API index. */
    5647#define OBJECTS_INTERNAL_CLASSES_LAST OBJECTS_INTERNAL_THREADS
    5748
    58 /**
    59  *  This enumerated type is used in the class field of the object ID
    60  *  for the RTEMS Classic API.
    61  */
    62 typedef enum {
    63   OBJECTS_CLASSIC_NO_CLASS     = 0,
    64   OBJECTS_RTEMS_TASKS          = 1,
    65   OBJECTS_RTEMS_TIMERS         = 2,
    66   OBJECTS_RTEMS_SEMAPHORES     = 3,
    67   OBJECTS_RTEMS_MESSAGE_QUEUES = 4,
    68   OBJECTS_RTEMS_PARTITIONS     = 5,
    69   OBJECTS_RTEMS_REGIONS        = 6,
    70   OBJECTS_RTEMS_PORTS          = 7,
    71   OBJECTS_RTEMS_PERIODS        = 8,
    72   OBJECTS_RTEMS_EXTENSIONS     = 9,
    73   OBJECTS_RTEMS_BARRIERS       = 10
    74 } Objects_Classic_API;
    75 
    7649/** This macro is used to generically specify the last API index. */
    7750#define OBJECTS_RTEMS_CLASSES_LAST OBJECTS_RTEMS_BARRIERS
    78 
    79 /**
    80  *  This enumerated type is used in the class field of the object ID
    81  *  for the POSIX API.
    82  */
    83 typedef enum {
    84   OBJECTS_POSIX_NO_CLASS            = 0,
    85   OBJECTS_POSIX_THREADS             = 1,
    86   OBJECTS_POSIX_KEYS                = 2,
    87   OBJECTS_POSIX_INTERRUPTS          = 3,
    88   OBJECTS_POSIX_MESSAGE_QUEUES      = 5,
    89   OBJECTS_POSIX_SEMAPHORES          = 7,
    90   OBJECTS_POSIX_TIMERS              = 9,
    91   OBJECTS_POSIX_SHMS                = 12
    92 } Objects_POSIX_API;
    9351
    9452/** This macro is used to generically specify the last API index. */
     
    10361  OBJECTS_FAKE_OBJECTS_SCHEDULERS = 1
    10462} Objects_Fake_objects_API;
    105 
    106 #if defined(RTEMS_MULTIPROCESSING)
    107 /**
    108  *  The following type defines the callout used when a local task
    109  *  is extracted from a remote thread queue (i.e. it's proxy must
    110  *  extracted from the remote queue).
    111  */
    112 typedef void ( *Objects_Thread_queue_Extract_callout )(
    113   Thread_Control *,
    114   Objects_Id
    115 );
    116 #endif
    117 
    118 /**
    119  *  The following defines the structure for the information used to
    120  *  manage each class of objects.
    121  */
    122 typedef struct {
    123   /** This is the maximum valid id of this object class. */
    124   Objects_Id        maximum_id;
    125   /** This points to the table of local objects. */
    126   Objects_Control **local_table;
    127   /** This is the number of objects on the Inactive list. */
    128   Objects_Maximum   inactive;
    129   /**
    130    * @brief This is the number of objects in a block if the automatic extension
    131    * is enabled.
    132    *
    133    * This member is zero if the automatic extension is disabled.
    134    */
    135   Objects_Maximum   objects_per_block;
    136   /** This is the size in bytes of each object instance. */
    137   uint16_t          object_size;
    138   /**
    139    * @brief This is the maximum length of names.
    140    *
    141    * A length of zero indicates that this object has a no string name
    142    * (OBJECTS_NO_STRING_NAME).
    143    */
    144   uint16_t          name_length;
    145   /** This is the chain of inactive control blocks. */
    146   Chain_Control     Inactive;
    147   /** This is the number of inactive objects per block. */
    148   Objects_Maximum  *inactive_per_block;
    149   /** This is a table to the chain of inactive object memory blocks. */
    150   Objects_Control **object_blocks;
    151   #if defined(RTEMS_MULTIPROCESSING)
    152     /** This is this object class' method called when extracting a thread. */
    153     Objects_Thread_queue_Extract_callout extract;
    154 
    155     /**
    156      * @brief The global objects of this object information sorted by object
    157      * identifier.
    158      */
    159     RBTree_Control   Global_by_id;
    160 
    161     /**
    162      * @brief The global objects of this object information sorted by object
    163      * name.
    164      *
    165      * Objects with the same name are sorted according to their identifier.
    166      */
    167     RBTree_Control   Global_by_name;
    168   #endif
    169 }   Objects_Information;
    17063
    17164/**
     
    223116);
    224117
    225 void _Objects_Do_initialize_information(
    226   Objects_Information *information,
    227   Objects_APIs         the_api,
    228   uint16_t             the_class,
    229   uint32_t             maximum,
    230   uint16_t             object_size,
    231   uint16_t             maximum_name_length
    232 #if defined(RTEMS_MULTIPROCESSING)
    233   ,
    234   Objects_Thread_queue_Extract_callout extract
    235 #endif
    236 );
    237 
    238 /**
    239  * @brief Constant for the object information string name length to indicate
    240  * that this object class has no string names.
    241  */
    242 #define OBJECTS_NO_STRING_NAME 0
    243 
    244 /**
    245  *  @brief Initialize object Information
    246  *
    247  *  This function initializes an object class information record.
    248  *  SUPPORTS_GLOBAL is true if the object class supports global
    249  *  objects, and false otherwise.  Maximum indicates the number
    250  *  of objects required in this class and size indicates the size
    251  *  in bytes of each control block for this object class.  The
    252  *  name length and string designator are also set.  In addition,
    253  *  the class may be a task, therefore this information is also included.
    254  *
    255  *  @param[in] information points to an object class information block.
    256  *  @param[in] the_api indicates the API associated with this information block.
    257  *  @param[in] the_class indicates the class of object being managed
    258  *             by this information block.  It is specific to @a the_api.
    259  *  @param[in] maximum is the maximum number of instances of this object
    260  *             class which may be concurrently active.
    261  *  @param[in] object_size is the size of the data structure for this class.
    262  *  @param[in] is_string is true if this object uses string style names.
    263  *  @param[in] maximum_name_length is the maximum length of object names.
    264  */
    265 #if defined(RTEMS_MULTIPROCESSING)
    266   #define _Objects_Initialize_information( \
    267     information, \
    268     the_api, \
    269     the_class, \
    270     maximum, \
    271     object_size, \
    272     maximum_name_length, \
    273     extract \
    274   ) \
    275     _Objects_Do_initialize_information( \
    276       information, \
    277       the_api, \
    278       the_class, \
    279       maximum, \
    280       object_size, \
    281       maximum_name_length, \
    282       extract \
    283     )
    284 #else
    285   #define _Objects_Initialize_information( \
    286     information, \
    287     the_api, \
    288     the_class, \
    289     maximum, \
    290     object_size, \
    291     maximum_name_length, \
    292     extract \
    293   ) \
    294     _Objects_Do_initialize_information( \
    295       information, \
    296       the_api, \
    297       the_class, \
    298       maximum, \
    299       object_size, \
    300       maximum_name_length \
    301     )
    302 #endif
     118/**
     119 * @brief Initializes the specified objects information.
     120 *
     121 * The objects information must be statically pre-initialized with the
     122 * OBJECTS_INFORMATION_DEFINE() macro before this function is called.
     123 */
     124void _Objects_Initialize_information( Objects_Information *information );
    303125
    304126/**
  • cpukit/include/rtems/score/thread.h

    r0f5b2c09 r21275b58  
    2727#include <rtems/score/mppkt.h>
    2828#endif
     29#include <rtems/score/freechain.h>
    2930#include <rtems/score/isrlock.h>
    3031#include <rtems/score/objectdata.h>
     
    910911 * This array is provided via <rtems/confdefs.h>.
    911912 *
    912  * @see _Thread_Control_add_on_count and _Thread_Control_size.
     913 * @see _Thread_Control_add_on_count.
    913914 */
    914915extern const Thread_Control_add_on _Thread_Control_add_ons[];
     
    924925
    925926/**
    926  * @brief Size of the thread control block of a particular application.
     927 * @brief Count of configured threads.
    927928 *
    928929 * This value is provided via <rtems/confdefs.h>.
    929  *
    930  * @see _Thread_Control_add_ons.
    931  */
    932 extern const size_t _Thread_Control_size;
     930 */
     931extern const size_t _Thread_Initial_thread_count;
    933932
    934933/**
     
    940939extern const size_t _Thread_Maximum_name_size;
    941940
     941/**
     942 * @brief The configured thread control block.
     943 *
     944 * This type is defined in <rtems/confdefs.h> and depends on the application
     945 * configuration.
     946 */
     947typedef struct Thread_Configured_control Thread_Configured_control;
     948
     949/**
     950 * @brief The configured thread queue heads.
     951 *
     952 * In SMP configurations, this type is defined in <rtems/confdefs.h> and depends
     953 * on the application configuration.
     954 */
     955#if defined(RTEMS_SMP)
     956typedef struct Thread_queue_Configured_heads Thread_queue_Configured_heads;
     957#else
     958typedef Thread_queue_Heads Thread_queue_Configured_heads;
     959#endif
     960
     961/**
     962 * @brief Size of the thread queue heads of a particular application.
     963 *
     964 * In SMP configurations, this value is provided via <rtems/confdefs.h>.
     965 */
     966#if defined(RTEMS_SMP)
     967extern const size_t _Thread_queue_Heads_size;
     968#else
     969#define _Thread_queue_Heads_size sizeof(Thread_queue_Heads)
     970#endif
     971
     972/**
     973 * @brief The thread object information.
     974 */
     975typedef struct {
     976  /**
     977   * @brief The object information.
     978   */
     979  Objects_Information Objects;
     980
     981  /**
     982   * @brief Thread queue heads maintenance.
     983   */
     984  union {
     985    /**
     986     * @brief Contains the initial set of thread queue heads.
     987     *
     988     * This is set by <rtems/confdefs.h> via THREAD_INFORMATION_DEFINE().
     989     */
     990    Thread_queue_Configured_heads *initial;
     991
     992    /**
     993     * @brief The free thread queue heads.
     994     *
     995     * This member is initialized by _Thread_Initialize_information().
     996     */
     997    Freechain_Control Free;
     998  } Thread_queue_heads;
     999} Thread_Information;
     1000
     1001/**
     1002 * @brief The internal thread  objects information.
     1003 */
     1004extern Thread_Information _Thread_Information;
     1005
     1006#define THREAD_INFORMATION_DEFINE_ZERO( name, api, cls ) \
     1007Thread_Information name##_Information = { \
     1008  { \
     1009    _Objects_Build_id( api, cls, 1, 0 ), \
     1010    NULL, \
     1011    0, \
     1012    0, \
     1013    0, \
     1014    0, \
     1015    CHAIN_INITIALIZER_EMPTY( name##_Information.Objects.Inactive ), \
     1016    NULL, \
     1017    NULL, \
     1018    NULL \
     1019    OBJECTS_INFORMATION_MP( name##_Information.Objects, NULL ), \
     1020  }, { \
     1021    NULL \
     1022  } \
     1023}
     1024
     1025#define THREAD_INFORMATION_DEFINE( name, api, cls, max ) \
     1026static Objects_Control * \
     1027name##_Local_table[ _Objects_Maximum_per_allocation( max ) ]; \
     1028static Thread_Configured_control \
     1029name##_Objects[ _Objects_Maximum_per_allocation( max ) ]; \
     1030static Thread_queue_Configured_heads \
     1031name##_Heads[ _Objects_Maximum_per_allocation( max ) ]; \
     1032Thread_Information name##_Information = { \
     1033  { \
     1034    _Objects_Build_id( api, cls, 1, _Objects_Maximum_per_allocation( max ) ), \
     1035    name##_Local_table, \
     1036    0, \
     1037    _Objects_Is_unlimited( max ) ? _Objects_Maximum_per_allocation( max ) : 0, \
     1038    sizeof( Thread_Configured_control ), \
     1039    OBJECTS_NO_STRING_NAME, \
     1040    CHAIN_INITIALIZER_EMPTY( name##_Information.Objects.Inactive ), \
     1041    NULL, \
     1042    NULL, \
     1043    &name##_Objects[ 0 ].Control.Object \
     1044    OBJECTS_INFORMATION_MP( name##_Information.Objects, NULL ) \
     1045  }, { \
     1046    &name##_Heads[ 0 ] \
     1047  } \
     1048}
     1049
    9421050/**@}*/
    9431051
  • cpukit/include/rtems/score/threadimpl.h

    r0f5b2c09 r21275b58  
    3535#include <rtems/score/threadqimpl.h>
    3636#include <rtems/score/todimpl.h>
    37 #include <rtems/score/freechain.h>
    3837#include <rtems/score/watchdogimpl.h>
    3938#include <rtems/config.h>
     
    5857 */
    5958extern void *rtems_ada_self;
    60 
    61 typedef struct {
    62   Objects_Information Objects;
    63 
    64   Freechain_Control Free_thread_queue_heads;
    65 } Thread_Information;
    66 
    67 /**
    68  *  The following defines the information control block used to
    69  *  manage this class of objects.
    70  */
    71 extern Thread_Information _Thread_Internal_information;
    7259
    7360/**
     
    10188);
    10289
    103 void _Thread_Initialize_information(
    104   Thread_Information  *information,
    105   Objects_APIs         the_api,
    106   uint16_t             the_class,
    107   uint32_t             maximum
    108 );
     90void _Thread_Initialize_information( Thread_Information *information );
    10991
    11092/**
     
    829811{
    830812  return (Thread_Control *)
    831     _Objects_Allocate_unprotected( &_Thread_Internal_information.Objects );
     813    _Objects_Allocate_unprotected( &_Thread_Information.Objects );
    832814}
    833815
  • cpukit/include/rtems/score/threadq.h

    r0f5b2c09 r21275b58  
    395395} Thread_queue_Heads;
    396396
    397 #if defined(RTEMS_SMP)
    398   #define THREAD_QUEUE_HEADS_SIZE( scheduler_count ) \
    399     ( sizeof( Thread_queue_Heads ) \
    400       + ( scheduler_count ) * sizeof( Thread_queue_Priority_queue ) )
    401 #else
    402   #define THREAD_QUEUE_HEADS_SIZE( scheduler_count ) \
    403     sizeof( Thread_queue_Heads )
    404 #endif
    405 
    406397struct Thread_queue_Queue {
    407398  /**
  • cpukit/posix/src/key.c

    r0f5b2c09 r21275b58  
    22 * @file
    33 *
    4  * @brief POSIX Keys Manager Initialization
    5  * @ingroup POSIX_KEY Key
     4 * @ingroup POSIX_KEY
     5 *
     6 * @brief POSIX Keys Information with Zero Objects
    67 */
    78
    89/*
    9  * Copyright (c) 2012 Zhongwei Yao.
    10  * COPYRIGHT (c) 1989-2014.
    11  * On-Line Applications Research Corporation (OAR).
    12  * Copyright (c) 2016 embedded brains GmbH.
     10 * SPDX-License-Identifier: BSD-2-Clause
    1311 *
    14  * The license and distribution terms for this file may be
    15  * found in the file LICENSE in this distribution or at
    16  * http://www.rtems.org/license/LICENSE.
     12 * Copyright (C) 2018 embedded brains GmbH
     13 *
     14 * Redistribution and use in source and binary forms, with or without
     15 * modification, are permitted provided that the following conditions
     16 * are met:
     17 * 1. Redistributions of source code must retain the above copyright
     18 *    notice, this list of conditions and the following disclaimer.
     19 * 2. Redistributions in binary form must reproduce the above copyright
     20 *    notice, this list of conditions and the following disclaimer in the
     21 *    documentation and/or other materials provided with the distribution.
     22 *
     23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33 * POSSIBILITY OF SUCH DAMAGE.
    1734 */
    1835
     
    2138#endif
    2239
    23 #include <limits.h>
     40#include <rtems/posix/key.h>
    2441
    25 #include <rtems/config.h>
    26 #include <rtems/sysinit.h>
    27 
    28 #include <rtems/posix/keyimpl.h>
    29 #include <rtems/score/userextimpl.h>
    30 #include <rtems/score/wkspace.h>
    31 
    32 Objects_Information _POSIX_Keys_Information;
    33 
    34 Freechain_Control _POSIX_Keys_Keypool;
    35 
    36 static uint32_t _POSIX_Keys_Get_keypool_bump_count( void )
    37 {
    38   uint32_t max = Configuration.maximum_key_value_pairs;
    39 
    40   return _Objects_Is_unlimited( max ) ?
    41     _Objects_Maximum_per_allocation( max ) : 0;
    42 }
    43 
    44 static uint32_t _POSIX_Keys_Get_initial_keypool_size( void )
    45 {
    46   uint32_t max = Configuration.maximum_key_value_pairs;
    47 
    48   return _Objects_Maximum_per_allocation( max );
    49 }
    50 
    51 static void _POSIX_Keys_Initialize_keypool( void )
    52 {
    53   _Freechain_Initialize(
    54     &_POSIX_Keys_Keypool,
    55     _Workspace_Allocate_or_fatal_error,
    56     _POSIX_Keys_Get_initial_keypool_size(),
    57     sizeof( POSIX_Keys_Key_value_pair )
    58   );
    59 }
    60 
    61 POSIX_Keys_Key_value_pair * _POSIX_Keys_Key_value_allocate( void )
    62 {
    63   return (POSIX_Keys_Key_value_pair *) _Freechain_Get(
    64     &_POSIX_Keys_Keypool,
    65     _Workspace_Allocate,
    66     _POSIX_Keys_Get_keypool_bump_count(),
    67     sizeof( POSIX_Keys_Key_value_pair )
    68   );
    69 }
    70 
    71 static void _POSIX_Keys_Run_destructors( Thread_Control *the_thread )
    72 {
    73   while ( true ) {
    74     ISR_lock_Context  lock_context;
    75     RBTree_Node      *node;
    76 
    77     _Objects_Allocator_lock();
    78     _POSIX_Keys_Key_value_acquire( the_thread, &lock_context );
    79 
    80     node = _RBTree_Root( &the_thread->Keys.Key_value_pairs );
    81     if ( node != NULL ) {
    82       POSIX_Keys_Key_value_pair *key_value_pair;
    83       pthread_key_t              key;
    84       void                      *value;
    85       POSIX_Keys_Control        *the_key;
    86       void                    ( *destructor )( void * );
    87 
    88       key_value_pair = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( node );
    89       key = key_value_pair->key;
    90       value = key_value_pair->value;
    91       _RBTree_Extract(
    92         &the_thread->Keys.Key_value_pairs,
    93         &key_value_pair->Lookup_node
    94       );
    95 
    96       _POSIX_Keys_Key_value_release( the_thread, &lock_context );
    97       _POSIX_Keys_Key_value_free( key_value_pair );
    98 
    99       the_key = _POSIX_Keys_Get( key );
    100       _Assert( the_key != NULL );
    101       destructor = the_key->destructor;
    102 
    103       _Objects_Allocator_unlock();
    104 
    105       if ( destructor != NULL && value != NULL ) {
    106         ( *destructor )( value );
    107       }
    108     } else {
    109       _POSIX_Keys_Key_value_release( the_thread, &lock_context );
    110       _Objects_Allocator_unlock();
    111       break;
    112     }
    113   }
    114 }
    115 
    116 static void _POSIX_Keys_Restart_run_destructors(
    117   Thread_Control *executing,
    118   Thread_Control *the_thread
    119 )
    120 {
    121   (void) executing;
    122   _POSIX_Keys_Run_destructors( the_thread );
    123 }
    124 
    125 static User_extensions_Control _POSIX_Keys_Extensions = {
    126   .Callouts = {
    127     .thread_restart = _POSIX_Keys_Restart_run_destructors,
    128     .thread_terminate = _POSIX_Keys_Run_destructors
    129   }
    130 };
    131 
    132 /**
    133  * @brief This routine performs the initialization necessary for this manager.
    134  */
    135 static void _POSIX_Keys_Manager_initialization(void)
    136 {
    137   _Objects_Initialize_information(
    138     &_POSIX_Keys_Information,   /* object information table */
    139     OBJECTS_POSIX_API,          /* object API */
    140     OBJECTS_POSIX_KEYS,         /* object class */
    141     Configuration.maximum_keys,
    142                                 /* maximum objects of this class */
    143     sizeof( POSIX_Keys_Control ),
    144                                 /* size of this object's control block */
    145     OBJECTS_NO_STRING_NAME,     /* maximum length of each object's name */
    146     NULL                        /* Proxy extraction support callout */
    147   );
    148 
    149   _POSIX_Keys_Initialize_keypool();
    150 
    151   _User_extensions_Add_API_set( &_POSIX_Keys_Extensions );
    152 }
    153 
    154 RTEMS_SYSINIT_ITEM(
    155   _POSIX_Keys_Manager_initialization,
    156   RTEMS_SYSINIT_POSIX_KEYS,
    157   RTEMS_SYSINIT_ORDER_MIDDLE
     42OBJECTS_INFORMATION_DEFINE_ZERO(
     43  _POSIX_Keys,
     44  OBJECTS_POSIX_API,
     45  OBJECTS_POSIX_KEYS,
     46  OBJECTS_NO_STRING_NAME
    15847);
  • cpukit/posix/src/keycreate.c

    r0f5b2c09 r21275b58  
    2121
    2222#include <rtems/posix/keyimpl.h>
     23#include <rtems/score/userextimpl.h>
     24#include <rtems/score/wkspace.h>
     25#include <rtems/sysinit.h>
    2326
    2427#include <errno.h>
     
    4851  return 0;
    4952}
     53
     54Freechain_Control _POSIX_Keys_Keypool;
     55
     56static uint32_t _POSIX_Keys_Get_keypool_bump_count( void )
     57{
     58  uint32_t max;
     59
     60  max = _POSIX_Keys_Key_value_pair_maximum;
     61  return _Objects_Is_unlimited( max ) ?
     62    _Objects_Maximum_per_allocation( max ) : 0;
     63}
     64
     65static uint32_t _POSIX_Keys_Get_initial_keypool_size( void )
     66{
     67  uint32_t max;
     68
     69  max = _POSIX_Keys_Key_value_pair_maximum;
     70  return _Objects_Maximum_per_allocation( max );
     71}
     72
     73static void _POSIX_Keys_Initialize_keypool( void )
     74{
     75  _Freechain_Initialize(
     76    &_POSIX_Keys_Keypool,
     77    _POSIX_Keys_Key_value_pairs,
     78    _POSIX_Keys_Get_initial_keypool_size(),
     79    sizeof( _POSIX_Keys_Key_value_pairs[ 0 ] )
     80  );
     81}
     82
     83POSIX_Keys_Key_value_pair * _POSIX_Keys_Key_value_allocate( void )
     84{
     85  return (POSIX_Keys_Key_value_pair *) _Freechain_Get(
     86    &_POSIX_Keys_Keypool,
     87    _Workspace_Allocate,
     88    _POSIX_Keys_Get_keypool_bump_count(),
     89    sizeof( POSIX_Keys_Key_value_pair )
     90  );
     91}
     92
     93static void _POSIX_Keys_Run_destructors( Thread_Control *the_thread )
     94{
     95  while ( true ) {
     96    ISR_lock_Context  lock_context;
     97    RBTree_Node      *node;
     98
     99    _Objects_Allocator_lock();
     100    _POSIX_Keys_Key_value_acquire( the_thread, &lock_context );
     101
     102    node = _RBTree_Root( &the_thread->Keys.Key_value_pairs );
     103    if ( node != NULL ) {
     104      POSIX_Keys_Key_value_pair *key_value_pair;
     105      pthread_key_t              key;
     106      void                      *value;
     107      POSIX_Keys_Control        *the_key;
     108      void                    ( *destructor )( void * );
     109
     110      key_value_pair = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( node );
     111      key = key_value_pair->key;
     112      value = key_value_pair->value;
     113      _RBTree_Extract(
     114        &the_thread->Keys.Key_value_pairs,
     115        &key_value_pair->Lookup_node
     116      );
     117
     118      _POSIX_Keys_Key_value_release( the_thread, &lock_context );
     119      _POSIX_Keys_Key_value_free( key_value_pair );
     120
     121      the_key = _POSIX_Keys_Get( key );
     122      _Assert( the_key != NULL );
     123      destructor = the_key->destructor;
     124
     125      _Objects_Allocator_unlock();
     126
     127      if ( destructor != NULL && value != NULL ) {
     128        ( *destructor )( value );
     129      }
     130    } else {
     131      _POSIX_Keys_Key_value_release( the_thread, &lock_context );
     132      _Objects_Allocator_unlock();
     133      break;
     134    }
     135  }
     136}
     137
     138static void _POSIX_Keys_Restart_run_destructors(
     139  Thread_Control *executing,
     140  Thread_Control *the_thread
     141)
     142{
     143  (void) executing;
     144  _POSIX_Keys_Run_destructors( the_thread );
     145}
     146
     147static User_extensions_Control _POSIX_Keys_Extensions = {
     148  .Callouts = {
     149    .thread_restart = _POSIX_Keys_Restart_run_destructors,
     150    .thread_terminate = _POSIX_Keys_Run_destructors
     151  }
     152};
     153
     154/**
     155 * @brief This routine performs the initialization necessary for this manager.
     156 */
     157static void _POSIX_Keys_Manager_initialization(void)
     158{
     159  _Objects_Initialize_information( &_POSIX_Keys_Information );
     160  _POSIX_Keys_Initialize_keypool();
     161  _User_extensions_Add_API_set( &_POSIX_Keys_Extensions );
     162}
     163
     164RTEMS_SYSINIT_ITEM(
     165  _POSIX_Keys_Manager_initialization,
     166  RTEMS_SYSINIT_POSIX_KEYS,
     167  RTEMS_SYSINIT_ORDER_MIDDLE
     168);
  • cpukit/posix/src/mqueue.c

    r0f5b2c09 r21275b58  
    22 * @file
    33 *
    4  * @brief Initializes message_queue Manager Related Data Structures
    5  * @ingroup POSIX_MQUEUE_P Message Queues Private Support Information
     4 * @ingroup POSIX_MQUEUE_P
     5 *
     6 * @brief POSIX Message Queue Information with Zero Objects
    67 */
    78
    89/*
    9  *  COPYRIGHT (c) 1989-2008.
    10  *  On-Line Applications Research Corporation (OAR).
     10 * SPDX-License-Identifier: BSD-2-Clause
    1111 *
    12  *  The license and distribution terms for this file may be
    13  *  found in the file LICENSE in this distribution or at
    14  *  http://www.rtems.org/license/LICENSE.
     12 * Copyright (C) 2018 embedded brains GmbH
     13 *
     14 * Redistribution and use in source and binary forms, with or without
     15 * modification, are permitted provided that the following conditions
     16 * are met:
     17 * 1. Redistributions of source code must retain the above copyright
     18 *    notice, this list of conditions and the following disclaimer.
     19 * 2. Redistributions in binary form must reproduce the above copyright
     20 *    notice, this list of conditions and the following disclaimer in the
     21 *    documentation and/or other materials provided with the distribution.
     22 *
     23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33 * POSSIBILITY OF SUCH DAMAGE.
    1534 */
    1635
     
    1938#endif
    2039
    21 #include <stdarg.h>
     40#include <rtems/posix/mqueueimpl.h>
    2241
    23 #include <pthread.h>
    24 #include <errno.h>
    25 #include <fcntl.h>
    26 #include <mqueue.h>
    2742#include <limits.h>
    2843
    29 #include <rtems/system.h>
    30 #include <rtems/config.h>
    31 #include <rtems/sysinit.h>
    32 #include <rtems/score/watchdog.h>
    33 #include <rtems/seterr.h>
    34 #include <rtems/posix/mqueueimpl.h>
    35 
    36 Objects_Information _POSIX_Message_queue_Information;
    37 
    38 /*
    39  *  _POSIX_Message_queue_Manager_initialization
    40  *
    41  *  This routine initializes all message_queue manager related data structures.
    42  *
    43  *  Input parameters:   NONE
    44  *
    45  *  Output parameters:  NONE
    46  */
    47 
    48 static void _POSIX_Message_queue_Manager_initialization(void)
    49 {
    50   _Objects_Initialize_information(
    51     &_POSIX_Message_queue_Information, /* object information table */
    52     OBJECTS_POSIX_API,                 /* object API */
    53     OBJECTS_POSIX_MESSAGE_QUEUES,      /* object class */
    54     _Configuration_POSIX_Maximum_message_queues,
    55     sizeof( POSIX_Message_queue_Control ),
    56                                 /* size of this object's control block */
    57     _POSIX_PATH_MAX,            /* maximum length of each object's name */
    58     NULL                        /* Proxy extraction support callout */
    59   );
    60 }
    61 
    62 RTEMS_SYSINIT_ITEM(
    63   _POSIX_Message_queue_Manager_initialization,
    64   RTEMS_SYSINIT_POSIX_MESSAGE_QUEUE,
    65   RTEMS_SYSINIT_ORDER_MIDDLE
     44OBJECTS_INFORMATION_DEFINE_ZERO(
     45  _POSIX_Message_queue,
     46  OBJECTS_POSIX_API,
     47  OBJECTS_POSIX_MESSAGE_QUEUES,
     48  _POSIX_PATH_MAX
    6649);
  • cpukit/posix/src/mqueueopen.c

    r0f5b2c09 r21275b58  
    3333#include <rtems/posix/mqueueimpl.h>
    3434#include <rtems/score/wkspace.h>
     35#include <rtems/sysinit.h>
    3536
    3637#include <stdarg.h>
     
    192193  return status;
    193194}
     195
     196static void _POSIX_Message_queue_Manager_initialization( void )
     197{
     198  _Objects_Initialize_information( &_POSIX_Message_queue_Information );
     199}
     200
     201RTEMS_SYSINIT_ITEM(
     202  _POSIX_Message_queue_Manager_initialization,
     203  RTEMS_SYSINIT_POSIX_MESSAGE_QUEUE,
     204  RTEMS_SYSINIT_ORDER_MIDDLE
     205);
  • cpukit/posix/src/psxsemaphore.c

    r0f5b2c09 r21275b58  
    22 * @file
    33 *
    4  * @brief POSIX Function Initializes Semaphore Manager
    5  * @ingroup POSIXAPI
     4 * @ingroup POSIXSemaphorePrivate
     5 *
     6 * @brief POSIX Semaphore Information with Zero Objects
    67 */
    78
    89/*
    9  *  COPYRIGHT (c) 1989-2008.
    10  *  On-Line Applications Research Corporation (OAR).
     10 * SPDX-License-Identifier: BSD-2-Clause
    1111 *
    12  *  The license and distribution terms for this file may be
    13  *  found in the file LICENSE in this distribution or at
    14  *  http://www.rtems.org/license/LICENSE.
     12 * Copyright (C) 2018 embedded brains GmbH
     13 *
     14 * Redistribution and use in source and binary forms, with or without
     15 * modification, are permitted provided that the following conditions
     16 * are met:
     17 * 1. Redistributions of source code must retain the above copyright
     18 *    notice, this list of conditions and the following disclaimer.
     19 * 2. Redistributions in binary form must reproduce the above copyright
     20 *    notice, this list of conditions and the following disclaimer in the
     21 *    documentation and/or other materials provided with the distribution.
     22 *
     23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33 * POSSIBILITY OF SUCH DAMAGE.
    1534 */
    1635
     
    1938#endif
    2039
    21 #include <rtems/posix/semaphoreimpl.h>
    22 #include <rtems/config.h>
    23 #include <rtems/sysinit.h>
     40#include <rtems/posix/semaphore.h>
    2441
    2542#include <limits.h>
    2643
    27 Objects_Information _POSIX_Semaphore_Information;
    28 
    29 /*
    30  *  _POSIX_Semaphore_Manager_initialization
    31  *
    32  *  This routine initializes all semaphore manager related data structures.
    33  *
    34  *  Input parameters:   NONE
    35  *
    36  *  Output parameters:  NONE
    37  */
    38 
    39 static void _POSIX_Semaphore_Manager_initialization(void)
    40 {
    41   _Objects_Initialize_information(
    42     &_POSIX_Semaphore_Information, /* object information table */
    43     OBJECTS_POSIX_API,          /* object API */
    44     OBJECTS_POSIX_SEMAPHORES,   /* object class */
    45     _Configuration_POSIX_Maximum_named_semaphores,
    46     sizeof( POSIX_Semaphore_Control ),
    47                                 /* size of this object's control block */
    48     _POSIX_PATH_MAX,            /* maximum length of each object's name */
    49     NULL                        /* Proxy extraction support callout */
    50   );
    51 }
    52 
    53 RTEMS_SYSINIT_ITEM(
    54   _POSIX_Semaphore_Manager_initialization,
    55   RTEMS_SYSINIT_POSIX_SEMAPHORE,
    56   RTEMS_SYSINIT_ORDER_MIDDLE
     44OBJECTS_INFORMATION_DEFINE_ZERO(
     45  _POSIX_Semaphore,
     46  OBJECTS_POSIX_API,
     47  OBJECTS_POSIX_SEMAPHORES,
     48  _POSIX_PATH_MAX
    5749);
  • cpukit/posix/src/psxtimercreate.c

    r0f5b2c09 r21275b58  
    2525#include <signal.h>
    2626
    27 #include <rtems/system.h>
    28 #include <rtems/seterr.h>
    29 #include <rtems/score/thread.h>
    3027#include <rtems/posix/sigset.h>
    3128#include <rtems/posix/timerimpl.h>
     29#include <rtems/score/thread.h>
    3230#include <rtems/score/watchdogimpl.h>
     31#include <rtems/seterr.h>
     32#include <rtems/sysinit.h>
    3333
    3434int timer_create(
     
    100100  return 0;
    101101}
     102
     103static void _POSIX_Timer_Manager_initialization( void )
     104{
     105  _Objects_Initialize_information( &_POSIX_Timer_Information );
     106}
     107
     108RTEMS_SYSINIT_ITEM(
     109  _POSIX_Timer_Manager_initialization,
     110  RTEMS_SYSINIT_POSIX_TIMER,
     111  RTEMS_SYSINIT_ORDER_MIDDLE
     112);
  • cpukit/posix/src/pthread.c

    r0f5b2c09 r21275b58  
    1818#include "config.h"
    1919#endif
    20 #include <stdio.h>
    2120
    22 #include <errno.h>
    23 #include <pthread.h>
    24 #include <limits.h>
    25 #include <assert.h>
     21#include <rtems/posix/pthread.h>
    2622
    27 #include <rtems/system.h>
    28 #include <rtems/config.h>
    29 #include <rtems/sysinit.h>
    30 #include <rtems/score/stack.h>
    31 #include <rtems/score/threadimpl.h>
    32 #include <rtems/score/threadqimpl.h>
    33 #include <rtems/score/userextimpl.h>
    34 #include <rtems/score/wkspace.h>
    35 #include <rtems/posix/pthreadimpl.h>
    36 #include <rtems/posix/priorityimpl.h>
    37 #if defined(RTEMS_POSIX_API)
    38 #include <rtems/posix/psignalimpl.h>
    39 #endif
    40 #include <rtems/posix/config.h>
    41 #include <rtems/posix/keyimpl.h>
    42 #include <rtems/score/assert.h>
    43 #include <rtems/score/schedulerimpl.h>
    44 
    45 Thread_Information _POSIX_Threads_Information;
    46 
    47 #if defined(RTEMS_POSIX_API)
    48 void _POSIX_Threads_Sporadic_timer( Watchdog_Control *watchdog )
    49 {
    50   POSIX_API_Control    *api;
    51   Thread_Control       *the_thread;
    52   Thread_queue_Context  queue_context;
    53 
    54   api = RTEMS_CONTAINER_OF( watchdog, POSIX_API_Control, Sporadic.Timer );
    55   the_thread = api->Sporadic.thread;
    56 
    57   _Thread_queue_Context_initialize( &queue_context );
    58   _Thread_queue_Context_clear_priority_updates( &queue_context );
    59   _Thread_Wait_acquire( the_thread, &queue_context );
    60 
    61   if ( _Priority_Node_is_active( &api->Sporadic.Low_priority ) ) {
    62     _Thread_Priority_add(
    63       the_thread,
    64       &the_thread->Real_priority,
    65       &queue_context
    66     );
    67     _Thread_Priority_remove(
    68       the_thread,
    69       &api->Sporadic.Low_priority,
    70       &queue_context
    71     );
    72     _Priority_Node_set_inactive( &api->Sporadic.Low_priority );
    73   }
    74 
    75   _Watchdog_Per_CPU_remove_ticks( &api->Sporadic.Timer );
    76   _POSIX_Threads_Sporadic_timer_insert( the_thread, api );
    77 
    78   _Thread_Wait_release( the_thread, &queue_context );
    79   _Thread_Priority_update( &queue_context );
    80 }
    81 
    82 void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread )
    83 {
    84   POSIX_API_Control    *api;
    85   Thread_queue_Context  queue_context;
    86 
    87   api = the_thread->API_Extensions[ THREAD_API_POSIX ];
    88 
    89   _Thread_queue_Context_initialize( &queue_context );
    90   _Thread_queue_Context_clear_priority_updates( &queue_context );
    91   _Thread_Wait_acquire( the_thread, &queue_context );
    92 
    93   /*
    94    *  This will prevent the thread from consuming its entire "budget"
    95    *  while at low priority.
    96    */
    97   the_thread->cpu_time_budget = UINT32_MAX;
    98 
    99   if ( !_Priority_Node_is_active( &api->Sporadic.Low_priority ) ) {
    100     _Thread_Priority_add(
    101       the_thread,
    102       &api->Sporadic.Low_priority,
    103       &queue_context
    104     );
    105     _Thread_Priority_remove(
    106       the_thread,
    107       &the_thread->Real_priority,
    108       &queue_context
    109     );
    110   }
    111 
    112   _Thread_Wait_release( the_thread, &queue_context );
    113   _Thread_Priority_update( &queue_context );
    114 }
    115 
    116 /*
    117  *  _POSIX_Threads_Create_extension
    118  *
    119  *  This method is invoked for each thread created.
    120  */
    121 
    122 static bool _POSIX_Threads_Create_extension(
    123   Thread_Control *executing RTEMS_UNUSED,
    124   Thread_Control *created
    125 )
    126 {
    127   POSIX_API_Control *api;
    128 
    129   api = created->API_Extensions[ THREAD_API_POSIX ];
    130 
    131   api->Sporadic.thread = created;
    132   _Watchdog_Preinitialize( &api->Sporadic.Timer, _Per_CPU_Get_by_index( 0 ) );
    133   _Watchdog_Initialize( &api->Sporadic.Timer, _POSIX_Threads_Sporadic_timer );
    134   _Priority_Node_set_inactive( &api->Sporadic.Low_priority );
    135 
    136   return true;
    137 }
    138 
    139 static void _POSIX_Threads_Terminate_extension( Thread_Control *executing )
    140 {
    141   POSIX_API_Control *api;
    142   ISR_lock_Context   lock_context;
    143 
    144   api = executing->API_Extensions[ THREAD_API_POSIX ];
    145 
    146   _Thread_State_acquire( executing, &lock_context );
    147   _Watchdog_Per_CPU_remove_ticks( &api->Sporadic.Timer );
    148   _Thread_State_release( executing, &lock_context );
    149 }
    150 #endif
    151 
    152 /*
    153  *  _POSIX_Threads_Exitted_extension
    154  *
    155  *  This method is invoked each time a thread exits.
    156  */
    157 static void _POSIX_Threads_Exitted_extension(
    158   Thread_Control *executing
    159 )
    160 {
    161   /*
    162    *  If the executing thread was not created with the POSIX API, then this
    163    *  API do not get to define its exit behavior.
    164    */
    165   if ( _Objects_Get_API( executing->Object.id ) == OBJECTS_POSIX_API )
    166     pthread_exit( executing->Wait.return_argument );
    167 }
    168 
    169 User_extensions_Control _POSIX_Threads_User_extensions = {
    170   .Callouts = {
    171 #if defined(RTEMS_POSIX_API)
    172     .thread_create    = _POSIX_Threads_Create_extension,
    173     .thread_terminate = _POSIX_Threads_Terminate_extension,
    174 #endif
    175     .thread_exitted   = _POSIX_Threads_Exitted_extension
    176   }
    177 };
    178 
    179 /*
    180  *  _POSIX_Threads_Manager_initialization
    181  *
    182  *  This routine initializes all threads manager related data structures.
    183  */
    184 static void _POSIX_Threads_Manager_initialization(void)
    185 {
    186   _Thread_Initialize_information(
    187     &_POSIX_Threads_Information, /* object information table */
    188     OBJECTS_POSIX_API,           /* object API */
    189     OBJECTS_POSIX_THREADS,       /* object class */
    190     _Configuration_POSIX_Maximum_threads
    191   );
    192 
    193   /*
    194    *  Add all the extensions for this API
    195    */
    196   _User_extensions_Add_API_set( &_POSIX_Threads_User_extensions );
    197 
    198   /*
    199    *  If we supported MP, then here we would ...
    200    *       Register the MP Process Packet routine.
    201    */
    202 }
    203 
    204 RTEMS_SYSINIT_ITEM(
    205   _POSIX_Threads_Manager_initialization,
    206   RTEMS_SYSINIT_POSIX_THREADS,
    207   RTEMS_SYSINIT_ORDER_MIDDLE
     23THREAD_INFORMATION_DEFINE_ZERO(
     24  _POSIX_Threads,
     25  OBJECTS_POSIX_API,
     26  OBJECTS_POSIX_THREADS
    20827);
  • cpukit/posix/src/pthreadcreate.c

    r0f5b2c09 r21275b58  
    2727
    2828#include <rtems/posix/priorityimpl.h>
     29#if defined(RTEMS_POSIX_API)
     30#include <rtems/posix/psignalimpl.h>
     31#endif
    2932#include <rtems/posix/pthreadimpl.h>
    3033#include <rtems/posix/pthreadattrimpl.h>
     
    3437#include <rtems/score/stackimpl.h>
    3538#include <rtems/score/schedulerimpl.h>
     39#include <rtems/score/userextimpl.h>
     40#include <rtems/sysinit.h>
    3641
    3742static inline size_t _POSIX_Threads_Ensure_minimum_stack (
     
    300305  return 0;
    301306}
     307
     308#if defined(RTEMS_POSIX_API)
     309void _POSIX_Threads_Sporadic_timer( Watchdog_Control *watchdog )
     310{
     311  POSIX_API_Control    *api;
     312  Thread_Control       *the_thread;
     313  Thread_queue_Context  queue_context;
     314
     315  api = RTEMS_CONTAINER_OF( watchdog, POSIX_API_Control, Sporadic.Timer );
     316  the_thread = api->Sporadic.thread;
     317
     318  _Thread_queue_Context_initialize( &queue_context );
     319  _Thread_queue_Context_clear_priority_updates( &queue_context );
     320  _Thread_Wait_acquire( the_thread, &queue_context );
     321
     322  if ( _Priority_Node_is_active( &api->Sporadic.Low_priority ) ) {
     323    _Thread_Priority_add(
     324      the_thread,
     325      &the_thread->Real_priority,
     326      &queue_context
     327    );
     328    _Thread_Priority_remove(
     329      the_thread,
     330      &api->Sporadic.Low_priority,
     331      &queue_context
     332    );
     333    _Priority_Node_set_inactive( &api->Sporadic.Low_priority );
     334  }
     335
     336  _Watchdog_Per_CPU_remove_ticks( &api->Sporadic.Timer );
     337  _POSIX_Threads_Sporadic_timer_insert( the_thread, api );
     338
     339  _Thread_Wait_release( the_thread, &queue_context );
     340  _Thread_Priority_update( &queue_context );
     341}
     342
     343void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread )
     344{
     345  POSIX_API_Control    *api;
     346  Thread_queue_Context  queue_context;
     347
     348  api = the_thread->API_Extensions[ THREAD_API_POSIX ];
     349
     350  _Thread_queue_Context_initialize( &queue_context );
     351  _Thread_queue_Context_clear_priority_updates( &queue_context );
     352  _Thread_Wait_acquire( the_thread, &queue_context );
     353
     354  /*
     355   *  This will prevent the thread from consuming its entire "budget"
     356   *  while at low priority.
     357   */
     358  the_thread->cpu_time_budget = UINT32_MAX;
     359
     360  if ( !_Priority_Node_is_active( &api->Sporadic.Low_priority ) ) {
     361    _Thread_Priority_add(
     362      the_thread,
     363      &api->Sporadic.Low_priority,
     364      &queue_context
     365    );
     366    _Thread_Priority_remove(
     367      the_thread,
     368      &the_thread->Real_priority,
     369      &queue_context
     370    );
     371  }
     372
     373  _Thread_Wait_release( the_thread, &queue_context );
     374  _Thread_Priority_update( &queue_context );
     375}
     376
     377static bool _POSIX_Threads_Create_extension(
     378  Thread_Control *executing RTEMS_UNUSED,
     379  Thread_Control *created
     380)
     381{
     382  POSIX_API_Control *api;
     383
     384  api = created->API_Extensions[ THREAD_API_POSIX ];
     385
     386  api->Sporadic.thread = created;
     387  _Watchdog_Preinitialize( &api->Sporadic.Timer, _Per_CPU_Get_by_index( 0 ) );
     388  _Watchdog_Initialize( &api->Sporadic.Timer, _POSIX_Threads_Sporadic_timer );
     389  _Priority_Node_set_inactive( &api->Sporadic.Low_priority );
     390
     391  return true;
     392}
     393
     394static void _POSIX_Threads_Terminate_extension( Thread_Control *executing )
     395{
     396  POSIX_API_Control *api;
     397  ISR_lock_Context   lock_context;
     398
     399  api = executing->API_Extensions[ THREAD_API_POSIX ];
     400
     401  _Thread_State_acquire( executing, &lock_context );
     402  _Watchdog_Per_CPU_remove_ticks( &api->Sporadic.Timer );
     403  _Thread_State_release( executing, &lock_context );
     404}
     405#endif
     406
     407static void _POSIX_Threads_Exitted_extension(
     408  Thread_Control *executing
     409)
     410{
     411  /*
     412   *  If the executing thread was not created with the POSIX API, then this
     413   *  API do not get to define its exit behavior.
     414   */
     415  if ( _Objects_Get_API( executing->Object.id ) == OBJECTS_POSIX_API )
     416    pthread_exit( executing->Wait.return_argument );
     417}
     418
     419static User_extensions_Control _POSIX_Threads_User_extensions = {
     420  .Callouts = {
     421#if defined(RTEMS_POSIX_API)
     422    .thread_create    = _POSIX_Threads_Create_extension,
     423    .thread_terminate = _POSIX_Threads_Terminate_extension,
     424#endif
     425    .thread_exitted   = _POSIX_Threads_Exitted_extension
     426  }
     427};
     428
     429static void _POSIX_Threads_Manager_initialization( void )
     430{
     431  _Thread_Initialize_information( &_POSIX_Threads_Information );
     432  _User_extensions_Add_API_set( &_POSIX_Threads_User_extensions );
     433}
     434
     435RTEMS_SYSINIT_ITEM(
     436  _POSIX_Threads_Manager_initialization,
     437  RTEMS_SYSINIT_POSIX_THREADS,
     438  RTEMS_SYSINIT_ORDER_MIDDLE
     439);
  • cpukit/posix/src/ptimer.c

    r0f5b2c09 r21275b58  
    22 * @file
    33 *
    4  * @brief Process Timer
    5  * @ingroup POSIXAPI
     4 * @ingroup POSIX_INTERNAL_TIMERS
     5 *
     6 * @brief POSIX Timer Information with Zero Objects
    67 */
    78
    89/*
    9  *  COPYRIGHT (c) 1989-2008.
    10  *  On-Line Applications Research Corporation (OAR).
     10 * SPDX-License-Identifier: BSD-2-Clause
    1111 *
    12  *  The license and distribution terms for this file may be
    13  *  found in the file LICENSE in this distribution or at
    14  *  http://www.rtems.org/license/LICENSE.
     12 * Copyright (C) 2018 embedded brains GmbH
     13 *
     14 * Redistribution and use in source and binary forms, with or without
     15 * modification, are permitted provided that the following conditions
     16 * are met:
     17 * 1. Redistributions of source code must retain the above copyright
     18 *    notice, this list of conditions and the following disclaimer.
     19 * 2. Redistributions in binary form must reproduce the above copyright
     20 *    notice, this list of conditions and the following disclaimer in the
     21 *    documentation and/or other materials provided with the distribution.
     22 *
     23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33 * POSSIBILITY OF SUCH DAMAGE.
    1534 */
    1635
     
    1938#endif
    2039
    21 #include <time.h>
    22 #include <errno.h>
    23 #include <limits.h> /* _POSIX_PATH_MAX */
     40#include <rtems/posix/timer.h>
    2441
    25 #include <rtems/system.h>
    26 #include <rtems/config.h>
    27 #include <rtems/score/isr.h>
    28 #include <rtems/score/thread.h>
    29 
    30 
    31 /************************************/
    32 /* These includes are now necessary */
    33 /************************************/
    34 
    35 #include <unistd.h>
    36 #include <rtems/sysinit.h>
    37 #include <rtems/rtems/status.h>
    38 #include <rtems/rtems/types.h>
    39 #include <rtems/rtems/timer.h>
    40 #include <rtems/rtems/clock.h>
    41 #include <rtems/score/wkspace.h>
    42 #include <pthread.h>
    43 #include <stdio.h>
    44 #include <signal.h>
    45 
    46 #include <rtems/posix/timerimpl.h>
    47 
    48 Objects_Information _POSIX_Timer_Information;
    49 
    50 /*
    51  * _POSIX_Timer_Manager_initialization
    52  *
    53  *  Description:
    54  *
    55  *  Initialize the internal structure in which the data of all
    56  *  the timers are stored
    57  */
    58 
    59 static void _POSIX_Timer_Manager_initialization(void)
    60 {
    61   _Objects_Initialize_information(
    62     &_POSIX_Timer_Information,  /* object information table */
    63     OBJECTS_POSIX_API,          /* object API */
    64     OBJECTS_POSIX_TIMERS,       /* object class */
    65     _Configuration_POSIX_Maximum_timers,
    66     sizeof( POSIX_Timer_Control ),
    67                                 /* size of this object's control block */
    68     OBJECTS_NO_STRING_NAME,     /* maximum length of an object name */
    69     NULL                        /* Proxy extraction support callout */
    70   );
    71 }
    72 
    73 RTEMS_SYSINIT_ITEM(
    74   _POSIX_Timer_Manager_initialization,
    75   RTEMS_SYSINIT_POSIX_TIMER,
    76   RTEMS_SYSINIT_ORDER_MIDDLE
     42OBJECTS_INFORMATION_DEFINE_ZERO(
     43  _POSIX_Timer,
     44  OBJECTS_POSIX_API,
     45  OBJECTS_POSIX_TIMERS,
     46  OBJECTS_NO_STRING_NAME
    7747);
  • cpukit/posix/src/semopen.c

    r0f5b2c09 r21275b58  
    2121#include <rtems/posix/semaphoreimpl.h>
    2222#include <rtems/score/wkspace.h>
     23#include <rtems/sysinit.h>
    2324
    2425#include <stdarg.h>
     
    173174  return sem;
    174175}
     176
     177static void _POSIX_Semaphore_Manager_initialization( void )
     178{
     179  _Objects_Initialize_information( &_POSIX_Semaphore_Information );
     180}
     181
     182RTEMS_SYSINIT_ITEM(
     183  _POSIX_Semaphore_Manager_initialization,
     184  RTEMS_SYSINIT_POSIX_SEMAPHORE,
     185  RTEMS_SYSINIT_ORDER_MIDDLE
     186);
  • cpukit/posix/src/shm.c

    r0f5b2c09 r21275b58  
    11/**
    22 * @file
     3 *
     4 * @ingroup POSIXShmPrivate
     5 *
     6 * @brief POSIX Shared Memory Information with Zero Objects
    37 */
    48
    59/*
    6  * Copyright (c) 2016 Gedare Bloom.
     10 * SPDX-License-Identifier: BSD-2-Clause
    711 *
    8  * The license and distribution terms for this file may be
    9  * found in the file LICENSE in this distribution or at
    10  * http://www.rtems.org/license/LICENSE.
     12 * Copyright (C) 2018 embedded brains GmbH
     13 *
     14 * Redistribution and use in source and binary forms, with or without
     15 * modification, are permitted provided that the following conditions
     16 * are met:
     17 * 1. Redistributions of source code must retain the above copyright
     18 *    notice, this list of conditions and the following disclaimer.
     19 * 2. Redistributions in binary form must reproduce the above copyright
     20 *    notice, this list of conditions and the following disclaimer in the
     21 *    documentation and/or other materials provided with the distribution.
     22 *
     23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33 * POSSIBILITY OF SUCH DAMAGE.
    1134 */
    1235
     
    1538#endif
    1639
    17 #include <sys/stat.h>
    18 #include <fcntl.h>
     40#include <rtems/posix/shm.h>
     41
    1942#include <limits.h>
    2043
    21 #include <rtems/system.h>
    22 #include <rtems/config.h>
    23 #include <rtems/libio.h>
    24 #include <rtems/sysinit.h>
    25 #include <rtems/posix/shmimpl.h>
    26 
    27 Objects_Information _POSIX_Shm_Information;
    28 
    29 static void _POSIX_Shm_Manager_initialization( void )
    30 {
    31   _Objects_Initialize_information(
    32     &_POSIX_Shm_Information,    /* object information table */
    33     OBJECTS_POSIX_API,          /* object API */
    34     OBJECTS_POSIX_SHMS,         /* object class */
    35     _Configuration_POSIX_Maximum_shms,
    36     sizeof( POSIX_Shm_Control ),
    37                                 /* size of this object's control block */
    38     _POSIX_PATH_MAX,            /* maximum length of each object's name */
    39     NULL                        /* Proxy extraction support callout */
    40   );
    41 }
    42 
    43 RTEMS_SYSINIT_ITEM(
    44   _POSIX_Shm_Manager_initialization,
    45   RTEMS_SYSINIT_POSIX_SHM,
    46   RTEMS_SYSINIT_ORDER_MIDDLE
     44OBJECTS_INFORMATION_DEFINE_ZERO(
     45  _POSIX_Shm,
     46  OBJECTS_POSIX_API,
     47  OBJECTS_POSIX_SHMS,
     48  _POSIX_PATH_MAX
    4749);
  • cpukit/posix/src/shmopen.c

    r0f5b2c09 r21275b58  
    2626#include <rtems/posix/shmimpl.h>
    2727#include <rtems/score/wkspace.h>
     28#include <rtems/sysinit.h>
    2829
    2930static const rtems_filesystem_file_handlers_r shm_handlers;
     
    315316  .writev_h = rtems_filesystem_default_writev
    316317};
     318
     319static void _POSIX_Shm_Manager_initialization( void )
     320{
     321  _Objects_Initialize_information( &_POSIX_Shm_Information );
     322}
     323
     324RTEMS_SYSINIT_ITEM(
     325  _POSIX_Shm_Manager_initialization,
     326  RTEMS_SYSINIT_POSIX_SHM,
     327  RTEMS_SYSINIT_ORDER_MIDDLE
     328);
  • cpukit/rtems/src/barrier.c

    r0f5b2c09 r21275b58  
    22 * @file
    33 *
    4  * @brief RTEMS Barrier Manager Initialization
    5  * @ingroup ClassicBarrier Barriers
     4 * @ingroup ClassicBarrier
     5 *
     6 * @brief Classic Barrier Information with Zero Objects
    67 */
    78
    89/*
    9  *  COPYRIGHT (c) 1989-2015.
    10  *  On-Line Applications Research Corporation (OAR).
     10 * SPDX-License-Identifier: BSD-2-Clause
    1111 *
    12  *  The license and distribution terms for this file may be
    13  *  found in the file LICENSE in this distribution or at
    14  *  http://www.rtems.org/license/LICENSE.
     12 * Copyright (C) 2018 embedded brains GmbH
     13 *
     14 * Redistribution and use in source and binary forms, with or without
     15 * modification, are permitted provided that the following conditions
     16 * are met:
     17 * 1. Redistributions of source code must retain the above copyright
     18 *    notice, this list of conditions and the following disclaimer.
     19 * 2. Redistributions in binary form must reproduce the above copyright
     20 *    notice, this list of conditions and the following disclaimer in the
     21 *    documentation and/or other materials provided with the distribution.
     22 *
     23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33 * POSSIBILITY OF SUCH DAMAGE.
    1534 */
    1635
     
    1938#endif
    2039
    21 #include <rtems/system.h>
    22 #include <rtems/config.h>
    23 #include <rtems/sysinit.h>
    24 #include <rtems/rtems/status.h>
    25 #include <rtems/rtems/support.h>
    26 #include <rtems/rtems/barrierimpl.h>
     40#include <rtems/rtems/barrierdata.h>
    2741
    28 Objects_Information _Barrier_Information;
    29 
    30 /**
    31  *  @brief _Barrier_Manager_initialization
    32  */
    33 static void _Barrier_Manager_initialization(void)
    34 {
    35   _Objects_Initialize_information(
    36     &_Barrier_Information,         /* object information table */
    37     OBJECTS_CLASSIC_API,           /* object API */
    38     OBJECTS_RTEMS_BARRIERS,        /* object class */
    39     Configuration_RTEMS_API.maximum_barriers,
    40                                    /* maximum objects of this class */
    41     sizeof( Barrier_Control ),     /* size of this object's control block */
    42     OBJECTS_NO_STRING_NAME,        /* maximum length of an object name */
    43     NULL                           /* Proxy extraction support callout */
    44   );
    45 }
    46 
    47 RTEMS_SYSINIT_ITEM(
    48   _Barrier_Manager_initialization,
    49   RTEMS_SYSINIT_CLASSIC_BARRIER,
    50   RTEMS_SYSINIT_ORDER_MIDDLE
     42OBJECTS_INFORMATION_DEFINE_ZERO(
     43  _Barrier,
     44  OBJECTS_CLASSIC_API,
     45  OBJECTS_RTEMS_BARRIERS,
     46  OBJECTS_NO_STRING_NAME
    5147);
  • cpukit/rtems/src/barriercreate.c

    r0f5b2c09 r21275b58  
    1919#endif
    2020
    21 #include <rtems/system.h>
     21#include <rtems/rtems/barrierimpl.h>
    2222#include <rtems/rtems/status.h>
    2323#include <rtems/rtems/support.h>
    2424#include <rtems/rtems/attrimpl.h>
    2525#include <rtems/score/isr.h>
    26 #include <rtems/rtems/barrierimpl.h>
    27 
    28 /*
    29  *  rtems_barrier_create
    30  *
    31  *  This directive creates a barrier.  A barrier id is returned.
    32  *
    33  *  Input parameters:
    34  *    name             - user defined barrier name
    35  *    attribute_set    - barrier attributes
    36  *    maximum_waiters  - number of threads before automatic release
    37  *    priority_ceiling - barrier's ceiling priority
    38  *    id               - pointer to barrier id
    39  *
    40  *  Output parameters:
    41  *    id               - barrier id
    42  *    RTEMS_SUCCESSFUL - if successful
    43  *    error code       - if unsuccessful
    44  */
     26#include <rtems/sysinit.h>
    4527
    4628rtems_status_code rtems_barrier_create(
     
    9173  return RTEMS_SUCCESSFUL;
    9274}
     75
     76static void _Barrier_Manager_initialization( void )
     77{
     78  _Objects_Initialize_information( &_Barrier_Information );
     79}
     80
     81RTEMS_SYSINIT_ITEM(
     82  _Barrier_Manager_initialization,
     83  RTEMS_SYSINIT_CLASSIC_BARRIER,
     84  RTEMS_SYSINIT_ORDER_MIDDLE
     85);
  • cpukit/rtems/src/dpmem.c

    r0f5b2c09 r21275b58  
    11/**
    2  *  @file
     2 * @file
    33 *
    4  *  @brief Dual Ported Memory Manager Initialization
    5  *  @ingroup ClassicDPMEM
     4 * @ingroup ClassicDPMEM
     5 *
     6 * @brief Classic Dual Ported Memory Information with Zero Objects
    67 */
    78
    89/*
    9  *  COPYRIGHT (c) 1989-2008.
    10  *  On-Line Applications Research Corporation (OAR).
     10 * SPDX-License-Identifier: BSD-2-Clause
    1111 *
    12  *  The license and distribution terms for this file may be
    13  *  found in the file LICENSE in this distribution or at
    14  *  http://www.rtems.org/license/LICENSE.
     12 * Copyright (C) 2018 embedded brains GmbH
     13 *
     14 * Redistribution and use in source and binary forms, with or without
     15 * modification, are permitted provided that the following conditions
     16 * are met:
     17 * 1. Redistributions of source code must retain the above copyright
     18 *    notice, this list of conditions and the following disclaimer.
     19 * 2. Redistributions in binary form must reproduce the above copyright
     20 *    notice, this list of conditions and the following disclaimer in the
     21 *    documentation and/or other materials provided with the distribution.
     22 *
     23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33 * POSSIBILITY OF SUCH DAMAGE.
    1534 */
    1635
     
    1938#endif
    2039
    21 #include <rtems/system.h>
    22 #include <rtems/config.h>
    23 #include <rtems/sysinit.h>
    24 #include <rtems/rtems/status.h>
    25 #include <rtems/rtems/support.h>
    26 #include <rtems/rtems/dpmemimpl.h>
     40#include <rtems/rtems/dpmemdata.h>
    2741
    28 Objects_Information _Dual_ported_memory_Information;
    29 
    30 static void _Dual_ported_memory_Manager_initialization(void)
    31 {
    32   _Objects_Initialize_information(
    33     &_Dual_ported_memory_Information, /* object information table */
    34     OBJECTS_CLASSIC_API,              /* object API */
    35     OBJECTS_RTEMS_PORTS,              /* object class */
    36     Configuration_RTEMS_API.maximum_ports,
    37                                   /* maximum objects of this class */
    38     sizeof( Dual_ported_memory_Control ),
    39                                   /* size of this object's control block */
    40     OBJECTS_NO_STRING_NAME,       /* maximum length of an object name */
    41     NULL                          /* Proxy extraction support callout */
    42   );
    43 }
    44 
    45 RTEMS_SYSINIT_ITEM(
    46   _Dual_ported_memory_Manager_initialization,
    47   RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY,
    48   RTEMS_SYSINIT_ORDER_MIDDLE
     42OBJECTS_INFORMATION_DEFINE_ZERO(
     43  _Dual_ported_memory,
     44  OBJECTS_CLASSIC_API,
     45  OBJECTS_RTEMS_PORTS,
     46  OBJECTS_NO_STRING_NAME
    4947);
  • cpukit/rtems/src/dpmemcreate.c

    r0f5b2c09 r21275b58  
    1919#endif
    2020
    21 #include <rtems/system.h>
     21#include <rtems/rtems/dpmemimpl.h>
    2222#include <rtems/rtems/status.h>
    2323#include <rtems/rtems/support.h>
    2424#include <rtems/score/address.h>
    25 #include <rtems/rtems/dpmemimpl.h>
    2625#include <rtems/score/thread.h>
     26#include <rtems/sysinit.h>
    2727
    2828rtems_status_code rtems_port_create(
     
    6767  return RTEMS_SUCCESSFUL;
    6868}
     69
     70static void _Dual_ported_memory_Manager_initialization( void )
     71{
     72  _Objects_Initialize_information( &_Dual_ported_memory_Information );
     73}
     74
     75RTEMS_SYSINIT_ITEM(
     76  _Dual_ported_memory_Manager_initialization,
     77  RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY,
     78  RTEMS_SYSINIT_ORDER_MIDDLE
     79);
  • cpukit/rtems/src/msg.c

    r0f5b2c09 r21275b58  
    11/**
    2  *  @file
     2 * @file
    33 *
    4  *  @brief Message Queue Manager Initialization
    5  *  @ingroup ClassicMessageQueue
     4 * @ingroup ClassicMessageQueue
     5 *
     6 * @brief Classic Message Queue Information with Zero Objects
    67 */
    78
    89/*
    9  *  COPYRIGHT (c) 1989-2008.
    10  *  On-Line Applications Research Corporation (OAR).
     10 * SPDX-License-Identifier: BSD-2-Clause
    1111 *
    12  *  The license and distribution terms for this file may be
    13  *  found in the file LICENSE in this distribution or at
    14  *  http://www.rtems.org/license/LICENSE.
     12 * Copyright (C) 2018 embedded brains GmbH
     13 *
     14 * Redistribution and use in source and binary forms, with or without
     15 * modification, are permitted provided that the following conditions
     16 * are met:
     17 * 1. Redistributions of source code must retain the above copyright
     18 *    notice, this list of conditions and the following disclaimer.
     19 * 2. Redistributions in binary form must reproduce the above copyright
     20 *    notice, this list of conditions and the following disclaimer in the
     21 *    documentation and/or other materials provided with the distribution.
     22 *
     23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33 * POSSIBILITY OF SUCH DAMAGE.
    1534 */
    1635
     
    1938#endif
    2039
    21 #include <rtems/system.h>
    22 #include <rtems/config.h>
    23 #include <rtems/sysinit.h>
    24 #include <rtems/rtems/status.h>
    25 #include <rtems/rtems/attrimpl.h>
    26 #include <rtems/rtems/messageimpl.h>
    27 #include <rtems/rtems/options.h>
    28 #include <rtems/rtems/support.h>
     40#include <rtems/rtems/messagedata.h>
    2941
    30 Objects_Information _Message_queue_Information;
    31 
    32 static void _Message_queue_Manager_initialization(void)
    33 {
    34   _Objects_Initialize_information(
    35     &_Message_queue_Information,  /* object information table */
    36     OBJECTS_CLASSIC_API,          /* object API */
    37     OBJECTS_RTEMS_MESSAGE_QUEUES, /* object class */
    38     Configuration_RTEMS_API.maximum_message_queues,
    39                                   /* maximum objects of this class */
    40     sizeof( Message_queue_Control ),
    41                                   /* size of this object's control block */
    42     OBJECTS_NO_STRING_NAME,       /* maximum length of an object name */
    43     _Message_queue_MP_Send_extract_proxy
    44                                   /* Proxy extraction support callout */
    45   );
    46 
    47   /*
    48    *  Register the MP Process Packet routine.
    49    */
    50 
    51 #if defined(RTEMS_MULTIPROCESSING)
    52   _MPCI_Register_packet_processor(
    53     MP_PACKET_MESSAGE_QUEUE,
    54     _Message_queue_MP_Process_packet
    55   );
    56 #endif
    57 
    58 }
    59 
    60 RTEMS_SYSINIT_ITEM(
    61   _Message_queue_Manager_initialization,
    62   RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE,
    63   RTEMS_SYSINIT_ORDER_MIDDLE
     42OBJECTS_INFORMATION_DEFINE_ZERO(
     43  _Message_queue,
     44  OBJECTS_CLASSIC_API,
     45  OBJECTS_RTEMS_MESSAGE_QUEUES,
     46  OBJECTS_NO_STRING_NAME
    6447);
  • cpukit/rtems/src/msgqcreate.c

    r0f5b2c09 r21275b58  
    1919#endif
    2020
    21 #include <rtems/system.h>
     21#include <rtems/rtems/messageimpl.h>
     22#include <rtems/rtems/status.h>
     23#include <rtems/rtems/attrimpl.h>
     24#include <rtems/rtems/options.h>
     25#include <rtems/rtems/support.h>
    2226#include <rtems/score/sysstate.h>
    2327#include <rtems/score/chain.h>
     
    2630#include <rtems/score/thread.h>
    2731#include <rtems/score/wkspace.h>
    28 #include <rtems/rtems/status.h>
    29 #include <rtems/rtems/attrimpl.h>
    30 #include <rtems/rtems/messageimpl.h>
    31 #include <rtems/rtems/options.h>
    32 #include <rtems/rtems/support.h>
     32#include <rtems/sysinit.h>
    3333
    3434rtems_status_code rtems_message_queue_create(
     
    144144  return RTEMS_SUCCESSFUL;
    145145}
     146
     147static void _Message_queue_Manager_initialization(void)
     148{
     149   _Objects_Initialize_information( &_Message_queue_Information);
     150
     151  /*
     152   *  Register the MP Process Packet routine.
     153   */
     154
     155#if defined(RTEMS_MULTIPROCESSING)
     156  _MPCI_Register_packet_processor(
     157    MP_PACKET_MESSAGE_QUEUE,
     158    _Message_queue_MP_Process_packet
     159  );
     160#endif
     161
     162}
     163
     164RTEMS_SYSINIT_ITEM(
     165  _Message_queue_Manager_initialization,
     166  RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE,
     167  RTEMS_SYSINIT_ORDER_MIDDLE
     168);
  • cpukit/rtems/src/part.c

    r0f5b2c09 r21275b58  
    11/**
    2  *  @file
     2 * @file
    33 *
    4  *  @brief Partition Manager Initialization
    5  *  @ingroup ClassicPart
     4 * @ingroup ClassicPart
     5 *
     6 * @brief Classic Partition Information with Zero Objects
    67 */
    78
    89/*
    9  *  COPYRIGHT (c) 1989-2008.
    10  *  On-Line Applications Research Corporation (OAR).
     10 * SPDX-License-Identifier: BSD-2-Clause
    1111 *
    12  *  The license and distribution terms for this file may be
    13  *  found in the file LICENSE in this distribution or at
    14  *  http://www.rtems.org/license/LICENSE.
     12 * Copyright (C) 2018 embedded brains GmbH
     13 *
     14 * Redistribution and use in source and binary forms, with or without
     15 * modification, are permitted provided that the following conditions
     16 * are met:
     17 * 1. Redistributions of source code must retain the above copyright
     18 *    notice, this list of conditions and the following disclaimer.
     19 * 2. Redistributions in binary form must reproduce the above copyright
     20 *    notice, this list of conditions and the following disclaimer in the
     21 *    documentation and/or other materials provided with the distribution.
     22 *
     23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33 * POSSIBILITY OF SUCH DAMAGE.
    1534 */
    1635
     
    1938#endif
    2039
    21 #include <rtems/system.h>
    22 #include <rtems/config.h>
    23 #include <rtems/sysinit.h>
    24 #include <rtems/rtems/status.h>
    25 #include <rtems/rtems/support.h>
    26 #include <rtems/rtems/partimpl.h>
     40#include <rtems/rtems/partdata.h>
    2741
    28 Objects_Information _Partition_Information;
    29 
    30 static void _Partition_Manager_initialization(void)
    31 {
    32   _Objects_Initialize_information(
    33     &_Partition_Information,     /* object information table */
    34     OBJECTS_CLASSIC_API,         /* object API */
    35     OBJECTS_RTEMS_PARTITIONS,    /* object class */
    36     Configuration_RTEMS_API.maximum_partitions,
    37                                  /* maximum objects of this class */
    38     sizeof( Partition_Control ), /* size of this object's control block */
    39     OBJECTS_NO_STRING_NAME,      /* maximum length of an object name */
    40     _Partition_MP_Send_extract_proxy  /* Proxy extraction support callout */
    41   );
    42 
    43   /*
    44    *  Register the MP Process Packet routine.
    45    */
    46 
    47 #if defined(RTEMS_MULTIPROCESSING)
    48   _MPCI_Register_packet_processor(
    49     MP_PACKET_PARTITION,
    50     _Partition_MP_Process_packet
    51   );
    52 #endif
    53 
    54 }
    55 
    56 RTEMS_SYSINIT_ITEM(
    57   _Partition_Manager_initialization,
    58   RTEMS_SYSINIT_CLASSIC_PARTITION,
    59   RTEMS_SYSINIT_ORDER_MIDDLE
     42OBJECTS_INFORMATION_DEFINE_ZERO(
     43  _Partition,
     44  OBJECTS_CLASSIC_API,
     45  OBJECTS_RTEMS_PARTITIONS,
     46  OBJECTS_NO_STRING_NAME
    6047);
  • cpukit/rtems/src/partcreate.c

    r0f5b2c09 r21275b58  
    2424#include <rtems/score/threaddispatch.h>
    2525#include <rtems/score/sysstate.h>
     26#include <rtems/sysinit.h>
    2627
    27 /*
    28  *  rtems_partition_create
    29  *
    30  *  This directive creates a partiton of fixed sized buffers from the
    31  *  given contiguous memory area.
    32  *
    33  *  Input parameters:
    34  *    name             - user defined partition name
    35  *    starting_address - physical start address of partition
    36  *    length           - physical length in bytes
    37  *    buffer_size      - size of buffers in bytes
    38  *    attribute_set    - partition attributes
    39  *    id               - pointer to partition id
    40  *
    41  *  Output parameters:
    42  *    id               - partition id
    43  *    RTEMS_SUCCESSFUL - if successful
    44  *    error code       - if unsuccessful
    45  */
    4628
    4729rtems_status_code rtems_partition_create(
     
    134116  return RTEMS_SUCCESSFUL;
    135117}
     118
     119static void _Partition_Manager_initialization(void)
     120{
     121  _Objects_Initialize_information( &_Partition_Information );
     122
     123  /*
     124   *  Register the MP Process Packet routine.
     125   */
     126
     127#if defined(RTEMS_MULTIPROCESSING)
     128  _MPCI_Register_packet_processor(
     129    MP_PACKET_PARTITION,
     130    _Partition_MP_Process_packet
     131  );
     132#endif
     133
     134}
     135
     136RTEMS_SYSINIT_ITEM(
     137  _Partition_Manager_initialization,
     138  RTEMS_SYSINIT_CLASSIC_PARTITION,
     139  RTEMS_SYSINIT_ORDER_MIDDLE
     140);
  • cpukit/rtems/src/ratemon.c

    r0f5b2c09 r21275b58  
    11/**
    2  *  @file
     2 * @file
    33 *
    4  *  @brief Rate Monotonic Manager Initialization
    5  *  @ingroup ClassicRateMon
     4 * @ingroup ClassicRateMon
     5 *
     6 * @brief Classic Rate Monotonic Information with Zero Objects
    67 */
    78
    89/*
    9  *  COPYRIGHT (c) 1989-2008.
    10  *  On-Line Applications Research Corporation (OAR).
     10 * SPDX-License-Identifier: BSD-2-Clause
    1111 *
    12  *  The license and distribution terms for this file may be
    13  *  found in the file LICENSE in this distribution or at
    14  *  http://www.rtems.org/license/LICENSE.
     12 * Copyright (C) 2018 embedded brains GmbH
     13 *
     14 * Redistribution and use in source and binary forms, with or without
     15 * modification, are permitted provided that the following conditions
     16 * are met:
     17 * 1. Redistributions of source code must retain the above copyright
     18 *    notice, this list of conditions and the following disclaimer.
     19 * 2. Redistributions in binary form must reproduce the above copyright
     20 *    notice, this list of conditions and the following disclaimer in the
     21 *    documentation and/or other materials provided with the distribution.
     22 *
     23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33 * POSSIBILITY OF SUCH DAMAGE.
    1534 */
    1635
     
    1938#endif
    2039
    21 #include <rtems/system.h>
    22 #include <rtems/config.h>
    23 #include <rtems/sysinit.h>
    24 #include <rtems/rtems/status.h>
    25 #include <rtems/rtems/support.h>
    26 #include <rtems/rtems/ratemonimpl.h>
     40#include <rtems/rtems/ratemondata.h>
    2741
    28 Objects_Information _Rate_monotonic_Information;
    29 
    30 static void _Rate_monotonic_Manager_initialization(void)
    31 {
    32   _Objects_Initialize_information(
    33     &_Rate_monotonic_Information,    /* object information table */
    34     OBJECTS_CLASSIC_API,             /* object API */
    35     OBJECTS_RTEMS_PERIODS,           /* object class */
    36     Configuration_RTEMS_API.maximum_periods,
    37                                      /* maximum objects of this class */
    38     sizeof( Rate_monotonic_Control ),/* size of this object's control block */
    39     OBJECTS_NO_STRING_NAME,          /* maximum length of an object name */
    40     NULL                             /* Proxy extraction support callout */
    41   );
    42 }
    43 
    44 RTEMS_SYSINIT_ITEM(
    45   _Rate_monotonic_Manager_initialization,
    46   RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC,
    47   RTEMS_SYSINIT_ORDER_MIDDLE
     42OBJECTS_INFORMATION_DEFINE_ZERO(
     43  _Rate_monotonic,
     44  OBJECTS_CLASSIC_API,
     45  OBJECTS_RTEMS_PERIODS,
     46  OBJECTS_NO_STRING_NAME
    4847);
  • cpukit/rtems/src/ratemoncreate.c

    r0f5b2c09 r21275b58  
    1919#endif
    2020
    21 #include <rtems/system.h>
     21#include <rtems/rtems/ratemonimpl.h>
    2222#include <rtems/rtems/status.h>
    2323#include <rtems/rtems/support.h>
    2424#include <rtems/score/isr.h>
    25 #include <rtems/rtems/ratemonimpl.h>
    2625#include <rtems/score/thread.h>
    2726#include <rtems/score/watchdogimpl.h>
    28 
    29 /*
    30  *  rtems_rate_monotonic_create
    31  *
    32  *  This directive creates a rate monotonic timer and performs
    33  *  some initialization.
    34  *
    35  *  Input parameters:
    36  *    name - name of period
    37  *    id   - pointer to rate monotonic id
    38  *
    39  *  Output parameters:
    40  *    id               - rate monotonic id
    41  *    RTEMS_SUCCESSFUL - if successful
    42  *    error code       - if unsuccessful
    43  */
     27#include <rtems/sysinit.h>
    4428
    4529rtems_status_code rtems_rate_monotonic_create(
     
    8569  return RTEMS_SUCCESSFUL;
    8670}
     71
     72static void _Rate_monotonic_Manager_initialization( void )
     73{
     74  _Objects_Initialize_information( &_Rate_monotonic_Information );
     75}
     76
     77RTEMS_SYSINIT_ITEM(
     78  _Rate_monotonic_Manager_initialization,
     79  RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC,
     80  RTEMS_SYSINIT_ORDER_MIDDLE
     81);
  • cpukit/rtems/src/region.c

    r0f5b2c09 r21275b58  
    22 * @file
    33 *
    4  * @brief _Region_Manager_initialization
    5  * @ingroup ClassicRegion Regions
     4 * @ingroup ClassicRegion
     5 *
     6 * @brief Classic Region Information with Zero Objects
    67 */
    78
    89/*
    9  *  COPYRIGHT (c) 1989-2013.
    10  *  On-Line Applications Research Corporation (OAR).
     10 * SPDX-License-Identifier: BSD-2-Clause
    1111 *
    12  *  The license and distribution terms for this file may be
    13  *  found in the file LICENSE in this distribution or at
    14  *  http://www.rtems.org/license/LICENSE.
     12 * Copyright (C) 2018 embedded brains GmbH
     13 *
     14 * Redistribution and use in source and binary forms, with or without
     15 * modification, are permitted provided that the following conditions
     16 * are met:
     17 * 1. Redistributions of source code must retain the above copyright
     18 *    notice, this list of conditions and the following disclaimer.
     19 * 2. Redistributions in binary form must reproduce the above copyright
     20 *    notice, this list of conditions and the following disclaimer in the
     21 *    documentation and/or other materials provided with the distribution.
     22 *
     23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33 * POSSIBILITY OF SUCH DAMAGE.
    1534 */
    1635
     
    1938#endif
    2039
    21 #include <rtems/system.h>
    22 #include <rtems/config.h>
    23 #include <rtems/sysinit.h>
    24 #include <rtems/rtems/status.h>
    25 #include <rtems/rtems/support.h>
    26 #include <rtems/rtems/options.h>
    27 #include <rtems/rtems/regionimpl.h>
     40#include <rtems/rtems/regiondata.h>
    2841
    29 Objects_Information _Region_Information;
    30 
    31 /*
    32  *  _Region_Manager_initialization
    33  *
    34  *  This routine initializes all region manager related data structures.
    35  *
    36  *  Input parameters:   NONE
    37  *
    38  *  Output parameters:  NONE
    39  */
    40 
    41 static void _Region_Manager_initialization(void)
    42 {
    43   _Objects_Initialize_information(
    44     &_Region_Information,      /* object information table */
    45     OBJECTS_CLASSIC_API,       /* object API */
    46     OBJECTS_RTEMS_REGIONS,     /* object class */
    47     Configuration_RTEMS_API.maximum_regions,
    48                                /* maximum objects of this class */
    49     sizeof( Region_Control ),  /* size of this object's control block */
    50     OBJECTS_NO_STRING_NAME,    /* maximum length of an object name */
    51     NULL                       /* Proxy extraction support callout */
    52   );
    53 }
    54 
    55 RTEMS_SYSINIT_ITEM(
    56   _Region_Manager_initialization,
    57   RTEMS_SYSINIT_CLASSIC_REGION,
    58   RTEMS_SYSINIT_ORDER_MIDDLE
     42OBJECTS_INFORMATION_DEFINE_ZERO(
     43  _Region,
     44  OBJECTS_CLASSIC_API,
     45  OBJECTS_RTEMS_REGIONS,
     46  OBJECTS_NO_STRING_NAME
    5947);
  • cpukit/rtems/src/regioncreate.c

    r0f5b2c09 r21275b58  
    2424#include <rtems/score/apimutex.h>
    2525#include <rtems/score/threadqimpl.h>
    26 
    27 /*
    28  *  rtems_region_create
    29  *
    30  *  This directive creates a region of physical contiguous memory area
    31  *  from which variable sized segments can be allocated.
    32  *
    33  *  Input parameters:
    34  *    name             - user defined region name
    35  *    starting_address - physical start address of region
    36  *    length           - physical length in bytes
    37  *    page_size        - page size in bytes
    38  *    attribute_set    - region attributes
    39  *    id               - address of region id to set
    40  *
    41  *  Output parameters:
    42  *    id               - region id
    43  *    RTEMS_SUCCESSFUL - if successful
    44  *    error code       - if unsuccessful
    45  */
     26#include <rtems/sysinit.h>
    4627
    4728rtems_status_code rtems_region_create(
     
    10586  return return_status;
    10687}
     88
     89static void _Region_Manager_initialization( void )
     90{
     91  _Objects_Initialize_information( &_Region_Information );
     92}
     93
     94RTEMS_SYSINIT_ITEM(
     95  _Region_Manager_initialization,
     96  RTEMS_SYSINIT_CLASSIC_REGION,
     97  RTEMS_SYSINIT_ORDER_MIDDLE
     98);
  • cpukit/rtems/src/rtemstimer.c

    r0f5b2c09 r21275b58  
    11/**
    2  *  @file
     2 * @file
    33 *
    4  *  @brief Timer Manager Initialization
    5  *  @ingroup ClassicTimer
     4 * @ingroup ClassicTimer
     5 *
     6 * @brief Classic Timer Information with Zero Objects
    67 */
    78
    89/*
    9  *  COPYRIGHT (c) 1989-2008.
    10  *  On-Line Applications Research Corporation (OAR).
     10 * SPDX-License-Identifier: BSD-2-Clause
    1111 *
    12  *  The license and distribution terms for this file may be
    13  *  found in the file LICENSE in this distribution or at
    14  *  http://www.rtems.org/license/LICENSE.
     12 * Copyright (C) 2018 embedded brains GmbH
     13 *
     14 * Redistribution and use in source and binary forms, with or without
     15 * modification, are permitted provided that the following conditions
     16 * are met:
     17 * 1. Redistributions of source code must retain the above copyright
     18 *    notice, this list of conditions and the following disclaimer.
     19 * 2. Redistributions in binary form must reproduce the above copyright
     20 *    notice, this list of conditions and the following disclaimer in the
     21 *    documentation and/or other materials provided with the distribution.
     22 *
     23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33 * POSSIBILITY OF SUCH DAMAGE.
    1534 */
    1635
     
    1938#endif
    2039
    21 #include <rtems/system.h>
    22 #include <rtems/config.h>
    23 #include <rtems/sysinit.h>
    24 #include <rtems/rtems/status.h>
    25 #include <rtems/rtems/support.h>
    26 #include <rtems/rtems/timerimpl.h>
     40#include <rtems/rtems/timerdata.h>
    2741
    28 Timer_server_Control *volatile _Timer_server;
    29 
    30 Objects_Information  _Timer_Information;
    31 
    32 static void _Timer_Manager_initialization(void)
    33 {
    34   _Objects_Initialize_information(
    35     &_Timer_Information,       /* object information table */
    36     OBJECTS_CLASSIC_API,       /* object API */
    37     OBJECTS_RTEMS_TIMERS,      /* object class */
    38     Configuration_RTEMS_API.maximum_timers ,
    39                                /* maximum objects of this class */
    40     sizeof( Timer_Control ),   /* size of this object's control block */
    41     OBJECTS_NO_STRING_NAME,    /* maximum length of an object name */
    42     NULL                       /* Proxy extraction support callout */
    43   );
    44 }
    45 
    46 RTEMS_SYSINIT_ITEM(
    47   _Timer_Manager_initialization,
    48   RTEMS_SYSINIT_CLASSIC_TIMER,
    49   RTEMS_SYSINIT_ORDER_MIDDLE
     42OBJECTS_INFORMATION_DEFINE_ZERO(
     43  _Timer,
     44  OBJECTS_CLASSIC_API,
     45  OBJECTS_RTEMS_TIMERS,
     46  OBJECTS_NO_STRING_NAME
    5047);
  • cpukit/rtems/src/sem.c

    r0f5b2c09 r21275b58  
    11/**
    2  *  @file
     2 * @file
    33 *
    4  *  @brief Semaphore Manager Initialization
    5  *  @ingroup ClassicSem
     4 * @ingroup ClassicSem
     5 *
     6 * @brief Classic Semaphore Information with Zero Objects
    67 */
    78
    89/*
    9  *  COPYRIGHT (c) 1989-2008.
    10  *  On-Line Applications Research Corporation (OAR).
     10 * SPDX-License-Identifier: BSD-2-Clause
    1111 *
    12  *  The license and distribution terms for this file may be
    13  *  found in the file LICENSE in this distribution or at
    14  *  http://www.rtems.org/license/LICENSE.
     12 * Copyright (C) 2018 embedded brains GmbH
     13 *
     14 * Redistribution and use in source and binary forms, with or without
     15 * modification, are permitted provided that the following conditions
     16 * are met:
     17 * 1. Redistributions of source code must retain the above copyright
     18 *    notice, this list of conditions and the following disclaimer.
     19 * 2. Redistributions in binary form must reproduce the above copyright
     20 *    notice, this list of conditions and the following disclaimer in the
     21 *    documentation and/or other materials provided with the distribution.
     22 *
     23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33 * POSSIBILITY OF SUCH DAMAGE.
    1534 */
    1635
     
    1938#endif
    2039
    21 #include <rtems/config.h>
    22 #include <rtems/sysinit.h>
    23 #include <rtems/rtems/semimpl.h>
     40#include <rtems/rtems/semdata.h>
    2441
    25 Objects_Information _Semaphore_Information;
    26 
    27 static void _Semaphore_Manager_initialization(void)
    28 {
    29   _Objects_Initialize_information(
    30     &_Semaphore_Information,     /* object information table */
    31     OBJECTS_CLASSIC_API,         /* object API */
    32     OBJECTS_RTEMS_SEMAPHORES,    /* object class */
    33      Configuration_RTEMS_API.maximum_semaphores,
    34                                  /* maximum objects of this class */
    35     sizeof( Semaphore_Control ), /* size of this object's control block */
    36     OBJECTS_NO_STRING_NAME,      /* maximum length of an object name */
    37     _Semaphore_MP_Send_extract_proxy /* Proxy extraction support callout */
    38   );
    39 
    40   /*
    41    *  Register the MP Process Packet routine.
    42    */
    43 
    44 #if defined(RTEMS_MULTIPROCESSING)
    45   _MPCI_Register_packet_processor(
    46     MP_PACKET_SEMAPHORE,
    47     _Semaphore_MP_Process_packet
    48   );
    49 #endif
    50 
    51 }
    52 
    53 RTEMS_SYSINIT_ITEM(
    54   _Semaphore_Manager_initialization,
    55   RTEMS_SYSINIT_CLASSIC_SEMAPHORE,
    56   RTEMS_SYSINIT_ORDER_MIDDLE
     42OBJECTS_INFORMATION_DEFINE_ZERO(
     43  _Semaphore,
     44  OBJECTS_CLASSIC_API,
     45  OBJECTS_RTEMS_SEMAPHORES,
     46  OBJECTS_NO_STRING_NAME
    5747);
  • cpukit/rtems/src/semcreate.c

    r0f5b2c09 r21275b58  
    2626#include <rtems/score/schedulerimpl.h>
    2727#include <rtems/score/sysstate.h>
     28#include <rtems/sysinit.h>
    2829
    2930#define SEMAPHORE_KIND_MASK ( RTEMS_SEMAPHORE_CLASS | RTEMS_INHERIT_PRIORITY \
     
    255256  return RTEMS_SUCCESSFUL;
    256257}
     258
     259static void _Semaphore_Manager_initialization(void)
     260{
     261  _Objects_Initialize_information( &_Semaphore_Information );
     262
     263#if defined(RTEMS_MULTIPROCESSING)
     264  _MPCI_Register_packet_processor(
     265    MP_PACKET_SEMAPHORE,
     266    _Semaphore_MP_Process_packet
     267  );
     268#endif
     269}
     270
     271RTEMS_SYSINIT_ITEM(
     272  _Semaphore_Manager_initialization,
     273  RTEMS_SYSINIT_CLASSIC_SEMAPHORE,
     274  RTEMS_SYSINIT_ORDER_MIDDLE
     275);
  • cpukit/rtems/src/taskcreate.c

    r0f5b2c09 r21275b58  
    2121#include <rtems/rtems/tasksimpl.h>
    2222#include <rtems/rtems/attrimpl.h>
     23#include <rtems/rtems/eventimpl.h>
    2324#include <rtems/rtems/modesimpl.h>
    2425#include <rtems/rtems/support.h>
     
    2728#include <rtems/score/sysstate.h>
    2829#include <rtems/score/threadimpl.h>
     30#include <rtems/score/userextimpl.h>
     31#include <rtems/sysinit.h>
    2932
    3033rtems_status_code rtems_task_create(
     
    199202  return RTEMS_SUCCESSFUL;
    200203}
     204
     205static void _RTEMS_tasks_Start_extension(
     206  Thread_Control *executing,
     207  Thread_Control *started
     208)
     209{
     210  RTEMS_API_Control *api;
     211
     212  api = started->API_Extensions[ THREAD_API_RTEMS ];
     213
     214  _Event_Initialize( &api->Event );
     215  _Event_Initialize( &api->System_event );
     216}
     217
     218#if defined(RTEMS_MULTIPROCESSING)
     219static void _RTEMS_tasks_Terminate_extension( Thread_Control *executing )
     220{
     221  if ( executing->is_global ) {
     222    _Objects_MP_Close(
     223      &_RTEMS_tasks_Information.Objects,
     224      executing->Object.id
     225    );
     226    _RTEMS_tasks_MP_Send_process_packet(
     227      RTEMS_TASKS_MP_ANNOUNCE_DELETE,
     228      executing->Object.id,
     229      0                                /* Not used */
     230    );
     231  }
     232}
     233#endif
     234
     235static User_extensions_Control _RTEMS_tasks_User_extensions = {
     236  .Callouts = {
     237#if defined(RTEMS_MULTIPROCESSING)
     238    .thread_terminate = _RTEMS_tasks_Terminate_extension,
     239#endif
     240    .thread_start     = _RTEMS_tasks_Start_extension,
     241    .thread_restart   = _RTEMS_tasks_Start_extension
     242  }
     243};
     244
     245static void _RTEMS_tasks_Manager_initialization(void)
     246{
     247  _Thread_Initialize_information( &_RTEMS_tasks_Information );
     248  _User_extensions_Add_API_set( &_RTEMS_tasks_User_extensions );
     249
     250#if defined(RTEMS_MULTIPROCESSING)
     251  _MPCI_Register_packet_processor(
     252    MP_PACKET_TASKS,
     253    _RTEMS_tasks_MP_Process_packet
     254  );
     255#endif
     256}
     257
     258RTEMS_SYSINIT_ITEM(
     259  _RTEMS_tasks_Manager_initialization,
     260  RTEMS_SYSINIT_CLASSIC_TASKS,
     261  RTEMS_SYSINIT_ORDER_MIDDLE
     262);
  • cpukit/rtems/src/tasks.c

    r0f5b2c09 r21275b58  
    1919#endif
    2020
    21 #include <rtems/config.h>
    22 #include <rtems/sysinit.h>
    23 #include <rtems/rtems/eventimpl.h>
    24 #include <rtems/rtems/tasksimpl.h>
    25 #include <rtems/score/threadimpl.h>
    26 #include <rtems/score/userextimpl.h>
     21#include <rtems/rtems/tasksdata.h>
    2722
    28 Thread_Information _RTEMS_tasks_Information;
    29 
    30 static void _RTEMS_tasks_Start_extension(
    31   Thread_Control *executing,
    32   Thread_Control *started
    33 )
    34 {
    35   RTEMS_API_Control *api;
    36 
    37   api = started->API_Extensions[ THREAD_API_RTEMS ];
    38 
    39   _Event_Initialize( &api->Event );
    40   _Event_Initialize( &api->System_event );
    41 }
    42 
    43 #if defined(RTEMS_MULTIPROCESSING)
    44 static void _RTEMS_tasks_Terminate_extension( Thread_Control *executing )
    45 {
    46   if ( executing->is_global ) {
    47     _Objects_MP_Close(
    48       &_RTEMS_tasks_Information.Objects,
    49       executing->Object.id
    50     );
    51     _RTEMS_tasks_MP_Send_process_packet(
    52       RTEMS_TASKS_MP_ANNOUNCE_DELETE,
    53       executing->Object.id,
    54       0                                /* Not used */
    55     );
    56   }
    57 }
    58 #endif
    59 
    60 User_extensions_Control _RTEMS_tasks_User_extensions = {
    61   .Callouts = {
    62 #if defined(RTEMS_MULTIPROCESSING)
    63     .thread_terminate = _RTEMS_tasks_Terminate_extension,
    64 #endif
    65     .thread_start     = _RTEMS_tasks_Start_extension,
    66     .thread_restart   = _RTEMS_tasks_Start_extension
    67   }
    68 };
    69 
    70 static void _RTEMS_tasks_Manager_initialization(void)
    71 {
    72   _Thread_Initialize_information(
    73     &_RTEMS_tasks_Information, /* object information table */
    74     OBJECTS_CLASSIC_API,       /* object API */
    75     OBJECTS_RTEMS_TASKS,       /* object class */
    76     Configuration_RTEMS_API.maximum_tasks
    77                                /* maximum objects of this class */
    78   );
    79 
    80   /*
    81    *  Add all the extensions for this API
    82    */
    83 
    84   _User_extensions_Add_API_set( &_RTEMS_tasks_User_extensions );
    85 
    86   /*
    87    *  Register the MP Process Packet routine.
    88    */
    89 
    90 #if defined(RTEMS_MULTIPROCESSING)
    91   _MPCI_Register_packet_processor(
    92     MP_PACKET_TASKS,
    93     _RTEMS_tasks_MP_Process_packet
    94   );
    95 #endif
    96 
    97 }
    98 
    99 RTEMS_SYSINIT_ITEM(
    100   _RTEMS_tasks_Manager_initialization,
    101   RTEMS_SYSINIT_CLASSIC_TASKS,
    102   RTEMS_SYSINIT_ORDER_MIDDLE
     23THREAD_INFORMATION_DEFINE_ZERO(
     24  _RTEMS_tasks,
     25  OBJECTS_CLASSIC_API,
     26  OBJECTS_RTEMS_TASKS
    10327);
  • cpukit/rtems/src/timercreate.c

    r0f5b2c09 r21275b58  
    2828#include <rtems/score/todimpl.h>
    2929#include <rtems/score/watchdogimpl.h>
     30#include <rtems/sysinit.h>
    3031
    3132RTEMS_STATIC_ASSERT(
     
    3334  TIMER_CLASS_BIT_TIME_OF_DAY
    3435);
     36
     37Timer_server_Control *volatile _Timer_server;
    3538
    3639void _Timer_Routine_adaptor( Watchdog_Control *the_watchdog )
     
    213216  return RTEMS_SUCCESSFUL;
    214217}
     218
     219static void _Timer_Manager_initialization( void )
     220{
     221  _Objects_Initialize_information( &_Timer_Information );
     222}
     223
     224RTEMS_SYSINIT_ITEM(
     225  _Timer_Manager_initialization,
     226  RTEMS_SYSINIT_CLASSIC_TIMER,
     227  RTEMS_SYSINIT_ORDER_MIDDLE
     228);
  • cpukit/sapi/src/extension.c

    r0f5b2c09 r21275b58  
    22 * @file
    33 *
    4  * @brief Initialize Extension Manager
     4 * @ingroup ClassicUserExtensions
    55 *
    6  * @ingroup ClassicUserExtensions
     6 * @brief Extension Manager Information with Zero Objects
    77 */
    88
    99/*
    10  *  Extension Manager
     10 * SPDX-License-Identifier: BSD-2-Clause
    1111 *
    12  *  COPYRIGHT (c) 1989-2008.
    13  *  On-Line Applications Research Corporation (OAR).
     12 * Copyright (C) 2018 embedded brains GmbH
    1413 *
    15  *  The license and distribution terms for this file may be
    16  *  found in the file LICENSE in this distribution or at
    17  *  http://www.rtems.org/license/LICENSE.
     14 * Redistribution and use in source and binary forms, with or without
     15 * modification, are permitted provided that the following conditions
     16 * are met:
     17 * 1. Redistributions of source code must retain the above copyright
     18 *    notice, this list of conditions and the following disclaimer.
     19 * 2. Redistributions in binary form must reproduce the above copyright
     20 *    notice, this list of conditions and the following disclaimer in the
     21 *    documentation and/or other materials provided with the distribution.
     22 *
     23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33 * POSSIBILITY OF SUCH DAMAGE.
    1834 */
    1935
     
    2238#endif
    2339
    24 #include <rtems/extensionimpl.h>
    25 #include <rtems/config.h>
    26 #include <rtems/sysinit.h>
     40#include <rtems/extensiondata.h>
    2741
    28 Objects_Information _Extension_Information;
    29 
    30 static void _Extension_Manager_initialization(void)
    31 {
    32   _Objects_Initialize_information(
    33     &_Extension_Information,
    34     OBJECTS_CLASSIC_API,                 /* object API */
    35     OBJECTS_RTEMS_EXTENSIONS,
    36     Configuration.maximum_extensions,
    37     sizeof( Extension_Control ),
    38     OBJECTS_NO_STRING_NAME,    /* maximum length of an object name */
    39     NULL                       /* Proxy extraction support callout */
    40   );
    41 }
    42 
    43 RTEMS_SYSINIT_ITEM(
    44   _Extension_Manager_initialization,
    45   RTEMS_SYSINIT_USER_EXTENSIONS,
    46   RTEMS_SYSINIT_ORDER_MIDDLE
     42OBJECTS_INFORMATION_DEFINE_ZERO(
     43  _Extension,
     44  OBJECTS_CLASSIC_API,
     45  OBJECTS_RTEMS_EXTENSIONS,
     46  OBJECTS_NO_STRING_NAME
    4747);
  • cpukit/sapi/src/extensioncreate.c

    r0f5b2c09 r21275b58  
    2020#endif
    2121
    22 #include <rtems/system.h>
     22#include <rtems/extensionimpl.h>
    2323#include <rtems/rtems/support.h>
    24 #include <rtems/score/thread.h>
    2524#include <rtems/score/userextimpl.h>
    26 #include <rtems/extensionimpl.h>
     25#include <rtems/sysinit.h>
    2726
    2827rtems_status_code rtems_extension_create(
     
    5958  return RTEMS_SUCCESSFUL;
    6059}
     60
     61static void _Extension_Manager_initialization( void )
     62{
     63  _Objects_Initialize_information( &_Extension_Information);
     64}
     65
     66RTEMS_SYSINIT_ITEM(
     67  _Extension_Manager_initialization,
     68  RTEMS_SYSINIT_USER_EXTENSIONS,
     69  RTEMS_SYSINIT_ORDER_MIDDLE
     70);
  • cpukit/score/src/freechain.c

    r0f5b2c09 r21275b58  
    2121#include <rtems/score/freechain.h>
    2222#include <rtems/score/assert.h>
    23 #include <rtems/score/chainimpl.h>
    24 
    25 void _Freechain_Initialize(
    26   Freechain_Control   *freechain,
    27   Freechain_Allocator  allocator,
    28   size_t               number_nodes,
    29   size_t               node_size
    30 )
    31 {
    32   void *starting_address;
    33 
    34   if ( number_nodes > 0 ) {
    35     starting_address = ( *allocator )( number_nodes * node_size );
    36     number_nodes *= ( starting_address != NULL );
    37   } else {
    38     starting_address = NULL;
    39   }
    40 
    41   _Chain_Initialize(
    42     &freechain->Free,
    43     starting_address,
    44     number_nodes,
    45     node_size
    46   );
    47 }
    4823
    4924void *_Freechain_Get(
  • cpukit/score/src/mpci.c

    r0f5b2c09 r21275b58  
    147147  name.name_u32 = _Objects_Build_name( 'M', 'P', 'C', 'I' );
    148148  _Thread_Initialize(
    149     &_Thread_Internal_information,
     149    &_Thread_Information,
    150150    _MPCI_Receive_server_tcb,
    151151    &_Scheduler_Table[ 0 ],
  • cpukit/score/src/objectallocate.c

    r0f5b2c09 r21275b58  
    6969
    7070    if ( the_object != NULL ) {
     71      Objects_Maximum objects_per_block;
    7172      Objects_Maximum block;
    7273
     74      objects_per_block = information->objects_per_block;
    7375      block = _Objects_Get_index( the_object->id ) - OBJECTS_INDEX_MINIMUM;
    74       block /= information->objects_per_block;
    7576
    76       information->inactive_per_block[ block ]--;
    77       information->inactive--;
     77      if ( block > objects_per_block ) {
     78        block /= objects_per_block;
     79
     80        information->inactive_per_block[ block ]--;
     81        information->inactive--;
     82      }
    7883    }
    7984  }
  • cpukit/score/src/objectextendinformation.c

    r0f5b2c09 r21275b58  
    6262      || !_System_state_Is_up( _System_state_Get() )
    6363  );
    64 
     64  _Assert( _Objects_Is_auto_extend( information ) );
     65
     66  extend_count = _Objects_Extend_size( information );
     67  old_maximum = _Objects_Get_maximum_index( information );
     68  new_maximum = (uint32_t) old_maximum + extend_count;
    6569  api_class_and_node = information->maximum_id & ~OBJECTS_INDEX_MASK;
    6670
     
    7074   */
    7175  do_extend     = true;
    72   index_base    = 0;
    73   block         = 0;
     76  index_base    = extend_count;
     77  block         = 1;
    7478
    7579  if ( information->object_blocks == NULL ) {
    76     extend_count = _Objects_Get_maximum_index( information );
    77     old_maximum = 0;
    78     block_count = 0;
     80    block_count = 1;
    7981  } else {
    80     extend_count = information->objects_per_block;
    81     old_maximum = _Objects_Get_maximum_index( information );
    8282    block_count = old_maximum / extend_count;
    8383
     
    9191  }
    9292
    93   new_maximum = (uint32_t) old_maximum + extend_count;
    9493  index_end = index_base + extend_count;
    9594
     
    108107   */
    109108  object_block_size = extend_count * information->object_size;
    110   if ( _Objects_Is_auto_extend( information ) ) {
    111     new_object_block = _Workspace_Allocate( object_block_size );
    112     if ( !new_object_block )
    113       return;
    114   } else {
    115     new_object_block = _Workspace_Allocate_or_fatal_error( object_block_size );
     109  new_object_block = _Workspace_Allocate( object_block_size );
     110  if ( new_object_block == NULL ) {
     111    return;
    116112  }
    117113
     
    159155      + local_table_size
    160156      + block_count * sizeof( *inactive_per_block );
    161     if ( _Objects_Is_auto_extend( information ) ) {
    162       object_blocks = _Workspace_Allocate( table_size );
    163       if ( !object_blocks ) {
    164         _Workspace_Free( new_object_block );
    165         return;
    166       }
    167     } else {
    168       object_blocks = _Workspace_Allocate_or_fatal_error( table_size );
     157    object_blocks = _Workspace_Allocate( table_size );
     158    if ( object_blocks == NULL ) {
     159      _Workspace_Free( new_object_block );
     160      return;
    169161    }
    170162
     
    187179    block_count--;
    188180
    189     if ( old_maximum > 0 ) {
     181    if ( old_maximum > extend_count ) {
    190182      /*
    191183       *  Copy each section of the table over. This has to be performed as
     
    202194        block_count * sizeof( *inactive_per_block )
    203195      );
    204       memcpy(
    205         local_table,
    206         information->local_table,
    207         old_maximum * sizeof( *local_table )
    208       );
    209     }
     196    } else {
     197      object_blocks[ 0 ] = NULL;
     198      inactive_per_block[ 0 ] = 0;
     199    }
     200
     201    memcpy(
     202      local_table,
     203      information->local_table,
     204      old_maximum * sizeof( *local_table )
     205    );
    210206
    211207    /*
  • cpukit/score/src/objectfree.c

    r0f5b2c09 r21275b58  
    3939    objects_per_block = information->objects_per_block;
    4040    block = _Objects_Get_index( the_object->id ) - OBJECTS_INDEX_MINIMUM;
    41     block /= objects_per_block;
    4241
    43     ++information->inactive_per_block[ block ];
     42    if ( block > objects_per_block ) {
     43      block /= objects_per_block;
    4444
    45     inactive = information->inactive;
    46     ++inactive;
    47     information->inactive = inactive;
     45      ++information->inactive_per_block[ block ];
    4846
    49     /*
    50      *  Check if the threshold level has been met of
    51      *  1.5 x objects_per_block are free.
    52      */
     47      inactive = information->inactive;
     48      ++inactive;
     49      information->inactive = inactive;
    5350
    54     if ( inactive > ( objects_per_block + ( objects_per_block >> 1 ) ) ) {
    55       _Objects_Shrink_information( information );
     51      /*
     52       *  Check if the threshold level has been met of
     53       *  1.5 x objects_per_block are free.
     54       */
     55
     56      if ( inactive > ( objects_per_block + ( objects_per_block >> 1 ) ) ) {
     57        _Objects_Shrink_information( information );
     58      }
    5659    }
    5760  }
  • cpukit/score/src/objectinitializeinformation.c

    r0f5b2c09 r21275b58  
    2525#include <rtems/score/wkspace.h>
    2626
    27 void _Objects_Do_initialize_information(
    28   Objects_Information *information,
    29   Objects_APIs         the_api,
    30   uint16_t             the_class,
    31   uint32_t             maximum,
    32   uint16_t             object_size,
    33   uint16_t             maximum_name_length
    34 #if defined(RTEMS_MULTIPROCESSING)
    35   ,
    36   Objects_Thread_queue_Extract_callout extract
    37 #endif
     27void _Objects_Initialize_information(
     28  Objects_Information *information
    3829)
    3930{
    40   Objects_Maximum maximum_per_allocation;
     31  Objects_Id       maximum_id;
     32  Objects_Id       api_class_and_node;
     33  Objects_Maximum  maximum;
     34  Objects_Maximum  index;
     35  Chain_Node      *head;
     36  Chain_Node      *tail;
     37  Chain_Node      *current;
     38  Objects_Control *next;
    4139
    42   maximum_per_allocation = _Objects_Maximum_per_allocation( maximum );
    43   information->maximum_id = _Objects_Build_id(
    44     the_api,
    45     the_class,
    46     _Objects_Local_node,
    47     maximum_per_allocation
    48   );
    49   information->object_size = object_size;
     40  maximum_id = information->maximum_id;
     41
     42#if defined(RTEMS_MULTIPROCESSING)
     43  maximum_id |= _Objects_Local_node << OBJECTS_NODE_START_BIT;
     44  information->maximum_id = maximum_id;
     45#endif
     46
     47  maximum = _Objects_Get_index( maximum_id );
     48  api_class_and_node = maximum_id & ~OBJECTS_INDEX_MASK;
    5049
    5150  /*
    5251   *  Register this Object Class in the Object Information Table.
    5352   */
    54   _Objects_Information_table[ the_api ][ the_class ] = information;
     53  _Objects_Information_table[ _Objects_Get_API( maximum_id ) ]
     54    [ _Objects_Get_class( maximum_id ) ] = information;
    5555
    56   /*
    57    *  Are we operating in limited or unlimited (e.g. auto-extend) mode.
    58    */
    59   if ( _Objects_Is_unlimited( maximum ) ) {
    60     /*
    61      *  Unlimited and maximum of zero is illogical.
    62      */
    63     if ( maximum_per_allocation == 0) {
    64       _Internal_error( INTERNAL_ERROR_UNLIMITED_AND_MAXIMUM_IS_0 );
    65     }
     56  head = _Chain_Head( &information->Inactive );
     57  tail = _Chain_Tail( &information->Inactive );
     58  current = head;
     59  next = information->initial_objects;
    6660
    67     /*
    68      *  The allocation unit is the maximum value
    69      */
    70     information->objects_per_block = maximum_per_allocation;
     61  head->previous = NULL;
     62
     63  for ( index = OBJECTS_INDEX_MINIMUM; index <= maximum ; ++index ) {
     64    current->next = &next->Node;
     65    next->Node.previous = current;
     66    current = &next->Node;
     67    next->id = api_class_and_node | ( index << OBJECTS_INDEX_START_BIT );
     68    next = _Addresses_Add_offset( next, information->object_size );
    7169  }
    7270
    73 
    74   /*
    75    *  Calculate the maximum name length
    76    *
    77    *  NOTE: Either 4 bytes for Classic API names or an arbitrary
    78    *        number for POSIX names which are strings that may be
    79    *        an odd number of bytes.
    80    */
    81 
    82   information->name_length = maximum_name_length;
    83 
    84   _Chain_Initialize_empty( &information->Inactive );
    85 
    86   /*
    87    *  Initialize objects .. if there are any
    88    */
    89   if ( maximum_per_allocation ) {
    90     /*
    91      *  Always have the maximum size available so the current performance
    92      *  figures are create are met.  If the user moves past the maximum
    93      *  number then a performance hit is taken.
    94      */
    95     _Objects_Extend_information( information );
    96   }
    97 
    98   /*
    99    *  Take care of multiprocessing
    100    */
    101   #if defined(RTEMS_MULTIPROCESSING)
    102     information->extract = extract;
    103     _RBTree_Initialize_empty( &information->Global_by_id );
    104     _RBTree_Initialize_empty( &information->Global_by_name );
    105   #endif
     71  current->next = tail;
     72  tail->previous = current;
    10673}
  • cpukit/score/src/objectshrinkinformation.c

    r0f5b2c09 r21275b58  
    3434
    3535  _Assert( _Objects_Allocator_is_owner() );
     36  _Assert( _Objects_Is_auto_extend( information ) );
    3637
    3738  /*
     
    4142  objects_per_block = information->objects_per_block;
    4243  block_count = _Objects_Get_maximum_index( information ) / objects_per_block;
    43   index_base = 0;
     44  index_base = objects_per_block;
    4445
    45   for ( block = 0; block < block_count; block++ ) {
     46  for ( block = 1; block < block_count; block++ ) {
    4647    if ( information->inactive_per_block[ block ] == objects_per_block ) {
    4748      Chain_Node       *node;
  • cpukit/score/src/thread.c

    r0f5b2c09 r21275b58  
    2121#include <rtems/score/threadimpl.h>
    2222#include <rtems/score/interr.h>
     23#include <rtems/score/objectimpl.h>
    2324#include <rtems/score/scheduler.h>
    2425#include <rtems/score/wkspace.h>
     
    4445#endif
    4546
    46 Thread_Information _Thread_Internal_information;
    47 
    48 void _Thread_Initialize_information(
    49   Thread_Information  *information,
    50   Objects_APIs         the_api,
    51   uint16_t             the_class,
    52   uint32_t             maximum
    53 )
     47void _Thread_Initialize_information( Thread_Information *information )
    5448{
    55   _Objects_Initialize_information(
    56     &information->Objects,
    57     the_api,
    58     the_class,
    59     maximum,
    60     _Thread_Control_size,
    61     OBJECTS_NO_STRING_NAME,
    62     NULL
    63   );
     49  _Objects_Initialize_information( &information->Objects );
    6450
    6551  _Freechain_Initialize(
    66     &information->Free_thread_queue_heads,
    67     _Workspace_Allocate_or_fatal_error,
    68     _Objects_Maximum_per_allocation( maximum ),
    69     THREAD_QUEUE_HEADS_SIZE( _Scheduler_Count )
     52    &information->Thread_queue_heads.Free,
     53    information->Thread_queue_heads.initial,
     54    _Objects_Get_maximum_index( &information->Objects ),
     55    _Thread_queue_Heads_size
    7056  );
    7157}
     
    9682   *  coupled multiprocessing system, account for the MPCI Server Thread.
    9783   */
    98   _Thread_Initialize_information(
    99     &_Thread_Internal_information,
    100     OBJECTS_INTERNAL_API,
    101     OBJECTS_INTERNAL_THREADS,
    102     _Thread_Get_maximum_internal_threads()
    103   );
    104 
     84  _Thread_Initialize_information( &_Thread_Information );
    10585}
  • cpukit/score/src/threadcreateidle.c

    r0f5b2c09 r21275b58  
    5252
    5353  _Thread_Initialize(
    54     &_Thread_Internal_information,
     54    &_Thread_Information,
    5555    idle,
    5656    scheduler,
  • cpukit/score/src/threadinitialize.c

    r0f5b2c09 r21275b58  
    146146   */
    147147  the_thread->Wait.spare_heads = _Freechain_Get(
    148     &information->Free_thread_queue_heads,
     148    &information->Thread_queue_heads.Free,
    149149    _Workspace_Allocate,
    150150    _Objects_Extend_size( &information->Objects ),
    151     THREAD_QUEUE_HEADS_SIZE( _Scheduler_Count )
     151    _Thread_queue_Heads_size
    152152  );
    153153  if ( the_thread->Wait.spare_heads == NULL ) {
     
    309309
    310310  _Freechain_Put(
    311     &information->Free_thread_queue_heads,
     311    &information->Thread_queue_heads.Free,
    312312    the_thread->Wait.spare_heads
    313313  );
  • cpukit/score/src/threadmp.c

    r0f5b2c09 r21275b58  
    5555  }
    5656
    57   proxy_size = sizeof( Thread_Proxy_control )
    58     + THREAD_QUEUE_HEADS_SIZE( _Scheduler_Count );
     57  proxy_size = sizeof( Thread_Proxy_control ) + _Thread_queue_Heads_size;
    5958  alloc_size = maximum_proxies * proxy_size;
    6059  proxies = _Workspace_Allocate_or_fatal_error( alloc_size );
  • cpukit/score/src/threadrestart.c

    r0f5b2c09 r21275b58  
    177177
    178178  _Freechain_Put(
    179     &information->Free_thread_queue_heads,
     179    &information->Thread_queue_heads.Free,
    180180    the_thread->Wait.spare_heads
    181181  );
  • cpukit/score/src/wkspace.c

    r0f5b2c09 r21275b58  
    4242
    4343Heap_Control _Workspace_Area;
    44 
    45 static uint32_t _Workspace_Get_maximum_thread_count( void )
    46 {
    47   uint32_t thread_count;
    48 
    49   thread_count = 0;
    50   thread_count += _Thread_Get_maximum_internal_threads();
    51 
    52   thread_count += rtems_resource_maximum_per_allocation(
    53     Configuration_RTEMS_API.maximum_tasks
    54   );
    55 
    56   thread_count += rtems_resource_maximum_per_allocation(
    57     _Configuration_POSIX_Maximum_threads
    58   );
    59 
    60   return thread_count;
    61 }
    6244
    6345static uintptr_t _Workspace_Space_for_TLS( uintptr_t page_size )
     
    8769    space = _Heap_Min_block_size( page_size );
    8870
    89     space += _Workspace_Get_maximum_thread_count()
     71    space += _Thread_Initial_thread_count
    9072      * _Heap_Size_with_overhead( page_size, tls_alloc, tls_align );
    9173  } else {
  • testsuites/psxtests/psxobj01/init.c

    r0f5b2c09 r21275b58  
    2323const char rtems_test_name[] = "PSXOBJ 1";
    2424
    25 /* forward declarations to avoid warnings */
    26 rtems_task Init(rtems_task_argument ignored);
     25typedef struct {
     26  Objects_Control Object;
     27} Test_Control;
    2728
    28 rtems_task Init(
     29/* very fake object class to test with */
     30OBJECTS_INFORMATION_DEFINE( Test, 1, 4, Test_Control, 0, 10, NULL );
     31
     32static rtems_task Init(
    2933  rtems_task_argument ignored
    3034)
    3135{
    3236  Objects_Get_by_name_error  error;
    33   Objects_Information        TestClass;
    3437  Objects_Control           *the_object;
    3538  char                       name[64];
     
    3942  TEST_BEGIN();
    4043
    41   /* very fake object class to test with */
    42   _Objects_Initialize_information(
    43     &TestClass,
    44     1,           /* the_api */
    45     4,           /* the_class */
    46     0,           /* maximum */
    47     4,           /* size */
    48     10,          /* maximum_name_length */
    49     NULL         /* Objects_Thread_queue_Extract_callout extract */
    50   );
    51 
    52 
    5344  puts( "INIT - _Objects_Get_by_name - NULL name" );
    5445  _Objects_Allocator_lock();
    55   the_object = _Objects_Get_by_name( &TestClass, NULL, NULL, &error );
     46  the_object = _Objects_Get_by_name( &Test_Information, NULL, NULL, &error );
    5647  _Objects_Allocator_unlock();
    5748  rtems_test_assert( the_object == NULL );
     
    6152  strcpy( name, "TOOOOOOOOOOOOOOOOOO LONG" );
    6253  _Objects_Allocator_lock();
    63   the_object = _Objects_Get_by_name( &TestClass, name, NULL, &error );
     54  the_object = _Objects_Get_by_name( &Test_Information, name, NULL, &error );
    6455  _Objects_Allocator_unlock();
    6556  rtems_test_assert( the_object == NULL );
     
    7061  name_len = 123;
    7162  _Objects_Allocator_lock();
    72   the_object = _Objects_Get_by_name( &TestClass, name, &name_len, &error );
     63  the_object = _Objects_Get_by_name( &Test_Information, name, &name_len, &error );
    7364  _Objects_Allocator_unlock();
    7465  rtems_test_assert( the_object == NULL );
     
    8071  rtems_workspace_greedy_allocate( NULL, 0 );
    8172
    82   bc = _Objects_Set_name( &TestClass, &_Thread_Get_executing()->Object, name );
     73  bc = _Objects_Set_name(
     74    &Test_Information,
     75    &_Thread_Get_executing()->Object,
     76    name
     77  );
    8378  rtems_test_assert( bc == false );
    8479
  • testsuites/sptests/Makefile.am

    r0f5b2c09 r21275b58  
    984984spfatal12_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal12) \
    985985        $(support_includes) -I$(top_srcdir)/spfatal12
    986 endif
    987 
    988 if TEST_spfatal13
    989 sp_tests += spfatal13
    990 sp_screens += spfatal13/spfatal13.scn
    991 sp_docs += spfatal13/spfatal13.doc
    992 spfatal13_SOURCES = spfatal_support/init.c spfatal_support/system.h \
    993         spfatal13/testcase.h
    994 spfatal13_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal13) \
    995         $(support_includes) -I$(top_srcdir)/spfatal13
    996986endif
    997987
  • testsuites/sptests/configure.ac

    r0f5b2c09 r21275b58  
    147147RTEMS_TEST_CHECK([spfatal11])
    148148RTEMS_TEST_CHECK([spfatal12])
    149 RTEMS_TEST_CHECK([spfatal13])
    150149RTEMS_TEST_CHECK([spfatal14])
    151150RTEMS_TEST_CHECK([spfatal15])
  • testsuites/sptests/spfreechain01/init.c

    r0f5b2c09 r21275b58  
    2626    Freechain_Control fc;
    2727    test_node *node;
     28    test_node node2;
    2829
    2930    TEST_BEGIN();
    3031
     32    _Freechain_Initialize(&fc, &node2, 1, sizeof(node2));
     33    rtems_test_assert(_Chain_Node_count_unprotected(&fc.Free) == 1);
     34    rtems_test_assert(_Chain_First(&fc.Free) == &node2.Node);
     35    rtems_test_assert(_Chain_Last(&fc.Free) == &node2.Node);
     36
    3137    _Freechain_Initialize(&fc, NULL, 0, sizeof(test_node));
    32     rtems_test_assert(_Chain_Is_empty(&fc.Free));
    33 
    34     _Freechain_Initialize(&fc, malloc, 1, SIZE_MAX);
    3538    rtems_test_assert(_Chain_Is_empty(&fc.Free));
    3639
  • testsuites/sptests/spsimplesched02/init.c

    r0f5b2c09 r21275b58  
    8282
    8383  status = _Objects_Name_to_id_u32(
    84     &_Thread_Internal_information.Objects,
     84    &_Thread_Information.Objects,
    8585    rtems_build_name( 'I', 'D', 'L', 'E' ),
    8686    RTEMS_SEARCH_LOCAL_NODE,
  • testsuites/sptests/spsize/size.c

    r0f5b2c09 r21275b58  
    369369                (sizeof _Thread_Allocated_fp)             +
    370370#endif
    371                 (sizeof _Thread_Internal_information)     +
     371                (sizeof _Thread_Information)     +
    372372
    373373/*threadq.h*/
  • testsuites/sptests/spsysinit01/init.c

    r0f5b2c09 r21275b58  
    2020
    2121#include <sys/types.h>
     22#include <sys/mman.h>
    2223#include <sys/stat.h>
    2324
    2425#include <assert.h>
     26#include <fcntl.h>
     27#include <mqueue.h>
    2528#include <pthread.h>
     29#include <semaphore.h>
     30#include <signal.h>
     31#include <stdlib.h>
    2632#include <string.h>
    27 #include <stdlib.h>
     33#include <time.h>
    2834#include <unistd.h>
    2935
     
    189195}
    190196
     197static bool info_not_init(const Objects_Information *info)
     198{
     199  return _Chain_Is_empty(&info->Inactive);
     200}
     201
     202static bool info_is_init(const Objects_Information *info, size_t count)
     203{
     204  return _Chain_Node_count_unprotected(&info->Inactive) == count;
     205}
     206
    191207FIRST(RTEMS_SYSINIT_BSP_WORK_AREAS)
    192208{
     
    249265FIRST(RTEMS_SYSINIT_DATA_STRUCTURES)
    250266{
    251   assert(
    252     _Objects_Get_maximum_index(&_Thread_Internal_information.Objects) == 0
    253   );
     267  assert(info_not_init(&_Thread_Information.Objects));
    254268  next_step(DATA_STRUCTURES_PRE);
    255269}
     
    257271LAST(RTEMS_SYSINIT_DATA_STRUCTURES)
    258272{
    259   assert(
    260     _Objects_Get_maximum_index(&_Thread_Internal_information.Objects) != 0
    261   );
     273  assert(info_is_init(&_Thread_Information.Objects, 1));
    262274  next_step(DATA_STRUCTURES_POST);
    263275}
     
    265277FIRST(RTEMS_SYSINIT_USER_EXTENSIONS)
    266278{
    267   assert(_Objects_Get_maximum_index(&_Extension_Information) == 0);
     279  assert(info_not_init(&_Extension_Information));
    268280  next_step(USER_EXTENSIONS_PRE);
    269281}
     
    271283LAST(RTEMS_SYSINIT_USER_EXTENSIONS)
    272284{
    273   assert(_Objects_Get_maximum_index(&_Extension_Information) != 0);
     285  assert(info_is_init(&_Extension_Information, 1));
    274286  next_step(USER_EXTENSIONS_POST);
    275287}
     
    277289FIRST(RTEMS_SYSINIT_CLASSIC_TASKS)
    278290{
    279   assert(_Objects_Get_maximum_index(&_RTEMS_tasks_Information.Objects) == 0);
     291  assert(info_not_init(&_RTEMS_tasks_Information.Objects));
    280292  next_step(CLASSIC_TASKS_PRE);
    281293}
     
    283295LAST(RTEMS_SYSINIT_CLASSIC_TASKS)
    284296{
    285   assert(_Objects_Get_maximum_index(&_RTEMS_tasks_Information.Objects) != 0);
     297  assert(info_is_init(&_RTEMS_tasks_Information.Objects, 2));
    286298  next_step(CLASSIC_TASKS_POST);
    287299}
     
    289301FIRST(RTEMS_SYSINIT_CLASSIC_TIMER)
    290302{
    291   assert(_Objects_Get_maximum_index(&_Timer_Information) == 0);
     303  assert(info_not_init(&_Timer_Information));
    292304  next_step(CLASSIC_TIMER_PRE);
    293305}
     
    295307LAST(RTEMS_SYSINIT_CLASSIC_TIMER)
    296308{
    297   assert(_Objects_Get_maximum_index(&_Timer_Information) != 0);
     309  assert(info_is_init(&_Timer_Information, 1));
    298310  next_step(CLASSIC_TIMER_POST);
    299311}
     
    323335FIRST(RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE)
    324336{
    325   assert(_Objects_Get_maximum_index(&_Message_queue_Information) == 0);
     337  assert(info_not_init(&_Message_queue_Information));
    326338  next_step(CLASSIC_MESSAGE_QUEUE_PRE);
    327339}
     
    329341LAST(RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE)
    330342{
    331   assert(_Objects_Get_maximum_index(&_Message_queue_Information) != 0);
     343  assert(info_is_init(&_Message_queue_Information, 1));
    332344  next_step(CLASSIC_MESSAGE_QUEUE_POST);
    333345}
     
    335347FIRST(RTEMS_SYSINIT_CLASSIC_SEMAPHORE)
    336348{
    337   assert(_Objects_Get_maximum_index(&_Semaphore_Information) == 0);
     349  assert(_Semaphore_Information.initial_objects[0].id == 0);
    338350  next_step(CLASSIC_SEMAPHORE_PRE);
    339351}
     
    341353LAST(RTEMS_SYSINIT_CLASSIC_SEMAPHORE)
    342354{
    343   assert(_Objects_Get_maximum_index(&_Semaphore_Information) != 0);
     355  assert(_Semaphore_Information.initial_objects[0].id != 0);
    344356  next_step(CLASSIC_SEMAPHORE_POST);
    345357}
     
    347359FIRST(RTEMS_SYSINIT_CLASSIC_PARTITION)
    348360{
    349   assert(_Objects_Get_maximum_index(&_Partition_Information) == 0);
     361  assert(info_not_init(&_Partition_Information));
    350362  next_step(CLASSIC_PARTITION_PRE);
    351363}
     
    353365LAST(RTEMS_SYSINIT_CLASSIC_PARTITION)
    354366{
    355   assert(_Objects_Get_maximum_index(&_Partition_Information) != 0);
     367  assert(info_is_init(&_Partition_Information, 1));
    356368  next_step(CLASSIC_PARTITION_POST);
    357369}
     
    359371FIRST(RTEMS_SYSINIT_CLASSIC_REGION)
    360372{
    361   assert(_Objects_Get_maximum_index(&_Region_Information) == 0);
     373  assert(info_not_init(&_Region_Information));
    362374  next_step(CLASSIC_REGION_PRE);
    363375}
     
    365377LAST(RTEMS_SYSINIT_CLASSIC_REGION)
    366378{
    367   assert(_Objects_Get_maximum_index(&_Region_Information) != 0);
     379  assert(info_is_init(&_Region_Information, 1));
    368380  next_step(CLASSIC_REGION_POST);
    369381}
     
    371383FIRST(RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY)
    372384{
    373   assert(_Objects_Get_maximum_index(&_Dual_ported_memory_Information) == 0);
     385  assert(info_not_init(&_Dual_ported_memory_Information));
    374386  next_step(CLASSIC_DUAL_PORTED_MEMORY_PRE);
    375387}
     
    377389LAST(RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY)
    378390{
    379   assert(_Objects_Get_maximum_index(&_Dual_ported_memory_Information) != 0);
     391  assert(info_is_init(&_Dual_ported_memory_Information, 1));
    380392  next_step(CLASSIC_DUAL_PORTED_MEMORY_POST);
    381393}
     
    383395FIRST(RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC)
    384396{