TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
core_ns_interactive_testsuite.c File Reference
#include "core_ns_tests.h"
#include "tfm_api.h"
#include "cmsis_os2.h"
#include "tfm_nspm_api.h"
#include "tfm_veneers.h"
#include "core_test_api.h"
#include "core_test_defs.h"
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
Include dependency graph for core_ns_interactive_testsuite.c:

Go to the source code of this file.

Data Structures

struct  tfm_ns_lock_options
 TFM NS lock options. More...
 

Macros

#define TRY_SFN(fn,...)
 
#define LOG_MSG_THREAD(MSG_THREAD)
 

Enumerations

enum  test_type {
  TEST_TYPE_1 = 1, TEST_TYPE_2, TEST_TYPE_3, TEST_TYPE_4,
  TEST_TYPE_5, TEST_TYPE_6
}
 Test definition for the RTX - TFM integration tests scenarios. More...
 

Functions

void register_testsuite_ns_core_interactive (struct test_suite_t *p_test_suite)
 Register testsuite for the core interactive tests. More...
 
void secure_decrement_ns_lock_1 (void)
 secure_decrement_ns_lock_1 More...
 
void secure_decrement_ns_lock_2 (void)
 secure_decrement_ns_lock_2 More...
 

Macro Definition Documentation

#define LOG_MSG_THREAD (   MSG_THREAD)
Value:
do { \
sprintf(buffer,"%s [%s]", MSG_THREAD, osThreadGetName(osThreadGetId())); \
TEST_LOG(buffer); \
} \
while(0)
#define TEST_LOG(...)
#define TRY_SFN (   fn,
  ... 
)
Value:
do { \
enum tfm_status_e res = (enum tfm_status_e) fn(__VA_ARGS__); \
switch(res) { \
case TFM_SUCCESS: \
TEST_LOG("Secure call to " #fn "(" #__VA_ARGS__") successful!");\
break; \
TEST_LOG("Secure call to " #fn "(" #__VA_ARGS__") failed, " \
"S domain locked!");\
break; \
default: \
TEST_LOG("Secure call to " #fn "(" #__VA_ARGS__") failed, " \
"generic!");\
} \
} while(0)
tfm_status_e
Definition: tfm_api.h:45
#define TEST_LOG(...)

Definition at line 29 of file core_ns_interactive_testsuite.c.

Enumeration Type Documentation

enum test_type

Test definition for the RTX - TFM integration tests scenarios.

Enumerator
TEST_TYPE_1 

Sequential test: single task using the NS lock to access TFM

TEST_TYPE_2 

Priority test: high priority tries to preempt TFM, gets delayed

TEST_TYPE_3 

Priority inversion: classical scenario with high priority task waiting on lower priority task undefinitely if NS lock is configured without priority inheritance

TEST_TYPE_4 

non-NS lock: like sequential, but doesn't use any NS lock mechanism

TEST_TYPE_5 

non-NS lock, core locked: high priority tries to overcome the NS lock but finds TFM core locked by lower priority task and fails

TEST_TYPE_6 

Like TEST_TYPE_2, but the high priority task has now a timeout to acquire the NS lock. The timeout will expire only if TFM Core is built with the de-prioritization disabled

Definition at line 149 of file core_ns_interactive_testsuite.c.

Function Documentation

void register_testsuite_ns_core_interactive ( struct test_suite_t p_test_suite)

Register testsuite for the core interactive tests.

Parameters
[in]p_test_suiteThe test suite to be executed.

Definition at line 55 of file core_ns_interactive_testsuite.c.

Here is the call graph for this function:

void secure_decrement_ns_lock_1 ( void  )

secure_decrement_ns_lock_1

Definition at line 104 of file core_ns_interactive_testsuite.c.

void secure_decrement_ns_lock_2 ( void  )

secure_decrement_ns_lock_2

Definition at line 127 of file core_ns_interactive_testsuite.c.