Changeset f3d9f228 in rtems


Ignore:
Timestamp:
Jun 26, 2017, 8:35:45 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
74f9db8
Parents:
15dbc71
git-author:
Sebastian Huber <sebastian.huber@…> (06/26/17 08:35:45)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/29/17 09:28:32)
Message:

score: Add SMP EDF scheduler

Update #3056.

Files:
6 added
9 edited

Legend:

Unmodified
Added
Removed
  • cpukit/sapi/include/confdefs.h

    r15dbc71 rf3d9f228  
    781781 *  - CONFIGURE_SCHEDULER_SIMPLE_SMP - Simple SMP Priority Scheduler
    782782 *  - CONFIGURE_SCHEDULER_EDF - EDF Scheduler
     783 *  - CONFIGURE_SCHEDULER_EDF_SMP - EDF SMP Scheduler
    783784 *  - CONFIGURE_SCHEDULER_CBS - CBS Scheduler
    784785 *  - CONFIGURE_SCHEDULER_USER  - user provided scheduler
     
    806807    !defined(CONFIGURE_SCHEDULER_SIMPLE_SMP) && \
    807808    !defined(CONFIGURE_SCHEDULER_EDF) && \
     809    !defined(CONFIGURE_SCHEDULER_EDF_SMP) && \
    808810    !defined(CONFIGURE_SCHEDULER_CBS)
    809811  #if defined(RTEMS_SMP) && CONFIGURE_MAXIMUM_PROCESSORS > 1
     
    977979    #define CONFIGURE_SCHEDULER_CONTROLS \
    978980      RTEMS_SCHEDULER_CONTROL_EDF(dflt, CONFIGURE_SCHEDULER_NAME)
     981  #endif
     982#endif
     983
     984/*
     985 * If the EDF SMP Scheduler is selected, then configure for it.
     986 */
     987#if defined(CONFIGURE_SCHEDULER_EDF_SMP)
     988  #if !defined(CONFIGURE_SCHEDULER_NAME)
     989    /** Configure the name of the scheduler instance */
     990    #define CONFIGURE_SCHEDULER_NAME rtems_build_name('M', 'E', 'D', 'F')
     991  #endif
     992
     993  #if !defined(CONFIGURE_SCHEDULER_CONTROLS)
     994    /** Configure the context needed by the scheduler instance */
     995    #define CONFIGURE_SCHEDULER_CONTEXT RTEMS_SCHEDULER_CONTEXT_EDF_SMP(dflt)
     996
     997    /** Configure the controls for this scheduler instance */
     998    #define CONFIGURE_SCHEDULER_CONTROLS \
     999      RTEMS_SCHEDULER_CONTROL_EDF_SMP(dflt, CONFIGURE_SCHEDULER_NAME)
    9791000  #endif
    9801001#endif
     
    31513172    #ifdef CONFIGURE_SCHEDULER_EDF
    31523173      Scheduler_EDF_Node EDF;
     3174    #endif
     3175    #ifdef CONFIGURE_SCHEDULER_EDF_SMP
     3176      Scheduler_EDF_SMP_Node EDF_SMP;
    31533177    #endif
    31543178    #ifdef CONFIGURE_SCHEDULER_PRIORITY
  • cpukit/sapi/include/rtems/scheduler.h

    r15dbc71 rf3d9f228  
    66
    77/*
    8  * Copyright (c) 2014, 2016 embedded brains GmbH.  All rights reserved.
     8 * Copyright (c) 2014, 2017 embedded brains GmbH.  All rights reserved.
    99 *
    1010 *  embedded brains GmbH
     
    9494#endif
    9595
     96#ifdef CONFIGURE_SCHEDULER_EDF_SMP
     97  #include <rtems/score/scheduleredfsmp.h>
     98
     99  #define RTEMS_SCHEDULER_CONTEXT_EDF_SMP_NAME( name ) \
     100    RTEMS_SCHEDULER_CONTEXT_NAME( EDF_SMP_ ## name )
     101
     102  #define RTEMS_SCHEDULER_CONTEXT_EDF_SMP( name ) \
     103    static Scheduler_EDF_SMP_Context RTEMS_SCHEDULER_CONTEXT_EDF_SMP_NAME( name )
     104
     105  #define RTEMS_SCHEDULER_CONTROL_EDF_SMP( name, obj_name ) \
     106    { \
     107      &RTEMS_SCHEDULER_CONTEXT_EDF_SMP_NAME( name ).Base.Base, \
     108      SCHEDULER_EDF_SMP_ENTRY_POINTS, \
     109      SCHEDULER_EDF_MAXIMUM_PRIORITY, \
     110      ( obj_name ) \
     111    }
     112#endif
     113
    96114#ifdef CONFIGURE_SCHEDULER_PRIORITY
    97115  #include <rtems/score/schedulerpriority.h>
  • cpukit/score/Makefile.am

    r15dbc71 rf3d9f228  
    127127
    128128if HAS_SMP
     129include_rtems_score_HEADERS += include/rtems/score/scheduleredfsmp.h
    129130include_rtems_score_HEADERS += include/rtems/score/schedulerprioritysmpimpl.h
    130131include_rtems_score_HEADERS += include/rtems/score/schedulerpriorityaffinitysmp.h
     
    150151libscore_a_SOURCES += src/percpustatewait.c
    151152libscore_a_SOURCES += src/profilingsmplock.c
     153libscore_a_SOURCES += src/scheduleredfsmp.c
    152154libscore_a_SOURCES += src/schedulerpriorityaffinitysmp.c
    153155libscore_a_SOURCES += src/schedulerprioritysmp.c
  • cpukit/score/preinstall.am

    r15dbc71 rf3d9f228  
    440440endif
    441441if HAS_SMP
     442$(PROJECT_INCLUDE)/rtems/score/scheduleredfsmp.h: include/rtems/score/scheduleredfsmp.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
     443        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/scheduleredfsmp.h
     444PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/scheduleredfsmp.h
     445
    442446$(PROJECT_INCLUDE)/rtems/score/schedulerprioritysmpimpl.h: include/rtems/score/schedulerprioritysmpimpl.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
    443447        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/schedulerprioritysmpimpl.h
  • cpukit/score/src/scheduleredfchangepriority.c

    r15dbc71 rf3d9f228  
    2020
    2121#include <rtems/score/scheduleredfimpl.h>
    22 
    23 Priority_Control _Scheduler_EDF_Map_priority(
    24   const Scheduler_Control *scheduler,
    25   Priority_Control         priority
    26 )
    27 {
    28   return SCHEDULER_EDF_PRIO_MSB | priority;
    29 }
    30 
    31 Priority_Control _Scheduler_EDF_Unmap_priority(
    32   const Scheduler_Control *scheduler,
    33   Priority_Control         priority
    34 )
    35 {
    36   return priority & ~SCHEDULER_EDF_PRIO_MSB;
    37 }
    3822
    3923void _Scheduler_EDF_Update_priority(
  • cpukit/score/src/scheduleredfreleasejob.c

    r15dbc71 rf3d9f228  
    2020
    2121#include <rtems/score/scheduleredfimpl.h>
     22
     23Priority_Control _Scheduler_EDF_Map_priority(
     24  const Scheduler_Control *scheduler,
     25  Priority_Control         priority
     26)
     27{
     28  return SCHEDULER_EDF_PRIO_MSB | priority;
     29}
     30
     31Priority_Control _Scheduler_EDF_Unmap_priority(
     32  const Scheduler_Control *scheduler,
     33  Priority_Control         priority
     34)
     35{
     36  return priority & ~SCHEDULER_EDF_PRIO_MSB;
     37}
    2238
    2339void _Scheduler_EDF_Release_job(
  • testsuites/smptests/Makefile.am

    r15dbc71 rf3d9f228  
    4343_SUBDIRS += smpscheduler05
    4444_SUBDIRS += smpscheduler06
     45_SUBDIRS += smpscheduler07
    4546_SUBDIRS += smpsignal01
    4647_SUBDIRS += smpstrongapa01
  • testsuites/smptests/configure.ac

    r15dbc71 rf3d9f228  
    9898smpscheduler05/Makefile
    9999smpscheduler06/Makefile
     100smpscheduler07/Makefile
    100101smpsignal01/Makefile
    101102smpstrongapa01/Makefile
  • testsuites/smptests/smpscheduler03/test.c

    r15dbc71 rf3d9f228  
    3838)
    3939{
     40  const Scheduler_Control *scheduler;
     41
     42  scheduler = _Thread_Scheduler_get_home(thread);
     43  new_priority = _Scheduler_Map_priority(scheduler, new_priority);
     44
    4045  _Thread_queue_Context_initialize(queue_context);
    4146  _Thread_queue_Context_clear_priority_updates(queue_context);
Note: See TracChangeset for help on using the changeset viewer.