[rtems commit] score: Remove _Workspace_Allocate_or_fatal_error()

Sebastian Huber sebh at rtems.org
Fri Dec 13 09:10:24 UTC 2019


Module:    rtems
Branch:    master
Commit:    782113767f3e60389423c169f5c337ec3fb50feb
Changeset: http://git.rtems.org/rtems/commit/?id=782113767f3e60389423c169f5c337ec3fb50feb

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Dec 12 08:53:32 2019 +0100

score: Remove _Workspace_Allocate_or_fatal_error()

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(-)

diff --git a/cpukit/include/rtems/score/interr.h b/cpukit/include/rtems/score/interr.h
index 544ad7a..e57c415 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 41ea1d2..8428c9f 100644
--- a/cpukit/include/rtems/score/wkspace.h
+++ b/cpukit/include/rtems/score/wkspace.h
@@ -102,21 +102,6 @@ void _Workspace_Free(
 );
 
 /**
- * @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.
  *
  * @param string The pointer to a zero terminated string.
diff --git a/cpukit/score/src/wkspace.c b/cpukit/score/src/wkspace.c
index bafc0db..0834438 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 f127c2b..1b47cad 100644
--- a/testsuites/sptests/Makefile.am
+++ b/testsuites/sptests/Makefile.am
@@ -949,15 +949,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 d8816d8..e30f96d 100644
--- a/testsuites/sptests/configure.ac
+++ b/testsuites/sptests/configure.ac
@@ -142,7 +142,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 568bdf7..0000000
--- 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 2da0234..0000000
--- 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 b06e671..0000000
--- 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 ***



More information about the vc mailing list