Changeset 8776bb9 in rtems


Ignore:
Timestamp:
Sep 26, 2018, 4:34:54 AM (15 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
51b3cbca
Parents:
b38887a
git-author:
Sebastian Huber <sebastian.huber@…> (09/26/18 04:34:54)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/05/18 11:41:06)
Message:

score: Remove CPU_PROVIDES_IDLE_THREAD_BODY

Remove the CPU_PROVIDES_IDLE_THREAD_BODY option to avoid unnecessary
conditional compilation.

Close #3539.

Files:
1 added
36 edited

Legend:

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

    rb38887a r8776bb9  
    11091109  #if defined(BSP_IDLE_TASK_BODY)
    11101110    #define CONFIGURE_IDLE_TASK_BODY BSP_IDLE_TASK_BODY
    1111   #elif (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE)
     1111  #else
    11121112    #define CONFIGURE_IDLE_TASK_BODY _CPU_Thread_Idle_body
    1113   #else
    1114     /* only instantiate and compile if used */
    1115     #ifdef CONFIGURE_INIT
    1116       void *_Thread_Idle_body(uintptr_t ignored)
    1117       {
    1118         for( ; ; ) ;
    1119         return 0;   /* to avoid warning */
    1120       }
    1121     #endif
    1122     #define CONFIGURE_IDLE_TASK_BODY _Thread_Idle_body
    11231113  #endif
    11241114#endif
  • cpukit/include/rtems/score/thread.h

    rb38887a r8776bb9  
    880880};
    881881
    882 #if (CPU_PROVIDES_IDLE_THREAD_BODY == FALSE)
    883 /**
    884  *  This routine is the body of the system idle thread.
    885  *
    886  *  NOTE: This routine is actually instantiated by confdefs.h when needed.
    887  */
    888 void *_Thread_Idle_body(
    889   uintptr_t  ignored
    890 );
    891 #endif
    892 
    893882typedef void (*rtems_per_thread_routine)( Thread_Control * );
    894883
  • cpukit/score/cpu/arm/armv7-thread-idle.c

    rb38887a r8776bb9  
    99 *
    1010 *  embedded brains GmbH
    11  *  Obere Lagerstr. 30
     11 *  Dornierstr. 4
    1212 *  82178 Puchheim
    1313 *  Germany
     
    2525#include <rtems/score/cpu.h>
    2626
    27 #ifdef ARM_MULTILIB_HAS_WFI
    2827
    2928void *_CPU_Thread_Idle_body( uintptr_t ignored )
    3029{
    3130  while ( true ) {
     31#ifdef ARM_MULTILIB_HAS_WFI
    3232    __asm__ volatile ("wfi");
     33#endif /* ARM_MULTILIB_HAS_WFI */
    3334  }
    3435}
    3536
    36 #endif /* ARM_MULTILIB_HAS_WFI */
  • cpukit/score/cpu/arm/include/rtems/score/cpu.h

    rb38887a r8776bb9  
    119119
    120120#define CPU_ENABLE_ROBUST_THREAD_DISPATCH TRUE
    121 
    122 #if defined(ARM_MULTILIB_HAS_WFI)
    123   #define CPU_PROVIDES_IDLE_THREAD_BODY TRUE
    124 #else
    125   #define CPU_PROVIDES_IDLE_THREAD_BODY FALSE
    126 #endif
    127121
    128122#define CPU_STACK_GROWS_UP FALSE
     
    598592}
    599593
    600 #if CPU_PROVIDES_IDLE_THREAD_BODY == TRUE
    601   void *_CPU_Thread_Idle_body( uintptr_t ignored );
    602 #endif
     594void *_CPU_Thread_Idle_body( uintptr_t ignored );
    603595
    604596/** @} */
  • cpukit/score/cpu/bfin/cpu.c

    rb38887a r8776bb9  
    169169}
    170170
    171 #if (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE)
    172171void *_CPU_Thread_Idle_body(uintptr_t ignored)
    173172{
     
    176175  }
    177176}
    178 #endif
    179177
    180178/*
  • cpukit/score/cpu/bfin/include/rtems/score/cpu.h

    rb38887a r8776bb9  
    172172
    173173#define CPU_ENABLE_ROBUST_THREAD_DISPATCH FALSE
    174 
    175 /**
    176  * Does this port provide a CPU dependent IDLE task implementation?
    177  *
    178  * If TRUE, then the routine @ref _CPU_Thread_Idle_body
    179  * must be provided and is the default IDLE thread body instead of
    180  * @ref _CPU_Thread_Idle_body.
    181  *
    182  * If FALSE, then use the generic IDLE thread body if the BSP does
    183  * not provide one.
    184  *
    185  * This is intended to allow for supporting processors which have
    186  * a low power or idle mode.  When the IDLE thread is executed, then
    187  * the CPU can be powered down.
    188  *
    189  * The order of precedence for selecting the IDLE thread body is:
    190  *
    191  *   -#  BSP provided
    192  *   -#  CPU dependent (if provided)
    193  *   -#  generic (if no BSP and no CPU dependent)
    194  *
    195  * Port Specific Information:
    196  *
    197  * XXX document implementation including references if appropriate
    198  */
    199 #define CPU_PROVIDES_IDLE_THREAD_BODY    TRUE
    200174
    201175/**
     
    720694);
    721695
    722 /**
    723  * This routine is the CPU dependent IDLE thread body.
    724  *
    725  * @note  It need only be provided if @ref CPU_PROVIDES_IDLE_THREAD_BODY
    726  *        is TRUE.
    727  *
    728  * Port Specific Information:
    729  *
    730  * XXX document implementation including references if appropriate
    731  */
    732696void *_CPU_Thread_Idle_body( uintptr_t ignored );
    733697
  • cpukit/score/cpu/epiphany/include/rtems/score/cpu.h

    rb38887a r8776bb9  
    146146
    147147#define CPU_ENABLE_ROBUST_THREAD_DISPATCH FALSE
    148 
    149 /*
    150  *  Does this port provide a CPU dependent IDLE task implementation?
    151  *
    152  *  If TRUE, then the routine _CPU_Thread_Idle_body
    153  *  must be provided and is the default IDLE thread body instead of
    154  *  _CPU_Thread_Idle_body.
    155  *
    156  *  If FALSE, then use the generic IDLE thread body if the BSP does
    157  *  not provide one.
    158  *
    159  *  This is intended to allow for supporting processors which have
    160  *  a low power or idle mode.  When the IDLE thread is executed, then
    161  *  the CPU can be powered down.
    162  *
    163  *  The order of precedence for selecting the IDLE thread body is:
    164  *
    165  *    1.  BSP provided
    166  *    2.  CPU dependent (if provided)
    167  *    3.  generic (if no BSP and no CPU dependent)
    168  *
    169  */
    170 
    171 #define CPU_PROVIDES_IDLE_THREAD_BODY    TRUE
    172148
    173149/*
     
    637613);
    638614
    639 /*
    640  *  _CPU_Thread_Idle_body
    641  *
    642  *  This routine is the CPU dependent IDLE thread body.
    643  *
    644  *  NOTE:  It need only be provided if CPU_PROVIDES_IDLE_THREAD_BODY
    645  *         is TRUE.
    646  *
    647  */
    648 
    649615void *_CPU_Thread_Idle_body( uintptr_t ignored );
    650616
  • cpukit/score/cpu/i386/Makefile.am

    rb38887a r8776bb9  
    55libscorecpu_a_SOURCES += ../no_cpu/cpucounterfrequency.c
    66libscorecpu_a_SOURCES += ../no_cpu/cpucounterread.c
     7libscorecpu_a_SOURCES += ../no_cpu/cpuidle.c
    78libscorecpu_a_CPPFLAGS = $(AM_CPPFLAGS)
    89
  • cpukit/score/cpu/i386/include/rtems/score/cpu.h

    rb38887a r8776bb9  
    9696
    9797#define CPU_STRUCTURE_ALIGNMENT
    98 
    99 /*
    100  *  Does this port provide a CPU dependent IDLE task implementation?
    101  *
    102  *  If TRUE, then the routine _CPU_Thread_Idle_body
    103  *  must be provided and is the default IDLE thread body instead of
    104  *  _CPU_Thread_Idle_body.
    105  *
    106  *  If FALSE, then use the generic IDLE thread body if the BSP does
    107  *  not provide one.
    108  */
    109 
    110 #define CPU_PROVIDES_IDLE_THREAD_BODY    FALSE
    11198
    11299#define CPU_MAXIMUM_PROCESSORS 32
     
    578565);
    579566
    580 /*
    581  *  _CPU_Thread_Idle_body
    582  *
    583  *  Use the halt instruction of low power mode of a particular i386 model.
    584  */
    585 
    586 #if (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE)
    587 
    588567void *_CPU_Thread_Idle_body( uintptr_t ignored );
    589 
    590 #endif /* CPU_PROVIDES_IDLE_THREAD_BODY */
    591568
    592569/*
  • cpukit/score/cpu/lm32/include/rtems/score/cpu.h

    rb38887a r8776bb9  
    166166
    167167#define CPU_ENABLE_ROBUST_THREAD_DISPATCH FALSE
    168 
    169 /**
    170  * Does this port provide a CPU dependent IDLE task implementation?
    171  *
    172  * If TRUE, then the routine @ref _CPU_Thread_Idle_body
    173  * must be provided and is the default IDLE thread body instead of
    174  * @ref _CPU_Thread_Idle_body.
    175  *
    176  * If FALSE, then use the generic IDLE thread body if the BSP does
    177  * not provide one.
    178  *
    179  * This is intended to allow for supporting processors which have
    180  * a low power or idle mode.  When the IDLE thread is executed, then
    181  * the CPU can be powered down.
    182  *
    183  * The order of precedence for selecting the IDLE thread body is:
    184  *
    185  *   -#  BSP provided
    186  *   -#  CPU dependent (if provided)
    187  *   -#  generic (if no BSP and no CPU dependent)
    188  *
    189  * Port Specific Information:
    190  *
    191  * XXX document implementation including references if appropriate
    192  */
    193 #define CPU_PROVIDES_IDLE_THREAD_BODY    TRUE
    194168
    195169/**
     
    754728/** @} */
    755729
    756 /**
    757  * This routine is the CPU dependent IDLE thread body.
    758  *
    759  * NOTE:  It need only be provided if @ref CPU_PROVIDES_IDLE_THREAD_BODY
    760  *        is TRUE.
    761  *
    762  * Port Specific Information:
    763  *
    764  * XXX document implementation including references if appropriate
    765  */
    766730void *_CPU_Thread_Idle_body( uintptr_t ignored );
    767731
  • cpukit/score/cpu/m32c/include/rtems/score/cpu.h

    rb38887a r8776bb9  
    188188
    189189#define CPU_ENABLE_ROBUST_THREAD_DISPATCH FALSE
    190 
    191 /**
    192  * Does this port provide a CPU dependent IDLE task implementation?
    193  *
    194  * If TRUE, then the routine @ref _CPU_Thread_Idle_body
    195  * must be provided and is the default IDLE thread body instead of
    196  * @ref _CPU_Thread_Idle_body.
    197  *
    198  * If FALSE, then use the generic IDLE thread body if the BSP does
    199  * not provide one.
    200  *
    201  * This is intended to allow for supporting processors which have
    202  * a low power or idle mode.  When the IDLE thread is executed, then
    203  * the CPU can be powered down.
    204  *
    205  * The order of precedence for selecting the IDLE thread body is:
    206  *
    207  *   -#  BSP provided
    208  *   -#  CPU dependent (if provided)
    209  *   -#  generic (if no BSP and no CPU dependent)
    210  *
    211  * Port Specific Information:
    212  *
    213  * XXX document implementation including references if appropriate
    214  */
    215 #define CPU_PROVIDES_IDLE_THREAD_BODY    TRUE
    216190
    217191/**
     
    739713);
    740714
    741 /**
    742  * This routine is the CPU dependent IDLE thread body.
    743  *
    744  * NOTE:  It need only be provided if @ref CPU_PROVIDES_IDLE_THREAD_BODY
    745  *        is TRUE.
    746  *
    747  * Port Specific Information:
    748  *
    749  * XXX document implementation including references if appropriate
    750  */
    751715void *_CPU_Thread_Idle_body( uintptr_t ignored );
    752716
  • cpukit/score/cpu/m68k/include/rtems/score/cpu.h

    rb38887a r8776bb9  
    8383#define CPU_ENABLE_ROBUST_THREAD_DISPATCH FALSE
    8484
    85 #define CPU_PROVIDES_IDLE_THREAD_BODY    TRUE
    8685#define CPU_STACK_GROWS_UP               FALSE
    8786
     
    401400
    402401/* end of Context handler macros */
    403 
    404 /*
    405  *  _CPU_Thread_Idle_body
    406  *
    407  *  This routine is the CPU dependent IDLE thread body.
    408  *
    409  *  NOTE:  It need only be provided if CPU_PROVIDES_IDLE_THREAD_BODY
    410  *         is TRUE.
    411  */
    412402
    413403void *_CPU_Thread_Idle_body( uintptr_t ignored );
  • cpukit/score/cpu/mips/include/rtems/score/cpu.h

    rb38887a r8776bb9  
    174174
    175175#define CPU_ENABLE_ROBUST_THREAD_DISPATCH FALSE
    176 
    177 /*
    178  *  Does this port provide a CPU dependent IDLE task implementation?
    179  *
    180  *  If TRUE, then the routine _CPU_Internal_threads_Idle_thread_body
    181  *  must be provided and is the default IDLE thread body instead of
    182  *  _Internal_threads_Idle_thread_body.
    183  *
    184  *  If FALSE, then use the generic IDLE thread body if the BSP does
    185  *  not provide one.
    186  *
    187  *  This is intended to allow for supporting processors which have
    188  *  a low power or idle mode.  When the IDLE thread is executed, then
    189  *  the CPU can be powered down.
    190  *
    191  *  The order of precedence for selecting the IDLE thread body is:
    192  *
    193  *    1.  BSP provided
    194  *    2.  CPU dependent (if provided)
    195  *    3.  generic (if no BSP and no CPU dependent)
    196  */
    197 
    198 /* we can use the low power wait instruction for the IDLE thread */
    199 #define CPU_PROVIDES_IDLE_THREAD_BODY    TRUE
    200176
    201177/*
     
    803779);
    804780
    805 /*
    806  *  _CPU_Internal_threads_Idle_thread_body
    807  *
    808  *  This routine is the CPU dependent IDLE thread body.
    809  *
    810  *  NOTE:  It need only be provided if CPU_PROVIDES_IDLE_THREAD_BODY
    811  *         is TRUE.
    812  */
    813 
    814781void *_CPU_Thread_Idle_body( uintptr_t ignored );
    815782
  • cpukit/score/cpu/moxie/Makefile.am

    rb38887a r8776bb9  
    99libscorecpu_a_SOURCES += ../no_cpu/cpucounterfrequency.c
    1010libscorecpu_a_SOURCES += ../no_cpu/cpucounterread.c
     11libscorecpu_a_SOURCES += ../no_cpu/cpuidle.c
    1112libscorecpu_a_CPPFLAGS = $(AM_CPPFLAGS)
    1213
  • cpukit/score/cpu/moxie/include/rtems/score/cpu.h

    rb38887a r8776bb9  
    135135
    136136#define CPU_ENABLE_ROBUST_THREAD_DISPATCH FALSE
    137 
    138 /*
    139  *  Does this port provide a CPU dependent IDLE task implementation?
    140  *
    141  *  If TRUE, then the routine _CPU_Internal_threads_Idle_thread_body
    142  *  must be provided and is the default IDLE thread body instead of
    143  *  _Internal_threads_Idle_thread_body.
    144  *
    145  *  If FALSE, then use the generic IDLE thread body if the BSP does
    146  *  not provide one.
    147  *
    148  *  This is intended to allow for supporting processors which have
    149  *  a low power or idle mode.  When the IDLE thread is executed, then
    150  *  the CPU can be powered down.
    151  *
    152  *  The order of precedence for selecting the IDLE thread body is:
    153  *
    154  *    1.  BSP provided
    155  *    2.  CPU dependent (if provided)
    156  *    3.  generic (if no BSP and no CPU dependent)
    157  *
    158  *  MOXIE Specific Information:
    159  *
    160  *  XXX
    161  *  The port initially called a BSP dependent routine called
    162  *  IDLE_Monitor.  The idle task body can be overridden by
    163  *  the BSP in newer versions of RTEMS.
    164  */
    165 #define CPU_PROVIDES_IDLE_THREAD_BODY    FALSE
    166137
    167138/*
     
    599570);
    600571
    601 /*
    602  *  _CPU_Internal_threads_Idle_thread_body
    603  *
    604  *  This routine is the CPU dependent IDLE thread body.
    605  *
    606  *  NOTE:  It need only be provided if CPU_PROVIDES_IDLE_THREAD_BODY
    607  *         is TRUE.
    608  *
    609  *  MOXIE Specific Information:
    610  *
    611  *  XXX
    612  */
    613 void *_CPU_Thread_Idle_body( uint32_t );
     572void *_CPU_Thread_Idle_body( uintptr_t );
    614573
    615574/*
  • cpukit/score/cpu/nios2/Makefile.am

    rb38887a r8776bb9  
    88libscorecpu_a_SOURCES += ../no_cpu/cpucounterfrequency.c
    99libscorecpu_a_SOURCES += ../no_cpu/cpucounterread.c
     10libscorecpu_a_SOURCES += ../no_cpu/cpuidle.c
    1011libscorecpu_a_SOURCES += nios2-context-initialize.c
    1112libscorecpu_a_SOURCES += nios2-context-switch.S
  • cpukit/score/cpu/nios2/include/rtems/score/cpu.h

    rb38887a r8776bb9  
    5151
    5252#define CPU_ENABLE_ROBUST_THREAD_DISPATCH FALSE
    53 
    54 #define CPU_PROVIDES_IDLE_THREAD_BODY FALSE
    5553
    5654#define CPU_STACK_GROWS_UP FALSE
     
    317315);
    318316
     317void *_CPU_Thread_Idle_body( uintptr_t ignored );
     318
    319319void _CPU_Context_switch( Context_Control *run, Context_Control *heir );
    320320
  • cpukit/score/cpu/no_cpu/Makefile.am

    rb38887a r8776bb9  
    55libscorecpu_a_SOURCES += cpucounterfrequency.c
    66libscorecpu_a_SOURCES += cpucounterread.c
     7libscorecpu_a_SOURCES += cpuidle.c
    78libscorecpu_a_CPPFLAGS = $(AM_CPPFLAGS)
    89
  • cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h

    rb38887a r8776bb9  
    197197 */
    198198#define CPU_ENABLE_ROBUST_THREAD_DISPATCH FALSE
    199 
    200 /**
    201  * Does this port provide a CPU dependent IDLE task implementation?
    202  *
    203  * If TRUE, then the routine @ref _CPU_Thread_Idle_body
    204  * must be provided and is the default IDLE thread body instead of
    205  * @ref _CPU_Thread_Idle_body.
    206  *
    207  * If FALSE, then use the generic IDLE thread body if the BSP does
    208  * not provide one.
    209  *
    210  * This is intended to allow for supporting processors which have
    211  * a low power or idle mode.  When the IDLE thread is executed, then
    212  * the CPU can be powered down.
    213  *
    214  * The order of precedence for selecting the IDLE thread body is:
    215  *
    216  *   -#  BSP provided
    217  *   -#  CPU dependent (if provided)
    218  *   -#  generic (if no BSP and no CPU dependent)
    219  *
    220  * Port Specific Information:
    221  *
    222  * XXX document implementation including references if appropriate
    223  */
    224 #define CPU_PROVIDES_IDLE_THREAD_BODY    TRUE
    225199
    226200/**
     
    10451019 * This routine is the CPU dependent IDLE thread body.
    10461020 *
    1047  * NOTE:  It need only be provided if @ref CPU_PROVIDES_IDLE_THREAD_BODY
    1048  *         is TRUE.
    1049  *
    10501021 * Port Specific Information:
    10511022 *
  • cpukit/score/cpu/or1k/include/rtems/score/cpu.h

    rb38887a r8776bb9  
    138138
    139139#define CPU_ENABLE_ROBUST_THREAD_DISPATCH FALSE
    140 
    141 /*
    142  *  Does this port provide a CPU dependent IDLE task implementation?
    143  *
    144  *  If TRUE, then the routine _CPU_Thread_Idle_body
    145  *  must be provided and is the default IDLE thread body instead of
    146  *  _CPU_Thread_Idle_body.
    147  *
    148  *  If FALSE, then use the generic IDLE thread body if the BSP does
    149  *  not provide one.
    150  *
    151  *  This is intended to allow for supporting processors which have
    152  *  a low power or idle mode.  When the IDLE thread is executed, then
    153  *  the CPU can be powered down.
    154  *
    155  *  The order of precedence for selecting the IDLE thread body is:
    156  *
    157  *    1.  BSP provided
    158  *    2.  CPU dependent (if provided)
    159  *    3.  generic (if no BSP and no CPU dependent)
    160  *
    161  */
    162 
    163 #define CPU_PROVIDES_IDLE_THREAD_BODY    TRUE
    164140
    165141/*
     
    645621);
    646622
    647 /*
    648  *  _CPU_Thread_Idle_body
    649  *
    650  *  This routine is the CPU dependent IDLE thread body.
    651  *
    652  *  NOTE:  It need only be provided if CPU_PROVIDES_IDLE_THREAD_BODY
    653  *         is TRUE.
    654  *
    655  */
    656 
    657623void *_CPU_Thread_Idle_body( uintptr_t ignored );
    658624
  • cpukit/score/cpu/powerpc/Makefile.am

    rb38887a r8776bb9  
    33noinst_LIBRARIES = libscorecpu.a
    44libscorecpu_a_SOURCES = cpu.c
     5libscorecpu_a_SOURCES += ../no_cpu/cpuidle.c
    56libscorecpu_a_SOURCES += ppc-context-volatile-clobber.S
    67libscorecpu_a_SOURCES += ppc-context-validate.S
  • cpukit/score/cpu/powerpc/include/rtems/score/cpu.h

    rb38887a r8776bb9  
    5252
    5353/* conditional compilation parameters */
    54 
    55 /*
    56  *  Does this port provide a CPU dependent IDLE task implementation?
    57  *
    58  *  If TRUE, then the routine _CPU_Thread_Idle_body
    59  *  must be provided and is the default IDLE thread body instead of
    60  *  _CPU_Thread_Idle_body.
    61  *
    62  *  If FALSE, then use the generic IDLE thread body if the BSP does
    63  *  not provide one.
    64  *
    65  *  This is intended to allow for supporting processors which have
    66  *  a low power or idle mode.  When the IDLE thread is executed, then
    67  *  the CPU can be powered down.
    68  *
    69  *  The order of precedence for selecting the IDLE thread body is:
    70  *
    71  *    1.  BSP provided
    72  *    2.  CPU dependent (if provided)
    73  *    3.  generic (if no BSP and no CPU dependent)
    74  */
    75 
    76 #define CPU_PROVIDES_IDLE_THREAD_BODY    FALSE
    7754
    7855/*
     
    941918);
    942919
     920void *_CPU_Thread_Idle_body( uintptr_t ignored );
     921
    943922/*
    944923 *  _CPU_Context_switch
  • cpukit/score/cpu/riscv/include/rtems/score/cpu.h

    rb38887a r8776bb9  
    5353#define CPU_IDLE_TASK_IS_FP              FALSE
    5454#define CPU_USE_DEFERRED_FP_SWITCH       FALSE
    55 #define CPU_PROVIDES_IDLE_THREAD_BODY    TRUE
    5655#define CPU_STACK_GROWS_UP               FALSE
    5756
  • cpukit/score/cpu/sh/Makefile.am

    rb38887a r8776bb9  
    55libscorecpu_a_SOURCES += ../no_cpu/cpucounterfrequency.c
    66libscorecpu_a_SOURCES += ../no_cpu/cpucounterread.c
     7libscorecpu_a_SOURCES += ../no_cpu/cpuidle.c
    78libscorecpu_a_SOURCES += sh-exception-frame-print.c
    89libscorecpu_a_CPPFLAGS = $(AM_CPPFLAGS)
  • cpukit/score/cpu/sh/cpu.c

    rb38887a r8776bb9  
    175175 _ISR_Vector_table[ vector ] = new_handler;
    176176}
    177 
    178 /*
    179  *  _CPU_Thread_Idle_body
    180  *
    181  *  NOTES:
    182  *
    183  *  1. This is the same as the regular CPU independent algorithm.
    184  *
    185  *  2. If you implement this using a "halt", "idle", or "shutdown"
    186  *     instruction, then don't forget to put it in an infinite loop.
    187  *
    188  *  3. Be warned. Some processors with onboard DMA have been known
    189  *     to stop the DMA if the CPU were put in IDLE mode.  This might
    190  *     also be a problem with other on-chip peripherals.  So use this
    191  *     hook with caution.
    192  */
    193 
    194 #if (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE)
    195 void *_CPU_Thread_Idle_body( uintptr_t ignored )
    196 {
    197 
    198   for( ; ; )
    199     {
    200       __asm__ volatile("nop");
    201     }
    202     /* insert your "halt" instruction here */ ;
    203 }
    204 #endif
    205177
    206178void _CPU_Context_Initialize(
  • cpukit/score/cpu/sh/include/rtems/score/cpu.h

    rb38887a r8776bb9  
    147147
    148148#define CPU_ENABLE_ROBUST_THREAD_DISPATCH FALSE
    149 
    150 /*
    151  *  Does this port provide a CPU dependent IDLE task implementation?
    152  *
    153  *  If TRUE, then the routine _CPU_Thread_Idle_body
    154  *  must be provided and is the default IDLE thread body instead of
    155  *  _CPU_Thread_Idle_body.
    156  *
    157  *  If FALSE, then use the generic IDLE thread body if the BSP does
    158  *  not provide one.
    159  *
    160  *  This is intended to allow for supporting processors which have
    161  *  a low power or idle mode.  When the IDLE thread is executed, then
    162  *  the CPU can be powered down.
    163  *
    164  *  The order of precedence for selecting the IDLE thread body is:
    165  *
    166  *    1.  BSP provided
    167  *    2.  CPU dependent (if provided)
    168  *    3.  generic (if no BSP and no CPU dependent)
    169  */
    170 
    171 #define CPU_PROVIDES_IDLE_THREAD_BODY    TRUE
    172149
    173150/*
     
    595572);
    596573
    597 /*
    598  *  _CPU_Thread_Idle_body
    599  *
    600  *  This routine is the CPU dependent IDLE thread body.
    601  *
    602  *  NOTE:  It need only be provided if CPU_PROVIDES_IDLE_THREAD_BODY
    603  *         is TRUE.
    604  */
    605 
    606574void *_CPU_Thread_Idle_body( uintptr_t ignored );
    607575
  • cpukit/score/cpu/sparc/Makefile.am

    rb38887a r8776bb9  
    44libscorecpu_a_SOURCES =
    55libscorecpu_a_SOURCES += access_le.c
     6libscorecpu_a_SOURCES += cpu_asm.S
    67libscorecpu_a_SOURCES += cpu.c
    7 libscorecpu_a_SOURCES += cpu_asm.S
     8libscorecpu_a_SOURCES += ../no_cpu/cpuidle.c
    89libscorecpu_a_SOURCES += sparc-access.S
    910libscorecpu_a_SOURCES += sparc-context-validate.S
  • cpukit/score/cpu/sparc/include/rtems/score/cpu.h

    rb38887a r8776bb9  
    135135
    136136#define CPU_ENABLE_ROBUST_THREAD_DISPATCH FALSE
    137 
    138 /**
    139  * Does this port provide a CPU dependent IDLE task implementation?
    140  *
    141  * - If TRUE, then the routine _CPU_Thread_Idle_body
    142  * must be provided and is the default IDLE thread body instead of
    143  * _CPU_Thread_Idle_body.
    144  *
    145  * - If FALSE, then use the generic IDLE thread body if the BSP does
    146  * not provide one.
    147  *
    148  * The SPARC architecture does not have a low power or halt instruction.
    149  * It is left to the BSP and/or CPU specific code to provide an IDLE
    150  * thread body which is aware of low power modes.
    151  */
    152 #define CPU_PROVIDES_IDLE_THREAD_BODY    FALSE
    153137
    154138/**
     
    989973);
    990974
     975void *_CPU_Thread_Idle_body( uintptr_t ignored );
     976
    991977/**
    992978 * @brief SPARC specific context switch.
  • cpukit/score/cpu/sparc64/Makefile.am

    rb38887a r8776bb9  
    88libscorecpu_a_SOURCES += ../no_cpu/cpucounterfrequency.c
    99libscorecpu_a_SOURCES += ../no_cpu/cpucounterread.c
     10libscorecpu_a_SOURCES += ../no_cpu/cpuidle.c
    1011libscorecpu_a_SOURCES += sparc64-exception-frame-print.c
    1112libscorecpu_a_SOURCES += sparc64-syscall.S
  • cpukit/score/cpu/sparc64/include/rtems/score/cpu.h

    rb38887a r8776bb9  
    106106
    107107#define CPU_ENABLE_ROBUST_THREAD_DISPATCH FALSE
    108 
    109 /*
    110  *  Does this port provide a CPU dependent IDLE task implementation?
    111  *
    112  *  If TRUE, then the routine _CPU_Thread_Idle_body
    113  *  must be provided and is the default IDLE thread body instead of
    114  *  _CPU_Thread_Idle_body.
    115  *
    116  *  If FALSE, then use the generic IDLE thread body if the BSP does
    117  *  not provide one.
    118  */
    119 
    120 #define CPU_PROVIDES_IDLE_THREAD_BODY    FALSE
    121108
    122109/*
     
    878865);
    879866
    880 #if (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE)
    881 
    882 /*
    883  *  _CPU_Thread_Idle_body
    884  *
    885  *  Some SPARC implementations have low power, sleep, or idle modes.  This
    886  *  tries to take advantage of those models.
    887  */
    888 
    889867void *_CPU_Thread_Idle_body( uintptr_t ignored );
    890 
    891 #endif /* CPU_PROVIDES_IDLE_THREAD_BODY */
    892868
    893869/*
  • cpukit/score/cpu/v850/Makefile.am

    rb38887a r8776bb9  
    66libscorecpu_a_SOURCES += ../no_cpu/cpucounterfrequency.c
    77libscorecpu_a_SOURCES += ../no_cpu/cpucounterread.c
     8libscorecpu_a_SOURCES += ../no_cpu/cpuidle.c
    89libscorecpu_a_SOURCES += v850-exception-frame-print.c
    910libscorecpu_a_CPPFLAGS = $(AM_CPPFLAGS)
  • cpukit/score/cpu/v850/include/rtems/score/cpu.h

    rb38887a r8776bb9  
    164164
    165165#define CPU_ENABLE_ROBUST_THREAD_DISPATCH FALSE
    166 
    167 /**
    168  * Does this port provide a CPU dependent IDLE task implementation?
    169  *
    170  * If TRUE, then the routine @ref _CPU_Thread_Idle_body
    171  * must be provided and is the default IDLE thread body instead of
    172  * @ref _CPU_Thread_Idle_body.
    173  *
    174  * If FALSE, then use the generic IDLE thread body if the BSP does
    175  * not provide one.
    176  *
    177  * This is intended to allow for supporting processors which have
    178  * a low power or idle mode.  When the IDLE thread is executed, then
    179  * the CPU can be powered down.
    180  *
    181  * The order of precedence for selecting the IDLE thread body is:
    182  *
    183  *   -#  BSP provided
    184  *   -#  CPU dependent (if provided)
    185  *   -#  generic (if no BSP and no CPU dependent)
    186  *
    187  * Port Specific Information:
    188  *
    189  * There does not appear to be a reason for the v850 port itself to provide
    190  * a special idle task.
    191  */
    192 #define CPU_PROVIDES_IDLE_THREAD_BODY    FALSE
    193166
    194167/**
     
    666639void _CPU_Initialize(void);
    667640
     641void *_CPU_Thread_Idle_body( uintptr_t ignored );
     642
    668643/**
    669644 * @addtogroup CPUContext
  • cpukit/score/cpu/x86_64/Makefile.am

    rb38887a r8776bb9  
    55libscorecpu_a_SOURCES += ../no_cpu/cpucounterfrequency.c
    66libscorecpu_a_SOURCES += ../no_cpu/cpucounterread.c
     7libscorecpu_a_SOURCES += ../no_cpu/cpuidle.c
    78libscorecpu_a_SOURCES += x86_64-context-initialize.c
    89libscorecpu_a_SOURCES += x86_64-context-switch.S
  • cpukit/score/cpu/x86_64/include/rtems/score/cpu.h

    rb38887a r8776bb9  
    5353#define CPU_USE_DEFERRED_FP_SWITCH       TRUE
    5454#define CPU_ENABLE_ROBUST_THREAD_DISPATCH FALSE
    55 #define CPU_PROVIDES_IDLE_THREAD_BODY    FALSE
    5655#define CPU_STACK_GROWS_UP               FALSE
    5756
  • testsuites/smptests/smpschededf04/init.c

    rb38887a r8776bb9  
    4242  (void) arg;
    4343
    44 #if CPU_PROVIDES_IDLE_THREAD_BODY == TRUE
    4544  _CPU_Thread_Idle_body(0);
    46 #else
    47   while (true) {
    48     /* Do nothing */
    49   }
    50 #endif
    5145}
    5246
  • testsuites/smptests/smpthreadpin01/init.c

    rb38887a r8776bb9  
    246246  (void) arg;
    247247
    248 #if CPU_PROVIDES_IDLE_THREAD_BODY == TRUE
    249248  _CPU_Thread_Idle_body(0);
    250 #else
    251   while (true) {
    252     /* Do nothing */
    253   }
    254 #endif
    255249}
    256250
Note: See TracChangeset for help on using the changeset viewer.