Changeset 254dc82 in rtems


Ignore:
Timestamp:
Jun 24, 2016, 9:22:03 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
187a074
Parents:
1d72f03
git-author:
Sebastian Huber <sebastian.huber@…> (06/24/16 09:22:03)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/24/16 12:44:31)
Message:

score: Change Priority_Control to 64-bit

A 32-bit Priority_Control limits the uptime to 49 days with a 1ms clock
tick in case the EDF scheduler is used. Increase it to 64-bit to enable
proper operation of the EDF scheduler,

Close 2173.

Files:
11 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/include/rtems/posix/priorityimpl.h

    r1d72f03 r254dc82  
    2121
    2222#include <rtems/score/scheduler.h>
     23#include <rtems/score/assert.h>
    2324
    2425#ifdef __cplusplus
     
    4950 * @return The maximum POSIX API priority for this scheduler instance.
    5051 */
    51 int _POSIX_Priority_Get_maximum( const Scheduler_Control *scheduler );
     52RTEMS_INLINE_ROUTINE int _POSIX_Priority_Get_maximum(
     53  const Scheduler_Control *scheduler
     54)
     55{
     56  _Assert( (int) scheduler->maximum_priority > 1 );
     57  return (int) scheduler->maximum_priority - 1;
     58}
    5259
    5360/**
  • cpukit/posix/src/killinfo.c

    r1d72f03 r254dc82  
    191191   */
    192192  interested = NULL;
    193   interested_priority = PRIORITY_MAXIMUM + 1;
     193  interested_priority = UINT64_MAX;
    194194
    195195  for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) {
  • cpukit/posix/src/psxpriorityisvalid.c

    r1d72f03 r254dc82  
    2121#include <rtems/posix/priorityimpl.h>
    2222#include <rtems/score/schedulerimpl.h>
    23 
    24 int _POSIX_Priority_Get_maximum( const Scheduler_Control *scheduler )
    25 {
    26   if ( scheduler->maximum_priority < INT_MAX ) {
    27     return (int) scheduler->maximum_priority - 1;
    28   } else {
    29     return INT_MAX;
    30   }
    31 }
    3223
    3324Priority_Control _POSIX_Priority_To_core(
  • cpukit/rtems/include/rtems/rtems/tasks.h

    r1d72f03 r254dc82  
    7676 *  Define the type for an RTEMS API task priority.
    7777 */
    78 typedef Priority_Control rtems_task_priority;
     78typedef uint32_t rtems_task_priority;
    7979
    8080/**
  • cpukit/score/include/rtems/score/priority.h

    r1d72f03 r254dc82  
    5454 *  @note Priority 0 is reserved for internal threads only.
    5555 */
    56 typedef uint32_t  Priority_Control;
     56typedef uint64_t Priority_Control;
    5757
    5858/** This defines the highest (most important) thread priority. */
  • cpukit/score/include/rtems/score/scheduleredf.h

    r1d72f03 r254dc82  
    2525#include <rtems/score/rbtree.h>
    2626
     27#include <limits.h>
     28
    2729#ifdef __cplusplus
    2830extern "C" {
     
    3638/**@{*/
    3739
    38 #define SCHEDULER_EDF_MAXIMUM_PRIORITY 0x7fffffff
     40/*
     41 * Actually the EDF scheduler supports a maximum priority of
     42 * 0x7fffffffffffffff, but the user API is limited to uint32_t or int for
     43 * thread priorities.  Ignore ILP64 targets for now.
     44 */
     45#define SCHEDULER_EDF_MAXIMUM_PRIORITY INT_MAX
    3946
    4047/**
  • cpukit/score/include/rtems/score/scheduleredfimpl.h

    r1d72f03 r254dc82  
    3939 * tasks.
    4040 */
    41 #define SCHEDULER_EDF_PRIO_MSB 0x80000000
     41#define SCHEDULER_EDF_PRIO_MSB 0x8000000000000000
    4242
    4343RTEMS_INLINE_ROUTINE Scheduler_EDF_Context *
  • cpukit/score/include/rtems/score/schedulerpriorityimpl.h

    r1d72f03 r254dc82  
    211211)
    212212{
    213   ready_queue->current_priority = new_priority;
     213  ready_queue->current_priority = (unsigned int) new_priority;
    214214  ready_queue->ready_chain = &ready_queues[ new_priority ];
    215215
     
    217217    bit_map,
    218218    &ready_queue->Priority_map,
    219     new_priority
     219    (unsigned int) new_priority
    220220  );
    221221}
  • cpukit/score/src/schedulerprioritychangepriority.c

    r1d72f03 r254dc82  
    3838
    3939  node = _Scheduler_priority_Thread_get_node( the_thread );
    40   priority = _Scheduler_Node_get_priority( &node->Base, &prepend_it );
     40  priority = (unsigned int )
     41    _Scheduler_Node_get_priority( &node->Base, &prepend_it );
    4142
    4243  if ( priority == node->Ready_queue.current_priority ) {
  • cpukit/score/src/schedulerpriorityunblock.c

    r1d72f03 r254dc82  
    3535  context = _Scheduler_priority_Get_context( scheduler );
    3636  node = _Scheduler_priority_Thread_get_node( the_thread );
    37   priority = _Scheduler_Node_get_priority( &node->Base, &prepend_it );
     37  priority = (unsigned int )
     38    _Scheduler_Node_get_priority( &node->Base, &prepend_it );
    3839  (void) prepend_it;
    3940
  • testsuites/smptests/smpmrsp01/init.c

    r1d72f03 r254dc82  
    205205
    206206    printf(
    207       "[%" PRIu32 "] %4s -> %4s (prio %3" PRIu32 ", node %4s)\n",
     207      "[%" PRIu32 "] %4s -> %4s (prio %3" PRIu64 ", node %4s)\n",
    208208      e->cpu_index,
    209209      &ex[0],
Note: See TracChangeset for help on using the changeset viewer.