Changeset 6f6cf785 in rtems


Ignore:
Timestamp:
Jul 5, 2016, 7:04:15 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
814bd6e3
Parents:
008efaf
git-author:
Sebastian Huber <sebastian.huber@…> (07/05/16 07:04:15)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/06/16 07:33:32)
Message:

score: Postpone SMP shutdown in _Terminate()

This enables fatal extensions to continue program execution after some
fatal errors.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/src/interr.c

    r008efaf r6f6cf785  
    3434)
    3535{
    36   _SMP_Request_shutdown();
    37 
    3836  _User_extensions_Fatal( the_source, is_internal, the_error );
    3937
     
    4442  _System_state_Set( SYSTEM_STATE_TERMINATED );
    4543
     44  _SMP_Request_shutdown();
     45
    4646  _CPU_Fatal_halt( the_source, the_error );
    4747
  • cpukit/score/src/smp.c

    r008efaf r6f6cf785  
    159159void _SMP_Request_shutdown( void )
    160160{
    161   Per_CPU_Control *self_cpu = _Per_CPU_Get();
    162 
    163   _Per_CPU_State_change( self_cpu, PER_CPU_STATE_SHUTDOWN );
     161  ISR_Level level;
     162
     163  _ISR_Local_disable( level );
     164  (void) level;
     165
     166  _Per_CPU_State_change( _Per_CPU_Get(), PER_CPU_STATE_SHUTDOWN );
    164167}
    165168
  • testsuites/smptests/smpfatal02/init.c

    r008efaf r6f6cf785  
    11/*
    2  * Copyright (c) 2014 embedded brains GmbH.  All rights reserved.
     2 * Copyright (c) 2014, 2016 embedded brains GmbH.  All rights reserved.
    33 *
    44 *  embedded brains GmbH
     
    4848{
    4949  SMP_barrier_State barrier_state = SMP_BARRIER_STATE_INITIALIZER;
     50  uint32_t self = rtems_get_current_processor();
    5051
    51   if (
    52     source == RTEMS_FATAL_SOURCE_APPLICATION
    53       || source == RTEMS_FATAL_SOURCE_SMP
    54   ) {
    55     uint32_t self = rtems_get_current_processor();
     52  assert(!is_internal);
    5653
    57     assert(!is_internal);
     54  if ( source == RTEMS_FATAL_SOURCE_APPLICATION ) {
     55    uint32_t cpu;
    5856
    59     if (self == main_cpu) {
    60       uint32_t cpu;
     57    assert(self == main_cpu);
     58    assert(code == 0xdeadbeef);
    6159
    62       assert(source == RTEMS_FATAL_SOURCE_APPLICATION);
    63       assert(code == 0xdeadbeef);
     60    _SMP_Request_shutdown();
    6461
    65       for (cpu = 0; cpu < MAX_CPUS; ++cpu) {
    66         const Per_CPU_Control *per_cpu = _Per_CPU_Get_by_index( cpu );
    67         Per_CPU_State state = per_cpu->state;
     62    for (cpu = 0; cpu < MAX_CPUS; ++cpu) {
     63      const Per_CPU_Control *per_cpu = _Per_CPU_Get_by_index( cpu );
     64      Per_CPU_State state = per_cpu->state;
    6865
    69         assert(state == PER_CPU_STATE_SHUTDOWN);
    70       }
     66      assert(state == PER_CPU_STATE_SHUTDOWN);
     67    }
    7168
    72       TEST_END();
    73     } else {
    74       assert(source == RTEMS_FATAL_SOURCE_SMP);
    75       assert(code == SMP_FATAL_SHUTDOWN);
    76     }
     69    TEST_END();
     70  } else if ( source == RTEMS_FATAL_SOURCE_SMP ) {
     71    assert(self != main_cpu);
     72    assert(code == SMP_FATAL_SHUTDOWN);
    7773  }
    7874
Note: See TracChangeset for help on using the changeset viewer.