summaryrefslogtreecommitdiffstats
path: root/testsuites/smptests
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-07-05 09:04:15 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-07-06 09:33:32 +0200
commit6f6cf78501d8d953983dfc68d5ec83f78856be92 (patch)
tree6c07a3e75331327c982df111548d7769fb5fbfa9 /testsuites/smptests
parentscore: Do not disable ISR in _Terminate() (diff)
downloadrtems-6f6cf78501d8d953983dfc68d5ec83f78856be92.tar.bz2
score: Postpone SMP shutdown in _Terminate()
This enables fatal extensions to continue program execution after some fatal errors.
Diffstat (limited to 'testsuites/smptests')
-rw-r--r--testsuites/smptests/smpfatal02/init.c38
1 files changed, 17 insertions, 21 deletions
diff --git a/testsuites/smptests/smpfatal02/init.c b/testsuites/smptests/smpfatal02/init.c
index 71fff0c580..ae075ec694 100644
--- a/testsuites/smptests/smpfatal02/init.c
+++ b/testsuites/smptests/smpfatal02/init.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2014, 2016 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
* Dornierstr. 4
@@ -47,33 +47,29 @@ static void fatal_extension(
)
{
SMP_barrier_State barrier_state = SMP_BARRIER_STATE_INITIALIZER;
+ uint32_t self = rtems_get_current_processor();
- if (
- source == RTEMS_FATAL_SOURCE_APPLICATION
- || source == RTEMS_FATAL_SOURCE_SMP
- ) {
- uint32_t self = rtems_get_current_processor();
-
- assert(!is_internal);
+ assert(!is_internal);
- if (self == main_cpu) {
- uint32_t cpu;
+ if ( source == RTEMS_FATAL_SOURCE_APPLICATION ) {
+ uint32_t cpu;
- assert(source == RTEMS_FATAL_SOURCE_APPLICATION);
- assert(code == 0xdeadbeef);
+ assert(self == main_cpu);
+ assert(code == 0xdeadbeef);
- for (cpu = 0; cpu < MAX_CPUS; ++cpu) {
- const Per_CPU_Control *per_cpu = _Per_CPU_Get_by_index( cpu );
- Per_CPU_State state = per_cpu->state;
+ _SMP_Request_shutdown();
- assert(state == PER_CPU_STATE_SHUTDOWN);
- }
+ for (cpu = 0; cpu < MAX_CPUS; ++cpu) {
+ const Per_CPU_Control *per_cpu = _Per_CPU_Get_by_index( cpu );
+ Per_CPU_State state = per_cpu->state;
- TEST_END();
- } else {
- assert(source == RTEMS_FATAL_SOURCE_SMP);
- assert(code == SMP_FATAL_SHUTDOWN);
+ assert(state == PER_CPU_STATE_SHUTDOWN);
}
+
+ TEST_END();
+ } else if ( source == RTEMS_FATAL_SOURCE_SMP ) {
+ assert(self != main_cpu);
+ assert(code == SMP_FATAL_SHUTDOWN);
}
_SMP_barrier_Wait(&barrier, &barrier_state, rtems_get_processor_count());