Changeset e3be691 in rtems


Ignore:
Timestamp:
May 27, 2013, 3:31:46 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
7c5ceea5
Parents:
17e09f8
git-author:
Sebastian Huber <sebastian.huber@…> (05/27/13 15:31:46)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/31/13 13:20:31)
Message:

score: Remove idle field of Per_CPU_Control

This field is unused except for special case simulator clock drivers.
In these places use an alternative. Add and use
_Thread_Set_global_exit_status() and _Thread_Get_global_exit_status().

Files:
9 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/shared/clockdrv_shell.h

    r17e09f8 re3be691  
    7474    do {
    7575      rtems_clock_tick();
    76     } while ( _Thread_Executing == _Thread_Idle &&
    77             _Thread_Heir == _Thread_Executing);
     76    } while (
     77      _Thread_Heir == _Thread_Executing
     78        && _Thread_Executing->Start.entry_point
     79          == rtems_configuration_get_idle_task()
     80    );
    7881
    7982    Clock_driver_support_at_tick();
  • c/src/lib/libcpu/bfin/clock/clock.c

    r17e09f8 re3be691  
    4040  do {
    4141    rtems_clock_tick();
    42   } while (_Thread_Executing == _Thread_Idle &&
    43            _Thread_Heir == _Thread_Executing);
     42  } while (
     43    _Thread_Heir == _Thread_Executing
     44      && _Thread_Executing->Start.entry_point
     45        == rtems_configuration_get_idle_task()
     46  );
    4447#else
    4548  rtems_clock_tick();
  • c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.c

    r17e09f8 re3be691  
    9999    do {
    100100      rtems_clock_tick();
    101     } while ( _Thread_Executing == _Thread_Idle &&
    102               _Thread_Heir == _Thread_Executing);
     101    } while (
     102      _Thread_Heir == _Thread_Executing
     103        && _Thread_Executing->Start.entry_point
     104          == rtems_configuration_get_idle_task()
     105    );
    103106
    104107  #else
  • cpukit/sapi/src/exinit.c

    r17e09f8 re3be691  
    238238   *******************************************************************
    239239   *******************************************************************/
    240  
    241   status = _Per_CPU_Information[0].idle->Wait.return_code;
     240
     241  status = _Thread_Get_global_exit_status();
    242242  rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, status );
    243243}
  • cpukit/sapi/src/exshutdown.c

    r17e09f8 re3be691  
    4545    #endif
    4646
    47     _Per_CPU_Information[0].idle->Wait.return_code = result;
    48 
     47    _Thread_Set_global_exit_status( result );
    4948    _System_state_Set( SYSTEM_STATE_SHUTDOWN );
    5049    _Thread_Stop_multitasking();
  • cpukit/score/include/rtems/score/percpu.h

    r17e09f8 re3be691  
    163163  Thread_Control *heir;
    164164
    165   /** This is the idle thread for this CPU. */
    166   Thread_Control *idle;
    167 
    168165  /** This is the time of the last context switch on this CPU. */
    169166  Timestamp_Control time_of_last_context_switch;
     
    284281#define _Thread_Executing \
    285282  _Per_CPU_Information[bsp_smp_processor_id()].executing
    286 #define _Thread_Idle \
    287   _Per_CPU_Information[bsp_smp_processor_id()].idle
    288283#define _ISR_Nest_level \
    289284  _Per_CPU_Information[bsp_smp_processor_id()].isr_nest_level
  • cpukit/score/inline/rtems/score/thread.inl

    r17e09f8 re3be691  
    345345}
    346346
     347RTEMS_INLINE_ROUTINE void _Thread_Set_global_exit_status(
     348  uint32_t exit_status
     349)
     350{
     351  Thread_Control *idle = (Thread_Control *)
     352    _Thread_Internal_information.local_table[ 1 ];
     353
     354  idle->Wait.return_code = exit_status;
     355}
     356
     357RTEMS_INLINE_ROUTINE uint32_t _Thread_Get_global_exit_status( void )
     358{
     359  const Thread_Control *idle = (const Thread_Control *)
     360    _Thread_Internal_information.local_table[ 1 ];
     361
     362  return idle->Wait.return_code;
     363}
     364
    347365/**
    348366 * This routine returns the C library re-enterant pointer.
  • cpukit/score/src/threadcreateidle.c

    r17e09f8 re3be691  
    4141)
    4242{
    43   Objects_Name    name;
    44   Thread_Control *idle;
     43  Per_CPU_Control *per_cpu;
     44  Objects_Name     name;
     45  Thread_Control  *idle;
    4546
     47  per_cpu = &_Per_CPU_Information[ cpu ];
    4648  name.name_u32 = name_u32;
    4749
     
    8082   *             MUST be done before _Thread_Start is invoked.
    8183   */
    82   _Per_CPU_Information[ cpu ].idle      =
    83   _Per_CPU_Information[ cpu ].heir      =
    84   _Per_CPU_Information[ cpu ].executing = idle;
     84  per_cpu->heir      =
     85  per_cpu->executing = idle;
    8586
    8687  _Thread_Start(
  • testsuites/sptests/spsimplesched02/init.c

    r17e09f8 re3be691  
    2222 *  Keep the names and IDs in global variables so another task can use them.
    2323 */
     24rtems_id   Idle_id;
    2425rtems_id   Task_id[ 3 ];         /* array of task ids */
    2526rtems_name Task_name[ 3 ];       /* array of task names */
     
    4950  if (suspendIdle) {
    5051    puts( "INIT - Suspend Idle Task");
    51     status = rtems_task_suspend( _Thread_Idle->Object.id );
     52    status = rtems_task_suspend( Idle_id );
    5253    directive_failed( status, "rtems_task_suspend idle" );
    5354  }
     
    6364  if (suspendIdle) {
    6465    puts( "INIT - Resume Idle Task");
    65     status = rtems_task_resume( _Thread_Idle->Object.id );
     66    status = rtems_task_resume( Idle_id );
    6667    directive_failed( status, "rtems_task_resume idle" );
    6768  }
     
    7576
    7677  puts( "\n\n*** SIMPLE SCHEDULER 02 TEST ***" );
     78
     79  status = _Objects_Name_to_id_u32(
     80    &_Thread_Internal_information,
     81    rtems_build_name( 'I', 'D', 'L', 'E' ),
     82    RTEMS_SEARCH_LOCAL_NODE,
     83    &Idle_id
     84  );
     85  rtems_test_assert( status == RTEMS_SUCCESSFUL );
    7786
    7887  /*
Note: See TracChangeset for help on using the changeset viewer.