Changeset 54f35888 in rtems for cpukit/posix


Ignore:
Timestamp:
Oct 25, 2018, 8:54:12 AM (14 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
ef16a11
Parents:
033f31c8
git-author:
Sebastian Huber <sebastian.huber@…> (10/25/18 08:54:12)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/29/18 09:52:45)
Message:

posix: Provide threads by default

Update #2514.

Location:
cpukit/posix/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/src/psxtransschedparam.c

    r033f31c8 r54f35888  
    3131    case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE:
    3232      return SCHED_OTHER;
    33 #if defined(RTEMS_POSIX_API)
    3433    case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE:
    3534      return SCHED_RR;
    36 #endif
    3735    case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
    3836      return SCHED_SPORADIC;
     
    6361  }
    6462
    65 #if defined(RTEMS_POSIX_API)
    6663  if ( policy == SCHED_RR ) {
    6764    *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE;
    6865    return 0;
    6966  }
    70 #endif
    7167
     68#if defined(RTEMS_POSIX_API)
    7269  if ( policy == SCHED_SPORADIC ) {
    7370    if ( (param->sched_ss_repl_period.tv_sec == 0) &&
     
    8784    return 0;
    8885  }
     86#endif
    8987
    9088  return EINVAL;
  • cpukit/posix/src/pthread.c

    r033f31c8 r54f35888  
    3535#include <rtems/posix/pthreadimpl.h>
    3636#include <rtems/posix/priorityimpl.h>
     37#if defined(RTEMS_POSIX_API)
    3738#include <rtems/posix/psignalimpl.h>
     39#endif
    3840#include <rtems/posix/config.h>
    3941#include <rtems/posix/keyimpl.h>
     
    4345Thread_Information _POSIX_Threads_Information;
    4446
     47#if defined(RTEMS_POSIX_API)
    4548void _POSIX_Threads_Sporadic_timer( Watchdog_Control *watchdog )
    4649{
     
    145148  _Thread_State_release( executing, &lock_context );
    146149}
     150#endif
    147151
    148152/*
     
    165169User_extensions_Control _POSIX_Threads_User_extensions = {
    166170  .Callouts = {
     171#if defined(RTEMS_POSIX_API)
    167172    .thread_create    = _POSIX_Threads_Create_extension,
    168     .thread_exitted   = _POSIX_Threads_Exitted_extension,
    169     .thread_terminate = _POSIX_Threads_Terminate_extension
     173    .thread_terminate = _POSIX_Threads_Terminate_extension,
     174#endif
     175    .thread_exitted   = _POSIX_Threads_Exitted_extension
    170176  }
    171177};
  • cpukit/posix/src/pthreadcreate.c

    r033f31c8 r54f35888  
    6363  const pthread_attr_t               *the_attr;
    6464  int                                 normal_prio;
    65   int                                 low_prio;
    6665  bool                                valid;
    6766  Priority_Control                    core_normal_prio;
    68   Priority_Control                    core_low_prio;
    6967  Thread_CPU_budget_algorithms        budget_algorithm;
    7068  Thread_CPU_budget_algorithm_callout budget_callout;
     
    7472  Thread_Control                     *executing;
    7573  const Scheduler_Control            *scheduler;
    76   POSIX_API_Control                  *api;
    77   const POSIX_API_Control            *executing_api;
    7874  int                                 schedpolicy = SCHED_RR;
    7975  struct sched_param                  schedparam;
     
    8278  int                                 error;
    8379  ISR_lock_Context                    lock_context;
     80#if defined(RTEMS_POSIX_API)
     81  int                                 low_prio;
     82  Priority_Control                    core_low_prio;
     83  POSIX_API_Control                  *api;
     84  const POSIX_API_Control            *executing_api;
     85#endif
    8486
    8587  if ( !start_routine )
     
    168170  }
    169171
     172#if defined(RTEMS_POSIX_API)
    170173  if ( schedpolicy == SCHED_SPORADIC ) {
    171174    low_prio = schedparam.sched_ss_low_priority;
     
    178181    return EINVAL;
    179182  }
     183#endif
    180184
    181185  if ( the_attr->affinityset == NULL ) {
     
    243247   }
    244248
     249  the_thread->was_created_with_inherited_scheduler =
     250    ( the_attr->inheritsched == PTHREAD_INHERIT_SCHED );
     251
     252#if defined(RTEMS_POSIX_API)
    245253  /*
    246254   *  finish initializing the per API structure
     
    250258
    251259  api->signals_unblocked = executing_api->signals_unblocked;
    252 
    253   the_thread->was_created_with_inherited_scheduler =
    254     ( the_attr->inheritsched == PTHREAD_INHERIT_SCHED );
    255260
    256261  _Priority_Node_set_priority( &api->Sporadic.Low_priority, core_low_prio );
     
    265270    _POSIX_Threads_Sporadic_timer( &api->Sporadic.Timer );
    266271  }
     272#endif
    267273
    268274  /*
  • cpukit/posix/src/pthreadsetschedparam.c

    r033f31c8 r54f35888  
    4141{
    4242  const Scheduler_Control *scheduler;
    43   POSIX_API_Control       *api;
    4443  int                      normal_prio;
    45   int                      low_prio;
    4644  bool                     valid;
    4745  Priority_Control         core_normal_prio;
     46#if defined(RTEMS_POSIX_API)
     47  POSIX_API_Control       *api;
     48  int                      low_prio;
    4849  Priority_Control         core_low_prio;
     50#endif
    4951
    5052  normal_prio = param->sched_priority;
     
    5759  }
    5860
     61#if defined(RTEMS_POSIX_API)
    5962  if ( policy == SCHED_SPORADIC ) {
    6063    low_prio = param->sched_ss_low_priority;
     
    7174
    7275  _Watchdog_Per_CPU_remove_ticks( &api->Sporadic.Timer );
     76#endif
    7377
    7478  _Priority_Node_set_priority( &the_thread->Real_priority, core_normal_prio );
    7579
     80#if defined(RTEMS_POSIX_API)
    7681  if ( _Priority_Node_is_active( &api->Sporadic.Low_priority ) ) {
    7782    _Thread_Priority_add(
     
    8792    _Priority_Node_set_inactive( &api->Sporadic.Low_priority );
    8893  } else {
     94#endif
    8995    _Thread_Priority_changed(
    9096      the_thread,
     
    9399      queue_context
    94100    );
     101#if defined(RTEMS_POSIX_API)
    95102  }
     103#endif
    96104
    97105  the_thread->budget_algorithm = budget_algorithm;
    98106  the_thread->budget_callout   = budget_callout;
    99107
     108#if defined(RTEMS_POSIX_API)
    100109  _Priority_Node_set_priority( &api->Sporadic.Low_priority, core_low_prio );
    101110  api->Sporadic.sched_ss_repl_period = param->sched_ss_repl_period;
     
    106115    _POSIX_Threads_Sporadic_timer_insert( the_thread, api );
    107116  } else {
     117#endif
    108118    the_thread->cpu_time_budget =
    109119      rtems_configuration_get_ticks_per_timeslice();
     120#if defined(RTEMS_POSIX_API)
    110121  }
     122#endif
    111123
    112124  return 0;
Note: See TracChangeset for help on using the changeset viewer.