App: Minor fix of include header file
Refine the header files included in main_ns.c
- tfm_integ_test.h is included in main_ns.c when NS or Secure test is
enabled.
- test_framework_integ_test.h is removed from main_ns.c.
Simplfy build system accordingly.
Signed-off-by: David Hu <david.hu@arm.com>
Change-Id: I7a4c09ee149aae1381c1730622f8ae4ab9bc1508
diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
index db7b26a..2413e47 100644
--- a/app/CMakeLists.txt
+++ b/app/CMakeLists.txt
@@ -213,13 +213,10 @@
)
target_link_libraries(tfm_ns_integration_test
- PUBLIC
- $<$<BOOL:${TEST_FRAMEWORK_NS}>:tfm_ns_tests>
- tfm_test_framework_ns
PRIVATE
- tfm_ns_interface
- tfm_api_ns
- CMSIS_5_tfm_ns
+ $<$<BOOL:${TEST_FRAMEWORK_NS}>:tfm_ns_tests>
+ $<$<BOOL:${TEST_FRAMEWORK_S}>:tfm_ns_interface>
+ $<$<BOOL:${TEST_FRAMEWORK_S}>:tfm_api_ns>
)
target_compile_definitions(tfm_ns_integration_test
diff --git a/app/main_ns.c b/app/main_ns.c
index aaaead9..f4fe3dd 100644
--- a/app/main_ns.c
+++ b/app/main_ns.c
@@ -7,11 +7,10 @@
#include "tfm_api.h"
#include "cmsis_os2.h"
-#include "tfm_integ_test.h"
#include "tfm_ns_svc.h"
#include "tfm_ns_interface.h"
#if defined(TEST_FRAMEWORK_NS) || defined(TEST_FRAMEWORK_S)
-#include "test_framework_integ_test.h"
+#include "tfm_integ_test.h"
#endif
#ifdef PSA_API_TEST_NS
#include "psa_api_test.h"
@@ -32,12 +31,20 @@
* \details RTX has a weak definition of osRtxUserSVC, which
* is overridden here
*/
-#if (defined(__ARMCC_VERSION) && (__ARMCC_VERSION == 6110004))
+#if defined(__ARMCC_VERSION)
+#if (__ARMCC_VERSION == 6110004)
/* Workaround needed for a bug in Armclang 6.11, more details at:
* http://www.keil.com/support/docs/4089.htm
*/
__attribute__((section(".gnu.linkonce")))
#endif
+
+/* Avoids the semihosting issue */
+#if (__ARMCC_VERSION >= 6010050)
+__asm(" .global __ARM_use_no_argv\n");
+#endif
+#endif
+
extern void * const osRtxUserSVC[1+USER_SVC_COUNT];
void * const osRtxUserSVC[1+USER_SVC_COUNT] = {
(void *)USER_SVC_COUNT,
diff --git a/app/tfm_integ_test.h b/app/tfm_integ_test.h
index f65f4f1..f793ced 100644
--- a/app/tfm_integ_test.h
+++ b/app/tfm_integ_test.h
@@ -1,13 +1,10 @@
/*
- * Copyright (c) 2017-2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2017-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/
-#include <stdio.h>
-#include "cmsis_compiler.h"
-
#ifndef __TFM_INTEG_TEST_H__
#define __TFM_INTEG_TEST_H__
@@ -15,11 +12,6 @@
extern "C" {
#endif
-/* Avoids the semihosting issue */
-#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
-__asm(" .global __ARM_use_no_argv\n");
-#endif
-
/**
* \brief Simple macro to mark UNUSED variables
*