Changeset 6f6cf785 in rtems for testsuites/smptests


Ignore:
Timestamp:
Jul 5, 2016, 7:04:15 AM (4 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.