Changeset 0794197 in rtems for cpukit/rtems


Ignore:
Timestamp:
Jan 27, 2017, 10:15:50 PM (3 years ago)
Author:
Kuan-Hsun Chen <c0066c@…>
Branches:
master
Children:
180107e9
Parents:
4ea92d1e
git-author:
Kuan-Hsun Chen <c0066c@…> (01/27/17 22:15:50)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/30/17 06:53:13)
Message:

rtems: Fix _Rate_monotonic_Renew_deadline()

Prepare a precondition to prevent the potential integer overflow.

Remove one redundant parameter in _Rate_monotonic_Renew_deadline().

sptests/sprmsched02: Create
A test case for checking the overflow condition of postponed_jobs
in rtems_rate_monotonic_period_status.

Update #2885.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/rtems/src/ratemontimeout.c

    r4ea92d1e r0794197  
    1010 *  On-Line Applications Research Corporation (OAR).
    1111 *
    12  *  COPYRIGHT (c) 2016 Kuan-Hsun Chen.
     12 *  COPYRIGHT (c) 2016-2017 Kuan-Hsun Chen.
    1313 *
    1414 *  The license and distribution terms for this file may be
     
    2525static void _Rate_monotonic_Renew_deadline(
    2626  Rate_monotonic_Control *the_period,
    27   Thread_Control         *owner,
    2827  ISR_lock_Context       *lock_context
    2928)
     
    3130  uint64_t deadline;
    3231
    33   ++the_period->postponed_jobs;
     32  /* stay at 0xffffffff if postponed_jobs is going to overflow */
     33  if ( the_period->postponed_jobs != UINT32_MAX ) {
     34    ++the_period->postponed_jobs;
     35  }
     36
    3437  the_period->state = RATE_MONOTONIC_EXPIRED;
    3538
     
    8689    }
    8790  } else {
    88     _Rate_monotonic_Renew_deadline( the_period, owner, &lock_context );
     91    _Rate_monotonic_Renew_deadline( the_period, &lock_context );
    8992  }
    9093}
Note: See TracChangeset for help on using the changeset viewer.