From ceb0f6597c36fabbfcbdf0807fd87dd03a45cc5e Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 17 May 2016 16:03:46 +0200 Subject: score: Remove the Giant lock Update #2555. --- testsuites/smptests/smpfatal03/Makefile.am | 19 ---- testsuites/smptests/smpfatal03/init.c | 151 -------------------------- testsuites/smptests/smpfatal03/smpfatal03.doc | 12 -- testsuites/smptests/smpfatal03/smpfatal03.scn | 2 - 4 files changed, 184 deletions(-) delete mode 100644 testsuites/smptests/smpfatal03/Makefile.am delete mode 100644 testsuites/smptests/smpfatal03/init.c delete mode 100644 testsuites/smptests/smpfatal03/smpfatal03.doc delete mode 100644 testsuites/smptests/smpfatal03/smpfatal03.scn (limited to 'testsuites/smptests/smpfatal03') diff --git a/testsuites/smptests/smpfatal03/Makefile.am b/testsuites/smptests/smpfatal03/Makefile.am deleted file mode 100644 index 4ec2862357..0000000000 --- a/testsuites/smptests/smpfatal03/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -rtems_tests_PROGRAMS = smpfatal03 -smpfatal03_SOURCES = init.c - -dist_rtems_tests_DATA = smpfatal03.scn smpfatal03.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 = $(smpfatal03_OBJECTS) -LINK_LIBS = $(smpfatal03_LDLIBS) - -smpfatal03$(EXEEXT): $(smpfatal03_OBJECTS) $(smpfatal03_DEPENDENCIES) - @rm -f smpfatal03$(EXEEXT) - $(make-exe) - -include $(top_srcdir)/../automake/local.am diff --git a/testsuites/smptests/smpfatal03/init.c b/testsuites/smptests/smpfatal03/init.c deleted file mode 100644 index 2f3980bfe5..0000000000 --- a/testsuites/smptests/smpfatal03/init.c +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Copyright (c) 2014 embedded brains GmbH. All rights reserved. - * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * - * - * 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 -#include -#include -#include -#include -#include - -#include -#include - -const char rtems_test_name[] = "SMPFATAL 3"; - -#define CPU_COUNT 2 - -static uint32_t main_cpu; - -static SMP_barrier_Control giant_barrier = SMP_BARRIER_CONTROL_INITIALIZER; - -static SMP_barrier_Control fatal_barrier = SMP_BARRIER_CONTROL_INITIALIZER; - -static void acquire_giant_and_fatal_task(rtems_task_argument arg) -{ - SMP_barrier_State state = SMP_BARRIER_STATE_INITIALIZER; - int i; - - for (i = 0; i < 13; ++i) { - _Giant_Acquire(); - } - - _SMP_barrier_Wait(&giant_barrier, &state, CPU_COUNT); - - /* - * Now we have to wait some time so that the other thread can actually start - * with the _Giant_Acquire() procedure. - */ - rtems_counter_delay_nanoseconds(1000000); - - rtems_fatal(RTEMS_FATAL_SOURCE_APPLICATION, 0xdeadbeef); -} - -static void wait_for_giant(void) -{ - SMP_barrier_State state = SMP_BARRIER_STATE_INITIALIZER; - - _SMP_barrier_Wait(&giant_barrier, &state, CPU_COUNT); - - _Giant_Release(); -} - -static void Init(rtems_task_argument arg) -{ - uint32_t self = rtems_get_current_processor(); - uint32_t cpu_count = rtems_get_processor_count(); - - rtems_test_begink(); - - main_cpu = self; - - if (cpu_count >= CPU_COUNT) { - rtems_status_code sc; - rtems_id id; - - sc = rtems_task_create( - rtems_build_name( 'W', 'A', 'I', 'T' ), - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - assert(sc == RTEMS_SUCCESSFUL); - - sc = rtems_task_start(id, acquire_giant_and_fatal_task, 0); - assert(sc == RTEMS_SUCCESSFUL); - - wait_for_giant(); - } else { - rtems_test_endk(); - exit(0); - } -} - -static void fatal_extension( - rtems_fatal_source source, - bool is_internal, - rtems_fatal_code code -) -{ - if ( - source == RTEMS_FATAL_SOURCE_APPLICATION - || source == RTEMS_FATAL_SOURCE_SMP - ) { - uint32_t self = rtems_get_current_processor(); - SMP_barrier_State state = SMP_BARRIER_STATE_INITIALIZER; - - assert(!is_internal); - - if (self == main_cpu) { - assert(source == RTEMS_FATAL_SOURCE_SMP); - assert(code == SMP_FATAL_SHUTDOWN_RESPONSE); - } else { - assert(source == RTEMS_FATAL_SOURCE_APPLICATION); - assert(code == 0xdeadbeef); - } - - _SMP_barrier_Wait(&fatal_barrier, &state, CPU_COUNT); - - if (self == 0) { - rtems_test_endk(); - } - - _SMP_barrier_Wait(&fatal_barrier, &state, CPU_COUNT); - } -} - -#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER - -#define CONFIGURE_INITIAL_EXTENSIONS \ - { .fatal = fatal_extension }, \ - RTEMS_TEST_INITIAL_EXTENSION - -#define CONFIGURE_SMP_APPLICATION - -#define CONFIGURE_SMP_MAXIMUM_PROCESSORS CPU_COUNT - -#define CONFIGURE_MAXIMUM_TASKS 2 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_INIT - -#include diff --git a/testsuites/smptests/smpfatal03/smpfatal03.doc b/testsuites/smptests/smpfatal03/smpfatal03.doc deleted file mode 100644 index 5c5a8bae77..0000000000 --- a/testsuites/smptests/smpfatal03/smpfatal03.doc +++ /dev/null @@ -1,12 +0,0 @@ -This file describes the directives and concepts tested by this test set. - -test set name: smpfatal03 - -directives: - - - _Terminate() - -concepts: - - - Ensure that _Terminate() drops the Giant lock so that other processors - waiting on the Giant lock can receive shutdown requests. diff --git a/testsuites/smptests/smpfatal03/smpfatal03.scn b/testsuites/smptests/smpfatal03/smpfatal03.scn deleted file mode 100644 index f502b4e816..0000000000 --- a/testsuites/smptests/smpfatal03/smpfatal03.scn +++ /dev/null @@ -1,2 +0,0 @@ -*** TEST SMPFATAL 3 *** -*** END OF TEST SMPFATAL 3 *** -- cgit v1.2.3