[PATCH 5/5] score: Remove _Workspace_Allocate_or_fatal_error()

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Dec 12 08:43:07 UTC 2019


This function is unused.

Update #3735.
---
 cpukit/include/rtems/score/interr.h        |  2 +-
 cpukit/include/rtems/score/wkspace.h       | 15 ---------------
 cpukit/score/src/wkspace.c                 | 23 ----------------------
 testsuites/sptests/Makefile.am             |  9 ---------
 testsuites/sptests/configure.ac            |  1 -
 testsuites/sptests/spfatal08/init.c        | 31 ------------------------------
 testsuites/sptests/spfatal08/spfatal08.doc | 20 -------------------
 testsuites/sptests/spfatal08/spfatal08.scn |  3 ---
 8 files changed, 1 insertion(+), 103 deletions(-)
 delete mode 100644 testsuites/sptests/spfatal08/init.c
 delete mode 100644 testsuites/sptests/spfatal08/spfatal08.doc
 delete mode 100644 testsuites/sptests/spfatal08/spfatal08.scn

diff --git a/cpukit/include/rtems/score/interr.h b/cpukit/include/rtems/score/interr.h
index 544ad7ab9e..e57c415eed 100644
--- a/cpukit/include/rtems/score/interr.h
+++ b/cpukit/include/rtems/score/interr.h
@@ -166,7 +166,7 @@ typedef enum {
   /* INTERNAL_ERROR_NO_CONFIGURATION_TABLE = 0, */
   /* INTERNAL_ERROR_NO_CPU_TABLE = 1, */
   INTERNAL_ERROR_TOO_LITTLE_WORKSPACE = 2,
-  INTERNAL_ERROR_WORKSPACE_ALLOCATION = 3,
+  /* INTERNAL_ERROR_WORKSPACE_ALLOCATION = 3, */
   /* INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL = 4, */
   INTERNAL_ERROR_THREAD_EXITTED = 5,
   INTERNAL_ERROR_INCONSISTENT_MP_INFORMATION = 6,
diff --git a/cpukit/include/rtems/score/wkspace.h b/cpukit/include/rtems/score/wkspace.h
index 41ea1d2e24..8428c9f957 100644
--- a/cpukit/include/rtems/score/wkspace.h
+++ b/cpukit/include/rtems/score/wkspace.h
@@ -101,21 +101,6 @@ void _Workspace_Free(
   void *block
 );
 
-/**
- * @brief Allocates workspace or fails with fatal error.
- *
- * This routine returns the address of a block of memory of @a size
- * bytes.  If a block of the appropriate size cannot be allocated
- * from the workspace, then the internal error handler is invoked.
- *
- * @param size is the desired number of bytes to allocate
- *
- * @return The starting address of the allocated memory.
- */
-void *_Workspace_Allocate_or_fatal_error(
-  size_t  size
-);
-
 /**
  * @brief Duplicates string with memory from the workspace.
  *
diff --git a/cpukit/score/src/wkspace.c b/cpukit/score/src/wkspace.c
index bafc0db6d5..0834438dd1 100644
--- a/cpukit/score/src/wkspace.c
+++ b/cpukit/score/src/wkspace.c
@@ -270,26 +270,3 @@ void _Workspace_Free(
   #endif
   _Heap_Free( &_Workspace_Area, block );
 }
-
-void *_Workspace_Allocate_or_fatal_error(
-  size_t      size
-)
-{
-  void *memory;
-
-  memory = _Heap_Allocate( &_Workspace_Area, size );
-  #if defined(DEBUG_WORKSPACE)
-    printk(
-      "Workspace_Allocate_or_fatal_error(%d) from %p/%p -> %p\n",
-      size,
-      __builtin_return_address( 0 ),
-      __builtin_return_address( 1 ),
-      memory
-    );
-  #endif
-
-  if ( memory == NULL )
-    _Internal_error( INTERNAL_ERROR_WORKSPACE_ALLOCATION );
-
-  return memory;
-}
diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
index 09751b6d58..1cb3adac41 100644
--- a/testsuites/sptests/Makefile.am
+++ b/testsuites/sptests/Makefile.am
@@ -940,15 +940,6 @@ spfatal06_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal06) \
 	$(support_includes)
 endif
 
-if TEST_spfatal08
-sp_tests += spfatal08
-sp_screens += spfatal08/spfatal08.scn
-sp_docs += spfatal08/spfatal08.doc
-spfatal08_SOURCES = spfatal08/init.c
-spfatal08_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal08) \
-	$(support_includes)
-endif
-
 if TEST_spfatal09
 sp_tests += spfatal09
 sp_screens += spfatal09/spfatal09.scn
diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac
index 467d2417f5..c1b0ec7df7 100644
--- a/testsuites/sptests/configure.ac
+++ b/testsuites/sptests/configure.ac
@@ -141,7 +141,6 @@ RTEMS_TEST_CHECK([spfatal03])
 RTEMS_TEST_CHECK([spfatal04])
 RTEMS_TEST_CHECK([spfatal05])
 RTEMS_TEST_CHECK([spfatal06])
-RTEMS_TEST_CHECK([spfatal08])
 RTEMS_TEST_CHECK([spfatal09])
 RTEMS_TEST_CHECK([spfatal10])
 RTEMS_TEST_CHECK([spfatal11])
diff --git a/testsuites/sptests/spfatal08/init.c b/testsuites/sptests/spfatal08/init.c
deleted file mode 100644
index 568bdf7dcb..0000000000
--- a/testsuites/sptests/spfatal08/init.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "../spfatal_support/spfatal.h"
-
-/*
- * Classic API Init task create failure
- *
- *  COPYRIGHT (c) 1989-2008.
- *  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.
- */
-
-#include <rtems/score/wkspace.h>
-
-#define FATAL_ERROR_TEST_NAME            "8"
-#define FATAL_ERROR_DESCRIPTION          "Core workspace too small"
-#define FATAL_ERROR_EXPECTED_SOURCE      INTERNAL_ERROR_CORE
-#define FATAL_ERROR_EXPECTED_ERROR       INTERNAL_ERROR_WORKSPACE_ALLOCATION
-
-static void force_error(void)
-{
-  _Workspace_Allocate_or_fatal_error( SIZE_MAX );
-  /* we will not run this far */
-}
-
-#include "../spfatal_support/spfatalimpl.h"
diff --git a/testsuites/sptests/spfatal08/spfatal08.doc b/testsuites/sptests/spfatal08/spfatal08.doc
deleted file mode 100644
index 2da0234005..0000000000
--- a/testsuites/sptests/spfatal08/spfatal08.doc
+++ /dev/null
@@ -1,20 +0,0 @@
-#  COPYRIGHT (c) 1989-2009.
-#  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.
-#
-
-This file describes the directives and concepts tested by this test set.
-
-test set name:  spfatal08
-
-directives:
-
-  None specifically
-
-concepts:
-
-+ Ensure that the error condition when the workspace provided is too small
-  is properly treated as a fatal error.
diff --git a/testsuites/sptests/spfatal08/spfatal08.scn b/testsuites/sptests/spfatal08/spfatal08.scn
deleted file mode 100644
index b06e671f5a..0000000000
--- a/testsuites/sptests/spfatal08/spfatal08.scn
+++ /dev/null
@@ -1,3 +0,0 @@
-*** TEST FATAL 8 ***
-Fatal error (Core workspace too small) hit
-*** END OF TEST FATAL 8 ***
-- 
2.16.4



More information about the devel mailing list