Index: testsuites/smptests/Makefile.am
===================================================================
--- testsuites/smptests/Makefile.am	(revision ba5de7531a031e25bff325fbee2e1d3922d3b5a7)
+++ testsuites/smptests/Makefile.am	(revision 57a00bc6afd25f5c41006b386627d087ff9d4c66)
@@ -28,4 +28,5 @@
 SUBDIRS += smpmrsp01
 SUBDIRS += smpmutex01
+SUBDIRS += smpmutex02
 SUBDIRS += smpschedaffinity01
 SUBDIRS += smpschedaffinity02
Index: testsuites/smptests/configure.ac
===================================================================
--- testsuites/smptests/configure.ac	(revision ba5de7531a031e25bff325fbee2e1d3922d3b5a7)
+++ testsuites/smptests/configure.ac	(revision 57a00bc6afd25f5c41006b386627d087ff9d4c66)
@@ -58,4 +58,5 @@
 # Explicitly list all Makefiles here
 AC_CONFIG_FILES([Makefile
+smpmutex02/Makefile
 smppsxmutex01/Makefile
 smpstrongapa01/Makefile
Index: testsuites/smptests/smpmutex02/Makefile.am
===================================================================
--- testsuites/smptests/smpmutex02/Makefile.am	(revision 57a00bc6afd25f5c41006b386627d087ff9d4c66)
+++ testsuites/smptests/smpmutex02/Makefile.am	(revision 57a00bc6afd25f5c41006b386627d087ff9d4c66)
@@ -0,0 +1,19 @@
+rtems_tests_PROGRAMS = smpmutex02
+smpmutex02_SOURCES = init.c
+
+dist_rtems_tests_DATA = smpmutex02.scn smpmutex02.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(smpmutex02_OBJECTS)
+LINK_LIBS = $(smpmutex02_LDLIBS)
+
+smpmutex02$(EXEEXT): $(smpmutex02_OBJECTS) $(smpmutex02_DEPENDENCIES)
+	@rm -f smpmutex02$(EXEEXT)
+	$(make-exe)
+
+include $(top_srcdir)/../automake/local.am
Index: testsuites/smptests/smpmutex02/init.c
===================================================================
--- testsuites/smptests/smpmutex02/init.c	(revision 57a00bc6afd25f5c41006b386627d087ff9d4c66)
+++ testsuites/smptests/smpmutex02/init.c	(revision 57a00bc6afd25f5c41006b386627d087ff9d4c66)
@@ -0,0 +1,440 @@
+/*
+ * Copyright (c) 2016 embedded brains GmbH.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Dornierstr. 4
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
+#include <inttypes.h>
+#include <string.h>
+#include <stdio.h>
+
+#include <rtems.h>
+#include <rtems/libcsupport.h>
+
+#include "tmacros.h"
+
+const char rtems_test_name[] = "SMPMUTEX 2";
+
+#define MTX_PER_CPU 12
+
+#define WORKER_PER_CPU 4
+
+#define CPU_COUNT 32
+
+#define MTX_COUNT (CPU_COUNT * MTX_PER_CPU)
+
+#define WORKER_COUNT (CPU_COUNT * WORKER_PER_CPU)
+
+typedef struct {
+  uint32_t obtain_counter;
+  uint32_t deadlock_counter;
+  uint32_t timeout_counter;
+  uint32_t release_counter;
+  uint32_t max_nest_level;
+} test_stats;
+
+typedef struct {
+  uint32_t cpu_count;
+  uint32_t mtx_count;
+  rtems_id worker_ids[CPU_COUNT][WORKER_PER_CPU];
+  rtems_id scheduler_ids[CPU_COUNT];
+  rtems_id mtx_ids[MTX_COUNT];
+  rtems_id counting_sem_id;
+  volatile bool stop_worker[WORKER_COUNT];
+  test_stats stats[WORKER_COUNT];
+} test_context;
+
+static test_context test_instance;
+
+static uint32_t simple_random(uint32_t v)
+{
+  v *= 1664525;
+  v += 1013904223;
+
+  return v;
+}
+
+typedef struct {
+  uint32_t guide;
+  size_t mtx_stack[MTX_COUNT];
+  bool mtx_owned[MTX_COUNT];
+  size_t nest_level;
+  test_stats stats;
+} worker_context;
+
+static void release(test_context *ctx, worker_context *wc, size_t nest_level)
+{
+  rtems_status_code sc;
+  size_t i;
+
+  --wc->nest_level;
+  ++wc->stats.release_counter;
+
+  i = wc->mtx_stack[wc->nest_level];
+  wc->mtx_owned[i] = false;
+
+  sc = rtems_semaphore_release(ctx->mtx_ids[i]);
+  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+}
+
+static void release_all(test_context *ctx, worker_context *wc)
+{
+  while (wc->nest_level > 0) {
+    release(ctx, wc, wc->nest_level);
+  }
+}
+
+static void worker(rtems_task_argument index)
+{
+  test_context *ctx;
+  worker_context wc;
+  rtems_status_code sc;
+
+  ctx = &test_instance;
+  memset(&wc, 0, sizeof(wc));
+  wc.guide = index;
+
+  while (!ctx->stop_worker[index]) {
+    uint32_t action;
+    uint32_t i;
+
+    if (wc.nest_level < ctx->mtx_count) {
+      action = (wc.guide >> 23) % 2;
+    } else {
+      action = UINT32_MAX;
+    }
+
+    i = (wc.guide >> 13) % ctx->mtx_count;
+
+    switch (action) {
+      case 0:
+        if ( !wc.mtx_owned[i] ) {
+          sc = rtems_semaphore_obtain(ctx->mtx_ids[i], RTEMS_WAIT, 1);
+
+          if (sc == RTEMS_SUCCESSFUL) {
+            wc.mtx_owned[i] = true;
+            wc.mtx_stack[wc.nest_level] = i;
+            ++wc.nest_level;
+            ++wc.stats.obtain_counter;
+
+            if (wc.nest_level > wc.stats.max_nest_level) {
+              wc.stats.max_nest_level = wc.nest_level;
+            }
+          } else if (sc == RTEMS_INCORRECT_STATE) {
+            ++wc.stats.deadlock_counter;
+            release_all(ctx, &wc);
+          } else if (sc == RTEMS_TIMEOUT) {
+            ++wc.stats.timeout_counter;
+            release_all(ctx, &wc);
+          } else {
+            rtems_test_assert(0);
+          }
+        }
+
+        break;
+      default:
+        if (wc.nest_level > 0) {
+          release(ctx, &wc, wc.nest_level);
+        }
+
+        break;
+    }
+
+    wc.guide = simple_random(wc.guide);
+  }
+
+  release_all(ctx, &wc);
+
+  ctx->stats[index] = wc.stats;
+
+  sc = rtems_semaphore_release(ctx->counting_sem_id);
+  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+
+  rtems_task_suspend(RTEMS_SELF);
+  rtems_test_assert(0);
+}
+
+static void set_up(test_context *ctx)
+{
+  rtems_status_code sc;
+  uint32_t i;
+
+  ctx->cpu_count = rtems_get_processor_count();
+  ctx->mtx_count = MTX_PER_CPU * ctx->cpu_count;
+
+  sc = rtems_semaphore_create(
+    rtems_build_name('S', 'Y', 'N', 'C'),
+    0,
+    RTEMS_COUNTING_SEMAPHORE,
+    0,
+    &ctx->counting_sem_id
+  );
+  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+
+  for (i = 0; i < ctx->mtx_count; ++i) {
+    sc = rtems_semaphore_create(
+      rtems_build_name('M', 'U', 'T', 'X'),
+      1,
+      RTEMS_BINARY_SEMAPHORE
+        | RTEMS_PRIORITY
+        | RTEMS_INHERIT_PRIORITY,
+      0,
+      &ctx->mtx_ids[i]
+    );
+    rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+  }
+
+  for (i = 0; i < ctx->cpu_count; ++i) {
+    size_t j;
+
+    sc = rtems_scheduler_ident(i, &ctx->scheduler_ids[i]);
+    rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+
+    for (j = 0; j < WORKER_PER_CPU; ++j) {
+      sc = rtems_task_create(
+        rtems_build_name('W', 'O', 'R', 'K'),
+        255,
+        RTEMS_MINIMUM_STACK_SIZE,
+        RTEMS_DEFAULT_MODES,
+        RTEMS_DEFAULT_ATTRIBUTES,
+        &ctx->worker_ids[i][j]
+      );
+      rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+
+      sc = rtems_task_set_scheduler(
+        ctx->worker_ids[i][j],
+        ctx->scheduler_ids[i],
+        2 + j
+      );
+      rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+
+      sc = rtems_task_start(
+        ctx->worker_ids[i][j],
+        worker,
+        i * WORKER_PER_CPU + j
+      );
+      rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+    }
+  }
+}
+
+static void run(test_context *ctx)
+{
+  rtems_status_code sc;
+  uint32_t i;
+
+  sc = rtems_task_wake_after(10 * rtems_clock_get_ticks_per_second());
+  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+
+  for (i = 0; i < WORKER_PER_CPU * ctx->cpu_count; ++i) {
+    ctx->stop_worker[i] = true;
+  }
+
+  for (i = 0; i < WORKER_PER_CPU * ctx->cpu_count; ++i) {
+    sc = rtems_semaphore_obtain(
+      ctx->counting_sem_id,
+      RTEMS_WAIT,
+      RTEMS_NO_TIMEOUT
+    );
+    rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+  }
+}
+
+static void tear_down(test_context *ctx)
+{
+  rtems_status_code sc;
+  uint32_t i;
+
+  for (i = 0; i < ctx->cpu_count; ++i) {
+    size_t j;
+
+    for (j = 0; j < WORKER_PER_CPU; ++j) {
+      sc = rtems_task_delete(ctx->worker_ids[i][j]);
+      rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+    }
+  }
+
+  for (i = 0; i < ctx->mtx_count; ++i) {
+    sc = rtems_semaphore_delete(ctx->mtx_ids[i]);
+    rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+  }
+
+  sc = rtems_semaphore_delete(ctx->counting_sem_id);
+  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+
+  for (i = 0; i < WORKER_PER_CPU * ctx->cpu_count; ++i) {
+    const test_stats *stats;
+
+    stats = &ctx->stats[i];
+
+    printf("worker[%" PRIu32 "][%" PRIu32 "]\n"
+      "\tobtain counter   = %" PRIu32 "\n"
+      "\tdeadlock counter = %" PRIu32 "\n"
+      "\ttimeout counter  = %" PRIu32 "\n"
+      "\trelease counter  = %" PRIu32 "\n"
+      "\tmax nest level   = %" PRIu32 "\n",
+      i / WORKER_PER_CPU,
+      i % WORKER_PER_CPU,
+      stats->obtain_counter,
+      stats->deadlock_counter,
+      stats->timeout_counter,
+      stats->release_counter,
+      stats->max_nest_level
+    );
+  }
+}
+
+static void Init(rtems_task_argument arg)
+{
+  test_context *ctx;
+  rtems_resource_snapshot snapshot;
+
+  TEST_BEGIN();
+  rtems_resource_snapshot_take(&snapshot);
+  ctx = &test_instance;
+
+  set_up(ctx);
+  run(ctx);
+  tear_down(ctx);
+
+  rtems_test_assert(rtems_resource_snapshot_check(&snapshot));
+  TEST_END();
+  rtems_test_exit(0);
+}
+
+#define CONFIGURE_MICROSECONDS_PER_TICK 1000
+
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS (1 + WORKER_COUNT)
+#define CONFIGURE_MAXIMUM_SEMAPHORES (1 + MTX_COUNT)
+
+#define CONFIGURE_SMP_APPLICATION
+
+#define CONFIGURE_SMP_MAXIMUM_PROCESSORS CPU_COUNT
+
+#define CONFIGURE_SCHEDULER_SIMPLE_SMP
+
+#include <rtems/scheduler.h>
+
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(0);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(1);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(2);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(3);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(4);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(5);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(6);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(7);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(8);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(9);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(10);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(11);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(12);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(13);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(14);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(15);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(16);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(17);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(18);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(19);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(20);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(21);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(22);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(23);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(24);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(25);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(26);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(27);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(28);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(29);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(30);
+RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(31);
+
+#define CONFIGURE_SCHEDULER_CONTROLS \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(0, 0), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(1, 1), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(2, 2), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(3, 3), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(4, 4), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(5, 5), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(6, 6), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(7, 7), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(8, 8), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(9, 9), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(10, 10), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(11, 11), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(12, 12), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(13, 13), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(14, 14), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(15, 15), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(16, 16), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(17, 17), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(18, 18), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(19, 19), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(20, 20), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(21, 21), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(22, 22), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(23, 23), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(24, 24), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(25, 25), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(26, 26), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(27, 27), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(28, 28), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(29, 29), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(30, 30), \
+  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(31, 31)
+
+#define CONFIGURE_SMP_SCHEDULER_ASSIGNMENTS \
+  RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY), \
+  RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(2, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(3, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(4, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(5, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(6, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(7, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(8, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(9, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(10, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(11, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(12, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(13, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(14, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(15, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(16, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(17, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(18, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(19, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(20, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(21, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(22, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(23, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(24, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(25, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(26, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(27, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(28, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(29, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(30, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+  RTEMS_SCHEDULER_ASSIGN(31, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL)
+
+#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
Index: testsuites/smptests/smpmutex02/smpmutex02.scn
===================================================================
--- testsuites/smptests/smpmutex02/smpmutex02.scn	(revision 57a00bc6afd25f5c41006b386627d087ff9d4c66)
+++ testsuites/smptests/smpmutex02/smpmutex02.scn	(revision 57a00bc6afd25f5c41006b386627d087ff9d4c66)
@@ -0,0 +1,578 @@
+*** BEGIN OF TEST SMPMUTEX 2 ***
+worker[0][0]
+        obtain counter   = 70927
+        deadlock counter = 2361
+        timeout counter  = 8899
+        release counter  = 70927
+        max nest level   = 18
+worker[0][1]
+        obtain counter   = 53520
+        deadlock counter = 1883
+        timeout counter  = 9008
+        release counter  = 53520
+        max nest level   = 15
+worker[0][2]
+        obtain counter   = 43356
+        deadlock counter = 1713
+        timeout counter  = 8980
+        release counter  = 43356
+        max nest level   = 17
+worker[0][3]
+        obtain counter   = 37021
+        deadlock counter = 1720
+        timeout counter  = 8872
+        release counter  = 37021
+        max nest level   = 15
+worker[1][0]
+        obtain counter   = 71848
+        deadlock counter = 2333
+        timeout counter  = 8955
+        release counter  = 71848
+        max nest level   = 26
+worker[1][1]
+        obtain counter   = 56056
+        deadlock counter = 2054
+        timeout counter  = 8947
+        release counter  = 56056
+        max nest level   = 21
+worker[1][2]
+        obtain counter   = 44337
+        deadlock counter = 1742
+        timeout counter  = 8989
+        release counter  = 44337
+        max nest level   = 17
+worker[1][3]
+        obtain counter   = 36720
+        deadlock counter = 1669
+        timeout counter  = 8977
+        release counter  = 36720
+        max nest level   = 15
+worker[2][0]
+        obtain counter   = 71989
+        deadlock counter = 2354
+        timeout counter  = 8907
+        release counter  = 71989
+        max nest level   = 20
+worker[2][1]
+        obtain counter   = 56226
+        deadlock counter = 1983
+        timeout counter  = 9041
+        release counter  = 56226
+        max nest level   = 17
+worker[2][2]
+        obtain counter   = 44707
+        deadlock counter = 1802
+        timeout counter  = 9002
+        release counter  = 44707
+        max nest level   = 19
+worker[2][3]
+        obtain counter   = 37093
+        deadlock counter = 1725
+        timeout counter  = 8929
+        release counter  = 37093
+        max nest level   = 18
+worker[3][0]
+        obtain counter   = 72282
+        deadlock counter = 2441
+        timeout counter  = 8904
+        release counter  = 72282
+        max nest level   = 15
+worker[3][1]
+        obtain counter   = 56242
+        deadlock counter = 2015
+        timeout counter  = 8932
+        release counter  = 56242
+        max nest level   = 20
+worker[3][2]
+        obtain counter   = 44578
+        deadlock counter = 1709
+        timeout counter  = 9000
+        release counter  = 44578
+        max nest level   = 15
+worker[3][3]
+        obtain counter   = 37890
+        deadlock counter = 1617
+        timeout counter  = 8941
+        release counter  = 37890
+        max nest level   = 17
+worker[4][0]
+        obtain counter   = 71584
+        deadlock counter = 2340
+        timeout counter  = 8953
+        release counter  = 71584
+        max nest level   = 17
+worker[4][1]
+        obtain counter   = 56388
+        deadlock counter = 1986
+        timeout counter  = 9005
+        release counter  = 56388
+        max nest level   = 20
+worker[4][2]
+        obtain counter   = 44549
+        deadlock counter = 1664
+        timeout counter  = 9005
+        release counter  = 44549
+        max nest level   = 14
+worker[4][3]
+        obtain counter   = 36954
+        deadlock counter = 1586
+        timeout counter  = 8906
+        release counter  = 36954
+        max nest level   = 15
+worker[5][0]
+        obtain counter   = 71175
+        deadlock counter = 2290
+        timeout counter  = 8872
+        release counter  = 71175
+        max nest level   = 18
+worker[5][1]
+        obtain counter   = 55984
+        deadlock counter = 1904
+        timeout counter  = 8948
+        release counter  = 55984
+        max nest level   = 17
+worker[5][2]
+        obtain counter   = 43837
+        deadlock counter = 1712
+        timeout counter  = 9011
+        release counter  = 43837
+        max nest level   = 18
+worker[5][3]
+        obtain counter   = 37015
+        deadlock counter = 1613
+        timeout counter  = 9001
+        release counter  = 37015
+        max nest level   = 16
+worker[6][0]
+        obtain counter   = 72469
+        deadlock counter = 2494
+        timeout counter  = 8888
+        release counter  = 72469
+        max nest level   = 17
+worker[6][1]
+        obtain counter   = 56906
+        deadlock counter = 2038
+        timeout counter  = 8995
+        release counter  = 56906
+        max nest level   = 18
+worker[6][2]
+        obtain counter   = 45295
+        deadlock counter = 1825
+        timeout counter  = 8997
+        release counter  = 45295
+        max nest level   = 17
+worker[6][3]
+        obtain counter   = 37125
+        deadlock counter = 1685
+        timeout counter  = 8924
+        release counter  = 37125
+        max nest level   = 20
+worker[7][0]
+        obtain counter   = 72568
+        deadlock counter = 2401
+        timeout counter  = 8908
+        release counter  = 72568
+        max nest level   = 18
+worker[7][1]
+        obtain counter   = 56386
+        deadlock counter = 2031
+        timeout counter  = 8941
+        release counter  = 56386
+        max nest level   = 16
+worker[7][2]
+        obtain counter   = 44724
+        deadlock counter = 1758
+        timeout counter  = 8964
+        release counter  = 44724
+        max nest level   = 15
+worker[7][3]
+        obtain counter   = 36921
+        deadlock counter = 1593
+        timeout counter  = 9012
+        release counter  = 36921
+        max nest level   = 17
+worker[8][0]
+        obtain counter   = 72557
+        deadlock counter = 2417
+        timeout counter  = 8913
+        release counter  = 72557
+        max nest level   = 18
+worker[8][1]
+        obtain counter   = 55802
+        deadlock counter = 1923
+        timeout counter  = 8996
+        release counter  = 55802
+        max nest level   = 15
+worker[8][2]
+        obtain counter   = 45056
+        deadlock counter = 1739
+        timeout counter  = 8987
+        release counter  = 45056
+        max nest level   = 19
+worker[8][3]
+        obtain counter   = 36447
+        deadlock counter = 1504
+        timeout counter  = 8953
+        release counter  = 36447
+        max nest level   = 14
+worker[9][0]
+        obtain counter   = 71687
+        deadlock counter = 2440
+        timeout counter  = 8928
+        release counter  = 71687
+        max nest level   = 21
+worker[9][1]
+        obtain counter   = 55724
+        deadlock counter = 1993
+        timeout counter  = 8990
+        release counter  = 55724
+        max nest level   = 15
+worker[9][2]
+        obtain counter   = 45466
+        deadlock counter = 1759
+        timeout counter  = 8978
+        release counter  = 45466
+        max nest level   = 18
+worker[9][3]
+        obtain counter   = 36047
+        deadlock counter = 1653
+        timeout counter  = 9020
+        release counter  = 36047
+        max nest level   = 16
+worker[10][0]
+        obtain counter   = 71471
+        deadlock counter = 2469
+        timeout counter  = 8967
+        release counter  = 71471
+        max nest level   = 17
+worker[10][1]
+        obtain counter   = 55790
+        deadlock counter = 1935
+        timeout counter  = 8983
+        release counter  = 55790
+        max nest level   = 18
+worker[10][2]
+        obtain counter   = 44360
+        deadlock counter = 1730
+        timeout counter  = 8997
+        release counter  = 44360
+        max nest level   = 17
+worker[10][3]
+        obtain counter   = 37076
+        deadlock counter = 1685
+        timeout counter  = 8940
+        release counter  = 37076
+        max nest level   = 14
+worker[11][0]
+        obtain counter   = 72227
+        deadlock counter = 2461
+        timeout counter  = 8892
+        release counter  = 72227
+        max nest level   = 19
+worker[11][1]
+        obtain counter   = 55759
+        deadlock counter = 2005
+        timeout counter  = 8984
+        release counter  = 55759
+        max nest level   = 19
+worker[11][2]
+        obtain counter   = 44028
+        deadlock counter = 1715
+        timeout counter  = 9034
+        release counter  = 44028
+        max nest level   = 16
+worker[11][3]
+        obtain counter   = 37660
+        deadlock counter = 1668
+        timeout counter  = 8902
+        release counter  = 37660
+        max nest level   = 16
+worker[12][0]
+        obtain counter   = 71641
+        deadlock counter = 2401
+        timeout counter  = 8916
+        release counter  = 71641
+        max nest level   = 21
+worker[12][1]
+        obtain counter   = 55895
+        deadlock counter = 2018
+        timeout counter  = 9036
+        release counter  = 55895
+        max nest level   = 18
+worker[12][2]
+        obtain counter   = 43912
+        deadlock counter = 1704
+        timeout counter  = 9063
+        release counter  = 43912
+        max nest level   = 16
+worker[12][3]
+        obtain counter   = 36770
+        deadlock counter = 1584
+        timeout counter  = 8978
+        release counter  = 36770
+        max nest level   = 15
+worker[13][0]
+        obtain counter   = 72814
+        deadlock counter = 2438
+        timeout counter  = 8870
+        release counter  = 72814
+        max nest level   = 23
+worker[13][1]
+        obtain counter   = 55358
+        deadlock counter = 1935
+        timeout counter  = 8993
+        release counter  = 55358
+        max nest level   = 16
+worker[13][2]
+        obtain counter   = 44325
+        deadlock counter = 1745
+        timeout counter  = 9051
+        release counter  = 44325
+        max nest level   = 16
+worker[13][3]
+        obtain counter   = 36667
+        deadlock counter = 1673
+        timeout counter  = 8967
+        release counter  = 36667
+        max nest level   = 19
+worker[14][0]
+        obtain counter   = 72571
+        deadlock counter = 2355
+        timeout counter  = 8915
+        release counter  = 72571
+        max nest level   = 19
+worker[14][1]
+        obtain counter   = 56524
+        deadlock counter = 2072
+        timeout counter  = 8974
+        release counter  = 56524
+        max nest level   = 18
+worker[14][2]
+        obtain counter   = 44640
+        deadlock counter = 1714
+        timeout counter  = 9031
+        release counter  = 44640
+        max nest level   = 17
+worker[14][3]
+        obtain counter   = 36801
+        deadlock counter = 1678
+        timeout counter  = 8939
+        release counter  = 36801
+        max nest level   = 15
+worker[15][0]
+        obtain counter   = 72194
+        deadlock counter = 2457
+        timeout counter  = 8894
+        release counter  = 72194
+        max nest level   = 17
+worker[15][1]
+        obtain counter   = 56464
+        deadlock counter = 2082
+        timeout counter  = 8926
+        release counter  = 56464
+        max nest level   = 17
+worker[15][2]
+        obtain counter   = 44914
+        deadlock counter = 1751
+        timeout counter  = 8995
+        release counter  = 44914
+        max nest level   = 16
+worker[15][3]
+        obtain counter   = 36738
+        deadlock counter = 1642
+        timeout counter  = 8927
+        release counter  = 36738
+        max nest level   = 14
+worker[16][0]
+        obtain counter   = 72411
+        deadlock counter = 2441
+        timeout counter  = 8942
+        release counter  = 72411
+        max nest level   = 17
+worker[16][1]
+        obtain counter   = 56534
+        deadlock counter = 1984
+        timeout counter  = 9003
+        release counter  = 56534
+        max nest level   = 21
+worker[16][2]
+        obtain counter   = 44506
+        deadlock counter = 1796
+        timeout counter  = 9024
+        release counter  = 44506
+        max nest level   = 20
+worker[16][3]
+        obtain counter   = 36265
+        deadlock counter = 1612
+        timeout counter  = 8951
+        release counter  = 36265
+        max nest level   = 14
+worker[17][0]
+        obtain counter   = 72031
+        deadlock counter = 2436
+        timeout counter  = 8883
+        release counter  = 72031
+        max nest level   = 18
+worker[17][1]
+        obtain counter   = 55833
+        deadlock counter = 2020
+        timeout counter  = 8932
+        release counter  = 55833
+        max nest level   = 19
+worker[17][2]
+        obtain counter   = 44293
+        deadlock counter = 1749
+        timeout counter  = 8991
+        release counter  = 44293
+        max nest level   = 15
+worker[17][3]
+        obtain counter   = 36570
+        deadlock counter = 1629
+        timeout counter  = 8961
+        release counter  = 36570
+        max nest level   = 17
+worker[18][0]
+        obtain counter   = 72279
+        deadlock counter = 2382
+        timeout counter  = 8943
+        release counter  = 72279
+        max nest level   = 21
+worker[18][1]
+        obtain counter   = 56824
+        deadlock counter = 1896
+        timeout counter  = 8969
+        release counter  = 56824
+        max nest level   = 17
+worker[18][2]
+        obtain counter   = 44426
+        deadlock counter = 1799
+        timeout counter  = 8995
+        release counter  = 44426
+        max nest level   = 15
+worker[18][3]
+        obtain counter   = 36913
+        deadlock counter = 1652
+        timeout counter  = 8965
+        release counter  = 36913
+        max nest level   = 15
+worker[19][0]
+        obtain counter   = 72256
+        deadlock counter = 2384
+        timeout counter  = 8871
+        release counter  = 72256
+        max nest level   = 20
+worker[19][1]
+        obtain counter   = 55654
+        deadlock counter = 1955
+        timeout counter  = 9031
+        release counter  = 55654
+        max nest level   = 18
+worker[19][2]
+        obtain counter   = 44389
+        deadlock counter = 1771
+        timeout counter  = 8924
+        release counter  = 44389
+        max nest level   = 15
+worker[19][3]
+        obtain counter   = 36989
+        deadlock counter = 1598
+        timeout counter  = 8986
+        release counter  = 36989
+        max nest level   = 25
+worker[20][0]
+        obtain counter   = 72483
+        deadlock counter = 2442
+        timeout counter  = 8919
+        release counter  = 72483
+        max nest level   = 24
+worker[20][1]
+        obtain counter   = 56443
+        deadlock counter = 2022
+        timeout counter  = 8961
+        release counter  = 56443
+        max nest level   = 16
+worker[20][2]
+        obtain counter   = 44808
+        deadlock counter = 1657
+        timeout counter  = 9014
+        release counter  = 44808
+        max nest level   = 21
+worker[20][3]
+        obtain counter   = 37291
+        deadlock counter = 1677
+        timeout counter  = 8951
+        release counter  = 37291
+        max nest level   = 16
+worker[21][0]
+        obtain counter   = 71273
+        deadlock counter = 2411
+        timeout counter  = 8993
+        release counter  = 71273
+        max nest level   = 19
+worker[21][1]
+        obtain counter   = 54909
+        deadlock counter = 1890
+        timeout counter  = 8962
+        release counter  = 54909
+        max nest level   = 19
+worker[21][2]
+        obtain counter   = 44204
+        deadlock counter = 1679
+        timeout counter  = 9020
+        release counter  = 44204
+        max nest level   = 14
+worker[21][3]
+        obtain counter   = 36518
+        deadlock counter = 1552
+        timeout counter  = 8979
+        release counter  = 36518
+        max nest level   = 16
+worker[22][0]
+        obtain counter   = 72498
+        deadlock counter = 2344
+        timeout counter  = 8896
+        release counter  = 72498
+        max nest level   = 19
+worker[22][1]
+        obtain counter   = 55781
+        deadlock counter = 1906
+        timeout counter  = 8982
+        release counter  = 55781
+        max nest level   = 18
+worker[22][2]
+        obtain counter   = 44470
+        deadlock counter = 1690
+        timeout counter  = 9105
+        release counter  = 44470
+        max nest level   = 16
+worker[22][3]
+        obtain counter   = 36557
+        deadlock counter = 1576
+        timeout counter  = 9007
+        release counter  = 36557
+        max nest level   = 14
+worker[23][0]
+        obtain counter   = 71527
+        deadlock counter = 2297
+        timeout counter  = 8942
+        release counter  = 71527
+        max nest level   = 17
+worker[23][1]
+        obtain counter   = 55507
+        deadlock counter = 1993
+        timeout counter  = 8984
+        release counter  = 55507
+        max nest level   = 18
+worker[23][2]
+        obtain counter   = 44780
+        deadlock counter = 1795
+        timeout counter  = 8999
+        release counter  = 44780
+        max nest level   = 15
+worker[23][3]
+        obtain counter   = 36690
+        deadlock counter = 1639
+        timeout counter  = 8977
+        release counter  = 36690
+        max nest level   = 15
+*** END OF TEST SMPMUTEX 2 ***
