Changeset d252e20a in rtems


Ignore:
Timestamp:
Dec 10, 2019, 10:13:18 AM (4 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
3f732f0
Parents:
fc32904
git-author:
Sebastian Huber <sebastian.huber@…> (12/10/19 10:13:18)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/12/20 08:08:41)
Message:

score: Simplify _Thread_Initialize()

Allocate new thread queue heads during objects information extend. This
removes an error case and the last dependency on the workspace in
_Thread_Initialize().

Update #3835.

Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/Makefile.am

    rfc32904 rd252e20a  
    946946librtemscpu_a_SOURCES += score/src/rbtreepostorder.c
    947947librtemscpu_a_SOURCES += score/src/rbtreereplace.c
     948librtemscpu_a_SOURCES += score/src/threadallocateunlimited.c
    948949librtemscpu_a_SOURCES += score/src/thread.c
    949950librtemscpu_a_SOURCES += score/src/threadchangepriority.c
  • cpukit/include/rtems/score/thread.h

    rfc32904 rd252e20a  
    10401040}
    10411041
     1042/**
     1043 * @brief Return an inactive thread object or NULL.
     1044 *
     1045 * @retval NULL No inactive object is available.
     1046 * @retval object An inactive object.
     1047 */
     1048Objects_Control *_Thread_Allocate_unlimited( Objects_Information *information );
     1049
    10421050#define THREAD_INFORMATION_DEFINE( name, api, cls, max ) \
    10431051static Objects_Control * \
     
    10521060    name##_Local_table, \
    10531061    _Objects_Is_unlimited( max ) ? \
    1054       _Objects_Allocate_unlimited : _Objects_Allocate_static, \
     1062      _Thread_Allocate_unlimited : _Objects_Allocate_static, \
    10551063    _Objects_Is_unlimited( max ) ? \
    10561064      _Objects_Free_unlimited : _Objects_Free_static, \
  • cpukit/score/src/threadinitialize.c

    rfc32904 rd252e20a  
    2525#include <rtems/score/userextimpl.h>
    2626#include <rtems/score/watchdogimpl.h>
    27 #include <rtems/score/wkspace.h>
    2827#include <rtems/config.h>
    2928
     
    116115   *  Get thread queue heads
    117116   */
    118   the_thread->Wait.spare_heads = _Freechain_Get(
    119     &information->Thread_queue_heads.Free,
    120     _Workspace_Allocate,
    121     _Objects_Extend_size( &information->Objects ),
    122     _Thread_queue_Heads_size
    123   );
    124   if ( the_thread->Wait.spare_heads == NULL ) {
    125     goto failed;
    126   }
     117  the_thread->Wait.spare_heads = _Freechain_Pop(
     118    &information->Thread_queue_heads.Free
     119  );
    127120  _Thread_queue_Heads_initialize( the_thread->Wait.spare_heads );
    128121
  • testsuites/samples/unlimited/test1.c

    rfc32904 rd252e20a  
    5252  objects_per_block = the_information->objects_per_block;
    5353  the_information->objects_per_block = 0;
     54  the_information->allocate = _Objects_Allocate_static;
    5455
    5556  while (task_count < MAX_TASKS)
     
    103104
    104105  the_information->objects_per_block = objects_per_block;
     106  the_information->allocate = _Thread_Allocate_unlimited;
    105107
    106108  printf( " TEST1 : completed\n" );
Note: See TracChangeset for help on using the changeset viewer.