aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdison Ai <edison.ai@arm.com>2019-06-21 13:52:49 +0800
committerKen Liu <ken.liu@arm.com>2019-07-19 10:14:51 +0000
commitcc4c6163f9d8d32371b323c5343a7dab7d42d457 (patch)
treea17cb5b22f89f393b9ea369071137529bce23599
parentb892dfe77a29a217ba76a8301b03dad458b230ba (diff)
downloadtrusted-firmware-m-cc4c6163f9d8d32371b323c5343a7dab7d42d457.tar.gz
Crypto: Use macros generated by tools
- Use the SID and service version defined in sid.h. - Use signal defined in tfm_crypto.h. - Remove manual definitions in tfm_crypto_defs.h. - Remove tfm_crypto_signal.h. Change-Id: I465fbd867e57d82ca61ad23054d019a9656faf77 Signed-off-by: Edison Ai <edison.ai@arm.com>
-rw-r--r--interface/include/tfm_crypto_defs.h7
-rw-r--r--interface/src/tfm_crypto_api.c5
-rw-r--r--secure_fw/services/crypto/crypto_init.c2
-rw-r--r--secure_fw/services/crypto/tfm_crypto_secure_api.c5
-rw-r--r--secure_fw/services/crypto/tfm_crypto_signal.h21
5 files changed, 9 insertions, 31 deletions
diff --git a/interface/include/tfm_crypto_defs.h b/interface/include/tfm_crypto_defs.h
index fed05b1d9..91af17593 100644
--- a/interface/include/tfm_crypto_defs.h
+++ b/interface/include/tfm_crypto_defs.h
@@ -105,13 +105,6 @@ enum {
};
/**
- * \brief Define the SID values and minor versions to match the ones defined in
- * the service manifest files
- */
-#define TFM_CRYPTO_SID (0x00000080u)
-#define TFM_CRYPTO_MIN_VER (0x0001)
-
-/**
* \brief Define an invalid value for an SID
*
*/
diff --git a/interface/src/tfm_crypto_api.c b/interface/src/tfm_crypto_api.c
index 19bc52ccd..152d785aa 100644
--- a/interface/src/tfm_crypto_api.c
+++ b/interface/src/tfm_crypto_api.c
@@ -9,6 +9,9 @@
#include "tfm_crypto_defs.h"
#include "psa/crypto.h"
#include "tfm_ns_lock.h"
+#ifdef TFM_PSA_API
+#include "psa_manifest/sid.h"
+#endif
#define ARRAY_SIZE(arr) (sizeof(arr)/sizeof(arr[0]))
@@ -21,7 +24,7 @@
#define PSA_CONNECT(service) \
psa_handle_t ipc_handle; \
- ipc_handle = psa_connect(service##_SID, service##_MIN_VER); \
+ ipc_handle = psa_connect(service##_SID, service##_VERSION); \
if (!PSA_IS_HANDLE_VALID(ipc_handle)) { \
return PSA_ERROR_GENERIC_ERROR; \
} \
diff --git a/secure_fw/services/crypto/crypto_init.c b/secure_fw/services/crypto/crypto_init.c
index 9e061b2bf..0ab89c56c 100644
--- a/secure_fw/services/crypto/crypto_init.c
+++ b/secure_fw/services/crypto/crypto_init.c
@@ -22,7 +22,7 @@
#ifdef TFM_PSA_API
#include "psa/service.h"
-#include "tfm_crypto_signal.h"
+#include "psa_manifest/tfm_crypto.h"
#include "secure_fw/core/tfm_memory_utils.h"
/**
diff --git a/secure_fw/services/crypto/tfm_crypto_secure_api.c b/secure_fw/services/crypto/tfm_crypto_secure_api.c
index 21a16e997..01be81058 100644
--- a/secure_fw/services/crypto/tfm_crypto_secure_api.c
+++ b/secure_fw/services/crypto/tfm_crypto_secure_api.c
@@ -8,6 +8,9 @@
#include "tfm_veneers.h"
#include "tfm_crypto_defs.h"
#include "psa/crypto.h"
+#ifdef TFM_PSA_API
+#include "psa_manifest/sid.h"
+#endif
#define ARRAY_SIZE(arr) (sizeof(arr)/sizeof(arr[0]))
@@ -20,7 +23,7 @@
#define PSA_CONNECT(service) \
psa_handle_t ipc_handle; \
- ipc_handle = psa_connect(service##_SID, service##_MIN_VER); \
+ ipc_handle = psa_connect(service##_SID, service##_VERSION); \
if (!PSA_IS_HANDLE_VALID(ipc_handle)) { \
return PSA_ERROR_GENERIC_ERROR; \
} \
diff --git a/secure_fw/services/crypto/tfm_crypto_signal.h b/secure_fw/services/crypto/tfm_crypto_signal.h
deleted file mode 100644
index e632a8ba2..000000000
--- a/secure_fw/services/crypto/tfm_crypto_signal.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-#ifndef __TFM_CRYPTO_SIGNAL_H__
-#define __TFM_CRYPTO_SIGNAL_H__
-
-#define TFM_IPC_SIG_RESERVED_POS (4U)
-
-#define TFM_CRYPTO_SIG_POS (TFM_IPC_SIG_RESERVED_POS+0U)
-
-/**
- * \brief Definitions for the signals available in the Crypto partition
- *
- */
-#define TFM_CRYPTO_SIG (1U << TFM_CRYPTO_SIG_POS)
-
-#endif /* __TFM_CRYPTO_SIGNAL_H__ */