Changeset 1240aade in rtems for cpukit/rtems


Ignore:
Timestamp:
Jan 24, 2017, 1:37:42 PM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
625bd6a
Parents:
6af2221
git-author:
Sebastian Huber <sebastian.huber@…> (01/24/17 13:37:42)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/24/17 13:44:37)
Message:

rtems: Fix _Rate_monotonic_Renew_deadline()

Make _Rate_monotonic_Renew_deadline() static and use proper locking in SMP
configurations.

Update #2795.

Location:
cpukit/rtems
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/rtems/include/rtems/rtems/ratemonimpl.h

    r6af2221 r1240aade  
    118118);
    119119
    120 /**
    121  * @brief Renew the watchdog deadline
    122  *
    123  * This routine is prepared for the watchdog timeout to renew its deadline
    124  * without releasing jobs.
    125  */
    126 void _Rate_monotonic_Renew_deadline(
    127   Rate_monotonic_Control *the_period,
    128   Thread_Control         *owner,
    129   ISR_lock_Context       *lock_context
    130 );
    131 
    132120void _Rate_monotonic_Restart(
    133121  Rate_monotonic_Control *the_period,
  • cpukit/rtems/src/ratemonperiod.c

    r6af2221 r1240aade  
    119119  _Thread_Priority_update( &queue_context );
    120120  _Thread_Dispatch_enable( cpu_self );
    121 }
    122 
    123 void _Rate_monotonic_Renew_deadline(
    124   Rate_monotonic_Control *the_period,
    125   Thread_Control         *owner,
    126   ISR_lock_Context       *lock_context
    127 )
    128 {
    129   Per_CPU_Control *cpu_self;
    130   uint64_t deadline;
    131 
    132   cpu_self = _Thread_Dispatch_disable_critical( lock_context );
    133   _Rate_monotonic_Release( owner, lock_context );
    134 
    135   _ISR_lock_ISR_disable( lock_context );
    136   deadline = _Watchdog_Per_CPU_insert_relative(
    137     &the_period->Timer,
    138     cpu_self,
    139     the_period->next_length
    140   );
    141   the_period->latest_deadline = deadline;
    142   _ISR_lock_ISR_enable( lock_context );
    143   _Thread_Dispatch_enable( cpu_self );
    144 
    145121}
    146122
  • cpukit/rtems/src/ratemontimeout.c

    r6af2221 r1240aade  
    2222
    2323#include <rtems/rtems/ratemonimpl.h>
     24
     25static void _Rate_monotonic_Renew_deadline(
     26  Rate_monotonic_Control *the_period,
     27  Thread_Control         *owner,
     28  ISR_lock_Context       *lock_context
     29)
     30{
     31  uint64_t deadline;
     32
     33  ++the_period->postponed_jobs;
     34  the_period->state = RATE_MONOTONIC_EXPIRED;
     35
     36  deadline = _Watchdog_Per_CPU_insert_relative(
     37    &the_period->Timer,
     38    _Per_CPU_Get(),
     39    the_period->next_length
     40  );
     41  the_period->latest_deadline = deadline;
     42
     43  _Rate_monotonic_Release( the_period, lock_context );
     44}
    2445
    2546void _Rate_monotonic_Timeout( Watchdog_Control *the_watchdog )
     
    6586    }
    6687  } else {
    67     /*
    68      * If the watchdog is timeout, it means there is an additional postponed
    69      * job in the next period but it is not available to release now:
    70      * Either the current task is still executed, or it is preemptive by the
    71      * other higher priority tasks.
    72      */
    73     the_period->postponed_jobs += 1;
    74     the_period->state = RATE_MONOTONIC_EXPIRED;
    7588    _Rate_monotonic_Renew_deadline( the_period, owner, &lock_context );
    7689  }
Note: See TracChangeset for help on using the changeset viewer.