summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-08-10 10:30:37 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-08-10 10:30:37 +0200
commitca3de01d2b5bac38e8bb24610398526322de03ba (patch)
tree7cbcc1787c64b6002b00ffa75bac4cf9ff76abe6
parentc983beffed4bd4d20ec459bb9a097ab25db7aa1b (diff)
FIXME coverage
-rw-r--r--cpukit/libtest/wrapcpufatalhalt.c54
-rw-r--r--cpukit/score/src/iodumpgcovinfo.c11
-rw-r--r--spec/build/cpukit/librtemstest.yml1
3 files changed, 55 insertions, 11 deletions
diff --git a/cpukit/libtest/wrapcpufatalhalt.c b/cpukit/libtest/wrapcpufatalhalt.c
new file mode 100644
index 0000000000..0b41dc0480
--- /dev/null
+++ b/cpukit/libtest/wrapcpufatalhalt.c
@@ -0,0 +1,54 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSTest
+ *
+ * @brief This source file contains the implementation of a wrapper for
+ * _CPU_Fatal_halt() which dumps the gcov information using
+ * _IO_Dump_gcov_info() before the real _CPU_Fatal_halt() is called.
+ */
+
+/*
+ * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/score/cpu.h>
+#include <rtems/score/io.h>
+#include <rtems/bspIo.h>
+
+void __real__CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
+
+void __wrap__CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
+
+void __wrap__CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
+{
+ _IO_Dump_gcov_info( rtems_put_char, NULL );
+ __real__CPU_Fatal_halt( source, error );
+}
diff --git a/cpukit/score/src/iodumpgcovinfo.c b/cpukit/score/src/iodumpgcovinfo.c
index 046f8ec10b..144c041edb 100644
--- a/cpukit/score/src/iodumpgcovinfo.c
+++ b/cpukit/score/src/iodumpgcovinfo.c
@@ -39,7 +39,6 @@
#include <rtems/score/io.h>
#include <rtems/score/interr.h>
-#include <rtems/bspIo.h>
#include <rtems/linkersets.h>
#include <gcov.h>
@@ -107,13 +106,3 @@ void _IO_Dump_gcov_info( IO_Put_char put_char, void *arg )
( *put_char )( '\n', arg );
}
}
-
-void __real__CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
-
-void __wrap__CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
-
-void __wrap__CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
-{
- _IO_Dump_gcov_info( rtems_put_char, NULL );
- __real__CPU_Fatal_halt( source, error );
-}
diff --git a/spec/build/cpukit/librtemstest.yml b/spec/build/cpukit/librtemstest.yml
index da768e439f..7f5eaabf93 100644
--- a/spec/build/cpukit/librtemstest.yml
+++ b/spec/build/cpukit/librtemstest.yml
@@ -35,6 +35,7 @@ source:
- cpukit/libtest/t-test-time.c
- cpukit/libtest/t-test.c
- cpukit/libtest/testbeginend.c
+- cpukit/libtest/wrapcpufatalhalt.c
- cpukit/score/src/iodumpgcovinfo.c
target: rtemstest
type: build