blob: 236e9ef2d8a6911387024561bc1ac427652d5ade [file] [log] [blame]
Antonio de Angelisa54ed7e2017-11-29 13:37:58 +00001/*
Mingyang Sune5da4ad2019-12-19 15:15:48 +08002 * Copyright (c) 2017-2019, Arm Limited. All rights reserved.
Antonio de Angelisa54ed7e2017-11-29 13:37:58 +00003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#include <stdio.h>
9#include <cmsis_compiler.h>
Mingyang Sune5da4ad2019-12-19 15:15:48 +080010#include "log/tfm_log_raw.h"
Antonio de Angelisa54ed7e2017-11-29 13:37:58 +000011
12#ifndef __TFM_INTEG_TEST_H__
13#define __TFM_INTEG_TEST_H__
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19/* Avoids the semihosting issue */
20#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
21__asm(" .global __ARM_use_no_argv\n");
22#endif
23
24/**
25 * \brief Simple macro to mark UNUSED variables
26 *
27 */
28#define UNUSED_VARIABLE(X) ((void)(X))
29
Antonio de Angelisa54ed7e2017-11-29 13:37:58 +000030#ifdef TEST_FRAMEWORK_NS
31/**
32 * \brief Main test application for the RTX-TFM core
33 * integration tests
34 *
35 */
36void test_app(void *argument);
37#endif /* TEST_FRAMEWORK_NS */
38
39/**
40 * \brief Execute the interactive test cases (button push)
41 *
42 */
43void execute_ns_interactive_tests(void);
44
45/**
46 * \brief Logging function
47 *
48 */
49__attribute__((always_inline)) __STATIC_INLINE void LOG_MSG(const char *MSG)
50{
Antonio de Angelisa54ed7e2017-11-29 13:37:58 +000051 /* if IPSR is non-zero, exception is active. NOT banked S/NS */
52 if (!__get_IPSR()) {
Mingyang Sune5da4ad2019-12-19 15:15:48 +080053 tfm_log_printf("\t\033[1;32m[Non-Sec] %s\033[0m\r\n", MSG);
Antonio de Angelisa54ed7e2017-11-29 13:37:58 +000054 }
Antonio de Angelisa54ed7e2017-11-29 13:37:58 +000055}
56
57#ifdef __cplusplus
58}
59#endif
60
61#endif /* __TFM_INTEG_TEST_H__ */