aboutsummaryrefslogtreecommitdiff
path: root/interface
diff options
context:
space:
mode:
Diffstat (limited to 'interface')
-rw-r--r--interface/include/tfm_ns_svc.h68
-rw-r--r--interface/include/tfm_nspm_api.h28
-rw-r--r--interface/include/tfm_nspm_svc_handler.h30
-rw-r--r--interface/src/multi_core/tfm_ns_mailbox_test.c78
-rw-r--r--interface/src/tfm_nspm_api.c82
-rw-r--r--interface/src/tfm_nspm_svc_handler.c20
6 files changed, 0 insertions, 306 deletions
diff --git a/interface/include/tfm_ns_svc.h b/interface/include/tfm_ns_svc.h
deleted file mode 100644
index def0c2f7ee..0000000000
--- a/interface/include/tfm_ns_svc.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2017-2019, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-#include <stdio.h>
-#include "cmsis_compiler.h"
-
-#ifndef __TFM_NS_SVC_H__
-#define __TFM_NS_SVC_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * \brief Include all the SVC handler headers
- */
-#include "tfm_nspm_svc_handler.h"
-
-/**
- * \brief Macro to encode an svc instruction
- *
- */
-#define SVC(code) __ASM volatile("svc %0" : : "I" (code))
-
-/**
- * \def LIST_SVC_NSPM
- *
- * \brief This is an X macro which lists
- * the SVC interface exposed by TF-M
- * for the NS OS.
- *
- */
-#define LIST_SVC_NSPM \
- X(SVC_TFM_NSPM_REGISTER_CLIENT_ID, tfm_nspm_svc_register_client_id) \
-
-/**
- * \brief Numbers associated to each SVC available
- *
- * \details Start from 1 as 0 is reserved by RTX
- */
-enum tfm_svc_num {
- SVC_INVALID = 0,
-
-#define X(SVC_ENUM, SVC_HANDLER) SVC_ENUM,
-
- /* SVC API for Services */
-#ifdef TFM_NS_CLIENT_IDENTIFICATION
- LIST_SVC_NSPM
-#endif
-
-#undef X
-
- /* add all the new entries above this line */
- SVC_TFM_MAX,
-};
-
-/* number of user SVC functions */
-#define USER_SVC_COUNT ((uint32_t)SVC_TFM_MAX - 1)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TFM_NS_SVC_H__ */
diff --git a/interface/include/tfm_nspm_api.h b/interface/include/tfm_nspm_api.h
deleted file mode 100644
index 5f03845bcd..0000000000
--- a/interface/include/tfm_nspm_api.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2018, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-#ifndef __TFM_NSPM_API_H__
-#define __TFM_NSPM_API_H__
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * \brief Reports the client ID of this task to TF-M
- *
- * \return Returns 1 if the client ID was successfully reported 0 otherwise
- */
-uint32_t tfm_nspm_register_client_id(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TFM_NSPM_API_H__ */
diff --git a/interface/include/tfm_nspm_svc_handler.h b/interface/include/tfm_nspm_svc_handler.h
deleted file mode 100644
index 73f75a95e1..0000000000
--- a/interface/include/tfm_nspm_svc_handler.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2018, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-#ifndef __TFM_NSPM_SVC_HANDLER_H__
-#define __TFM_NSPM_SVC_HANDLER_H__
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * \brief Reports the client ID of this task to TF-M (SVC function)
- *
- * \param [in] client_id Client ID to register.
- *
- * \return Returns 1 if the client ID was successfully reported 0 otherwise
- */
-uint32_t tfm_nspm_svc_register_client_id(uint32_t client_id);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TFM_NSPM_SVC_HANDLER_H__ */
diff --git a/interface/src/multi_core/tfm_ns_mailbox_test.c b/interface/src/multi_core/tfm_ns_mailbox_test.c
deleted file mode 100644
index e12cdc9567..0000000000
--- a/interface/src/multi_core/tfm_ns_mailbox_test.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2020-2021, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-#include "tfm_ns_mailbox.h"
-
-static struct ns_mailbox_queue_t *stats_queue_ptr = NULL;
-
-void tfm_ns_mailbox_tx_stats_init(struct ns_mailbox_queue_t *ns_queue)
-{
- if (!ns_queue) {
- return;
- }
-
- ns_queue->nr_tx = 0;
- ns_queue->nr_used_slots = 0;
-
- stats_queue_ptr = ns_queue;
-}
-
-int32_t tfm_ns_mailbox_tx_stats_reinit(void)
-{
- if (!stats_queue_ptr) {
- return MAILBOX_INVAL_PARAMS;
- }
-
- stats_queue_ptr->nr_tx = 0;
- stats_queue_ptr->nr_used_slots = 0;
-
- return MAILBOX_SUCCESS;
-}
-
-void tfm_ns_mailbox_tx_stats_update(void)
-{
- mailbox_queue_status_t empty_status;
- uint8_t idx, nr_empty = 0;
-
- if (!stats_queue_ptr) {
- return;
- }
-
- ns_mailbox_spin_lock();
- /* Count the number of used slots when this tx arrives */
- empty_status = stats_queue_ptr->empty_slots;
- ns_mailbox_spin_unlock();
-
- if (empty_status) {
- for (idx = 0; idx < NUM_MAILBOX_QUEUE_SLOT; idx++) {
- if (empty_status & (0x1UL << idx)) {
- nr_empty++;
- }
- }
- }
-
- ns_mailbox_spin_lock();
- stats_queue_ptr->nr_used_slots += (NUM_MAILBOX_QUEUE_SLOT - nr_empty);
- stats_queue_ptr->nr_tx++;
- ns_mailbox_spin_unlock();
-}
-
-void tfm_ns_mailbox_stats_avg_slot(struct ns_mailbox_stats_res_t *stats_res)
-{
- uint32_t nr_used_slots, nr_tx;
-
- if (!stats_queue_ptr || !stats_res) {
- return;
- }
-
- nr_used_slots = stats_queue_ptr->nr_used_slots;
- nr_tx = stats_queue_ptr->nr_tx;
-
- stats_res->avg_nr_slots = nr_used_slots / nr_tx;
- nr_used_slots %= nr_tx;
- stats_res->avg_nr_slots_tenths = nr_used_slots * 10 / nr_tx;
-}
diff --git a/interface/src/tfm_nspm_api.c b/interface/src/tfm_nspm_api.c
deleted file mode 100644
index a540e8ca3d..0000000000
--- a/interface/src/tfm_nspm_api.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-#include "tfm_nspm_api.h"
-
-#include <string.h>
-#include <stdint.h>
-
-#include "cmsis_os2.h"
-#include "tfm_ns_svc.h"
-
-/* Translation table pair between OS threads and client IDs */
-struct thread_test_clientid_pair {
- const char* t_name; /*!< Task/Thread name */
- int32_t client_id; /*!< Client ID used in assets definition */
-};
-
-static struct thread_test_clientid_pair test_ns_policy_table[] =
-{
- {"Thread_A", -1},
- {"Thread_B", -2},
- {"Thread_C", -3},
- {"Thread_D", -4},
- {"seq_task", -5},
- {"mid_task", -6},
- {"pri_task", -7},
-#ifdef PSA_API_TEST_NS
- {"psa_api_test", -8}
-#endif
-};
-
-/**
- * \brief Gets the client ID based on the thread name
- *
- * \return If the thread name is in the test_ns_policy_table, it returns the
- * client ID. Otherwise, it returns 0 as an error code.
- */
-static uint32_t get_client_id(void)
-{
- uint32_t i;
- static uint32_t test_table_size = (sizeof(test_ns_policy_table) /
- sizeof(test_ns_policy_table[0]));
- const char* p_thread_name;
- osThreadId_t thread_id;
-
- /* Get thread name */
- thread_id = osThreadGetId();
- p_thread_name = osThreadGetName(thread_id);
-
- for (i = 0; i < test_table_size; i++) {
- if (strcmp(test_ns_policy_table[i].t_name, p_thread_name) == 0) {
- return test_ns_policy_table[i].client_id;
- }
- }
-
- return 0;
-}
-
-__attribute__ ((naked))
-static uint32_t tfm_nspm_svc_register_client(uint32_t client_id)
-{
- SVC(SVC_TFM_NSPM_REGISTER_CLIENT_ID);
- __ASM volatile("BX LR");
-}
-
-uint32_t tfm_nspm_register_client_id(void)
-{
- uint32_t client_id;
-
- client_id = get_client_id();
- if (client_id == 0) {
- return 0;
- }
-
- return tfm_nspm_svc_register_client(client_id);
-}
-
-
diff --git a/interface/src/tfm_nspm_svc_handler.c b/interface/src/tfm_nspm_svc_handler.c
deleted file mode 100644
index 3ec2cb03d2..0000000000
--- a/interface/src/tfm_nspm_svc_handler.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (c) 2018, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-#include "tfm_nspm_svc_handler.h"
-#include "tfm_api.h"
-#include "tfm_ns_svc.h"
-
-/* SVC function implementations */
-uint32_t tfm_nspm_svc_register_client_id(uint32_t client_id)
-{
- if (tfm_register_client_id(client_id) == TFM_SUCCESS) {
- return 1;
- }
-
- return 0;
-}