blob: 5be104b0450d245f8fce2ad666155e9d019a24b3 [file] [log] [blame]
Antonio de Angelisa54ed7e2017-11-29 13:37:58 +00001/*
2 * Copyright (c) 2017, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#include <stdio.h>
9#include <cmsis_compiler.h>
10
11#ifndef __TFM_INTEG_TEST_H__
12#define __TFM_INTEG_TEST_H__
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18/* Avoids the semihosting issue */
19#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
20__asm(" .global __ARM_use_no_argv\n");
21#endif
22
23/**
24 * \brief Simple macro to mark UNUSED variables
25 *
26 */
27#define UNUSED_VARIABLE(X) ((void)(X))
28
29/**
30 * \brief Declarations for User defined SVC functions
31 * used in CORE_TEST_INTERACTIVE or
32 * CORE_TEST_POSITIVE
33 *
34 */
35void svc_secure_decrement_ns_lock_1(void);
36void svc_secure_decrement_ns_lock_2(void);
37
38#ifdef TEST_FRAMEWORK_NS
39/**
40 * \brief Main test application for the RTX-TFM core
41 * integration tests
42 *
43 */
44void test_app(void *argument);
45#endif /* TEST_FRAMEWORK_NS */
46
47/**
48 * \brief Execute the interactive test cases (button push)
49 *
50 */
51void execute_ns_interactive_tests(void);
52
53/**
54 * \brief Logging function
55 *
56 */
57__attribute__((always_inline)) __STATIC_INLINE void LOG_MSG(const char *MSG)
58{
59#ifndef LOG_MSG_HANDLER_MODE_PRINTF_ENABLED
60 /* if IPSR is non-zero, exception is active. NOT banked S/NS */
61 if (!__get_IPSR()) {
62 printf("\t\e[1;32m[Non-Sec] %s\e[0m\r\n", MSG);
63 }
64#else
65 printf("\t\e[1;32m[Non-Sec] %s\e[0m\r\n", MSG);
66#endif
67}
68
69#ifdef __cplusplus
70}
71#endif
72
73#endif /* __TFM_INTEG_TEST_H__ */