[PATCH 06/13] sptests: Remove obsolete semaphore consume driver

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Nov 8 14:02:54 UTC 2019


This driver is no longer used by a test program.

Update #3818.
---
 testsuites/sptests/Makefile.am                    | 16 +-----
 testsuites/sptests/spfatal_support/consume_sems.c | 63 -----------------------
 testsuites/sptests/spfatal_support/system.h       | 11 ----
 3 files changed, 2 insertions(+), 88 deletions(-)
 delete mode 100644 testsuites/sptests/spfatal_support/consume_sems.c

diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
index a86b438d61..4d033f6c53 100644
--- a/testsuites/sptests/Makefile.am
+++ b/testsuites/sptests/Makefile.am
@@ -1001,7 +1001,7 @@ sp_tests += spfatal14
 sp_screens += spfatal14/spfatal14.scn
 sp_docs += spfatal14/spfatal14.doc
 spfatal14_SOURCES = spfatal_support/init.c \
-	spfatal_support/consume_sems.c spfatal_support/system.h \
+	spfatal_support/system.h \
 	spfatal14/testcase.h
 spfatal14_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal14) \
 	$(support_includes) -I$(top_srcdir)/spfatal14
@@ -1012,24 +1012,12 @@ sp_tests += spfatal15
 sp_screens += spfatal15/spfatal15.scn
 sp_docs += spfatal15/spfatal15.doc
 spfatal15_SOURCES = spfatal_support/init.c \
-	spfatal_support/consume_sems.c spfatal_support/system.h \
+	spfatal_support/system.h \
 	spfatal15/testcase.h
 spfatal15_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal15) \
 	$(support_includes) -I$(top_srcdir)/spfatal15
 endif
 
-if TEST_spfatal16
-sp_tests += spfatal16
-sp_screens += spfatal16/spfatal16.scn
-sp_docs += spfatal16/spfatal16.doc
-spfatal16_SOURCES = spfatal_support/init.c \
-	spfatal_support/consume_sems.c spfatal_support/system.h \
-	spfatal16/testcase.h
-spfatal16_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal16) \
-	$(support_includes) -I$(top_srcdir)/spfatal16 \
-	-DSEMAPHORES_REMAINING=4
-endif
-
 if TEST_spfatal24
 sp_tests += spfatal24
 sp_screens += spfatal24/spfatal24.scn
diff --git a/testsuites/sptests/spfatal_support/consume_sems.c b/testsuites/sptests/spfatal_support/consume_sems.c
deleted file mode 100644
index 20fa1eeb1b..0000000000
--- a/testsuites/sptests/spfatal_support/consume_sems.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- *  COPYRIGHT (c) 1989-2012.
- *  On-Line Applications Research Corporation (OAR).
- *
- *  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 <rtems.h>
-
-/* forward declarations to avoid warnings */
-rtems_device_driver consume_semaphores_initialize(
-  rtems_device_major_number major RTEMS_UNUSED,
-  rtems_device_minor_number minor RTEMS_UNUSED,
-  void *pargp RTEMS_UNUSED
-);
-
-#define MAXIMUM 20
-rtems_id Semaphores[MAXIMUM];
-
-rtems_device_driver consume_semaphores_initialize(
-  rtems_device_major_number major RTEMS_UNUSED,
-  rtems_device_minor_number minor RTEMS_UNUSED,
-  void *pargp RTEMS_UNUSED
-)
-{
-  int               sems;
-  rtems_status_code status;
-
-  for ( sems=0 ; sems<MAXIMUM ; sems++ ) {
-    status = rtems_semaphore_create(
-      rtems_build_name( 'S', 'M', '1', ' ' ),
-      1,
-      RTEMS_DEFAULT_MODES,
-      RTEMS_NO_PRIORITY,
-      &Semaphores[sems]
-    );
-    if ( status == RTEMS_TOO_MANY )
-     break;
-  }
-
-  #if 0
-    printk( "Consumed %d\n", sems );
-    printk( "Freeing %d\n", SEMAPHORES_REMAINING );
-  #endif
-
-  #if defined(SEMAPHORES_REMAINING)
-  {
-    int i;
-
-    for ( i=0 ; i<SEMAPHORES_REMAINING ; i++ ) {
-      (void) rtems_semaphore_delete( Semaphores[i] );
-    }
-  }
-  #endif
-  return RTEMS_SUCCESSFUL;
-}
-
diff --git a/testsuites/sptests/spfatal_support/system.h b/testsuites/sptests/spfatal_support/system.h
index 1dc0d8b19b..c03b303c2b 100644
--- a/testsuites/sptests/spfatal_support/system.h
+++ b/testsuites/sptests/spfatal_support/system.h
@@ -40,17 +40,6 @@ void Put_Source( rtems_fatal_source source );
 
 void force_error(void);
 
-/* need some prototypes for test cases */
-
-rtems_device_driver consume_semaphores_initialize(
-  rtems_device_major_number major RTEMS_UNUSED,
-  rtems_device_minor_number minor RTEMS_UNUSED,
-  void *pargp RTEMS_UNUSED
-);
-
-#define CONSUME_SEMAPHORE_DRIVERS \
-  { consume_semaphores_initialize, NULL, NULL, NULL, NULL, NULL }
-
 #include "testcase.h"
 
 /* configuration information */
-- 
2.16.4



More information about the devel mailing list