Ejemplo n.º 1
0
void _SMP_Request_other_cores_to_shutdown(void)
{
  bool   allDown;
  int    ncpus;
  int    n;
  int    cpu;

  cpu   = bsp_smp_processor_id();
  ncpus = _SMP_Processor_count;

  _SMP_Broadcast_message( RTEMS_BSP_SMP_SHUTDOWN );

  allDown = true;
  for (n=0 ; n<ncpus ; n++ ) {
     if ( n == cpu ) 
       continue;
     bsp_smp_wait_for(
       (unsigned int *)&_Per_CPU_Information[n].state,
       RTEMS_BSP_SMP_CPU_SHUTDOWN,
       10000
    );
    if ( _Per_CPU_Information[n].state != RTEMS_BSP_SMP_CPU_SHUTDOWN )
      allDown = false;
  }
  if ( !allDown )
    printk( "not all down -- timed out\n" );
  #if defined(RTEMS_DEBUG)
    else
      printk( "All CPUs shutdown successfully\n" );
  #endif
}
Ejemplo n.º 2
0
void _SMP_Request_other_cores_to_shutdown( void )
{
  uint32_t self = _SMP_Get_current_processor();
  uint32_t ncpus = _SMP_Get_processor_count();
  uint32_t cpu;

  _SMP_Broadcast_message( RTEMS_BSP_SMP_SHUTDOWN );

  for ( cpu = 0 ; cpu < ncpus ; ++cpu ) {
    if ( cpu != self ) {
      _Per_CPU_Wait_for_state(
        _Per_CPU_Get_by_index( cpu ),
        PER_CPU_STATE_SHUTDOWN
      );
    }
  }
}