From 34895a05adf5854938ee8001b7a84e9b96d51a37 Mon Sep 17 00:00:00 2001 From: Oren Cohen Date: Fri, 25 Jan 2019 17:32:36 +0200 Subject: [PATCH] CR fixes --- .../psa_test_its_reset_partition.c | 3 --- .../psa_test_its_reset_partition.c | 3 --- .../psa_client_tests_part1_partition.c | 3 --- .../psa_server_test_part1_partition.c | 3 --- .../psa_server_test_part2_partition.c | 3 --- TESTS/psa/spm_server/COMPONENT_SPE/server_tests.h | 2 +- TESTS/psa/spm_server/server_tests.h | 2 +- .../psa_smoke_test_part1_partition.c | 3 --- .../TARGET_MBED_SPM/psa_crypto_srv_partition.c | 3 --- .../TARGET_MBED_SPM/psa_its_partition.c | 3 --- rtos/TARGET_CORTEX/mbed_rtos_rtx.c | 15 +++++++++------ .../TARGET_MBED_SPM/psa_NAME_partition.c.tpl | 3 --- 12 files changed, 11 insertions(+), 35 deletions(-) diff --git a/TESTS/psa/entropy_inject/its_reset/COMPONENT_SPE/TARGET_MBED_SPM/psa_test_its_reset_partition.c b/TESTS/psa/entropy_inject/its_reset/COMPONENT_SPE/TARGET_MBED_SPM/psa_test_its_reset_partition.c index 7710b2e8ce..7ef3168f0d 100644 --- a/TESTS/psa/entropy_inject/its_reset/COMPONENT_SPE/TARGET_MBED_SPM/psa_test_its_reset_partition.c +++ b/TESTS/psa/entropy_inject/its_reset/COMPONENT_SPE/TARGET_MBED_SPM/psa_test_its_reset_partition.c @@ -23,8 +23,6 @@ * Generated by tools/spm/generate_partition_code.py Version 1.0 **********************************************************************************************************************/ -#if !defined(TARGET_TFM) - #include "cmsis.h" #include "mbed_toolchain.h" /* For using MBED_ALIGN macro */ #include "rtx_os.h" @@ -102,4 +100,3 @@ void test_its_reset_init(spm_partition_t *partition) } } -#endif // !defined(TARGET_TFM) diff --git a/TESTS/psa/prot_internal_storage/its_reset/COMPONENT_SPE/TARGET_MBED_SPM/psa_test_its_reset_partition.c b/TESTS/psa/prot_internal_storage/its_reset/COMPONENT_SPE/TARGET_MBED_SPM/psa_test_its_reset_partition.c index 7710b2e8ce..7ef3168f0d 100644 --- a/TESTS/psa/prot_internal_storage/its_reset/COMPONENT_SPE/TARGET_MBED_SPM/psa_test_its_reset_partition.c +++ b/TESTS/psa/prot_internal_storage/its_reset/COMPONENT_SPE/TARGET_MBED_SPM/psa_test_its_reset_partition.c @@ -23,8 +23,6 @@ * Generated by tools/spm/generate_partition_code.py Version 1.0 **********************************************************************************************************************/ -#if !defined(TARGET_TFM) - #include "cmsis.h" #include "mbed_toolchain.h" /* For using MBED_ALIGN macro */ #include "rtx_os.h" @@ -102,4 +100,3 @@ void test_its_reset_init(spm_partition_t *partition) } } -#endif // !defined(TARGET_TFM) diff --git a/TESTS/psa/spm_client/COMPONENT_SPE/TARGET_MBED_SPM/psa_client_tests_part1_partition.c b/TESTS/psa/spm_client/COMPONENT_SPE/TARGET_MBED_SPM/psa_client_tests_part1_partition.c index fb87681fb4..895071bf3f 100644 --- a/TESTS/psa/spm_client/COMPONENT_SPE/TARGET_MBED_SPM/psa_client_tests_part1_partition.c +++ b/TESTS/psa/spm_client/COMPONENT_SPE/TARGET_MBED_SPM/psa_client_tests_part1_partition.c @@ -23,8 +23,6 @@ * Generated by tools/spm/generate_partition_code.py Version 1.0 **********************************************************************************************************************/ -#if !defined(TARGET_TFM) - #include "cmsis.h" #include "mbed_toolchain.h" /* For using MBED_ALIGN macro */ #include "rtx_os.h" @@ -126,4 +124,3 @@ void client_tests_part1_init(spm_partition_t *partition) } } -#endif // !defined(TARGET_TFM) diff --git a/TESTS/psa/spm_server/COMPONENT_SPE/TARGET_MBED_SPM/psa_server_test_part1_partition.c b/TESTS/psa/spm_server/COMPONENT_SPE/TARGET_MBED_SPM/psa_server_test_part1_partition.c index 9d3d1e63ea..04eebdb5dc 100644 --- a/TESTS/psa/spm_server/COMPONENT_SPE/TARGET_MBED_SPM/psa_server_test_part1_partition.c +++ b/TESTS/psa/spm_server/COMPONENT_SPE/TARGET_MBED_SPM/psa_server_test_part1_partition.c @@ -23,8 +23,6 @@ * Generated by tools/spm/generate_partition_code.py Version 1.0 **********************************************************************************************************************/ -#if !defined(TARGET_TFM) - #include "cmsis.h" #include "mbed_toolchain.h" /* For using MBED_ALIGN macro */ #include "rtx_os.h" @@ -120,4 +118,3 @@ void server_test_part1_init(spm_partition_t *partition) } } -#endif // !defined(TARGET_TFM) diff --git a/TESTS/psa/spm_server/COMPONENT_SPE/TARGET_MBED_SPM/psa_server_test_part2_partition.c b/TESTS/psa/spm_server/COMPONENT_SPE/TARGET_MBED_SPM/psa_server_test_part2_partition.c index 992394745a..256c72cba8 100644 --- a/TESTS/psa/spm_server/COMPONENT_SPE/TARGET_MBED_SPM/psa_server_test_part2_partition.c +++ b/TESTS/psa/spm_server/COMPONENT_SPE/TARGET_MBED_SPM/psa_server_test_part2_partition.c @@ -23,8 +23,6 @@ * Generated by tools/spm/generate_partition_code.py Version 1.0 **********************************************************************************************************************/ -#if !defined(TARGET_TFM) - #include "cmsis.h" #include "mbed_toolchain.h" /* For using MBED_ALIGN macro */ #include "rtx_os.h" @@ -114,4 +112,3 @@ void server_test_part2_init(spm_partition_t *partition) } } -#endif // !defined(TARGET_TFM) diff --git a/TESTS/psa/spm_server/COMPONENT_SPE/server_tests.h b/TESTS/psa/spm_server/COMPONENT_SPE/server_tests.h index 1964ab3a55..437f10609e 100644 --- a/TESTS/psa/spm_server/COMPONENT_SPE/server_tests.h +++ b/TESTS/psa/spm_server/COMPONENT_SPE/server_tests.h @@ -34,7 +34,7 @@ typedef psa_status_t (*psa_test_server_side_func)(psa_status_t *); #define PSA_TEST_SERVER_NAME(name) psa_test_server_side_ ## name #define PSA_TEST_CLIENT(name) void PSA_TEST_CLIENT_NAME(name) (void) -#define PSA_TEST_SERVER(name) psa_status_t PSA_TEST_SERVER_NAME(name) (psa_status_t* status_ptr) +#define PSA_TEST_SERVER(name) psa_status_t PSA_TEST_SERVER_NAME(name) (psa_status_t *status_ptr) #define PSA_TEST(name) \ PSA_TEST_CLIENT(name); \ diff --git a/TESTS/psa/spm_server/server_tests.h b/TESTS/psa/spm_server/server_tests.h index 1964ab3a55..437f10609e 100644 --- a/TESTS/psa/spm_server/server_tests.h +++ b/TESTS/psa/spm_server/server_tests.h @@ -34,7 +34,7 @@ typedef psa_status_t (*psa_test_server_side_func)(psa_status_t *); #define PSA_TEST_SERVER_NAME(name) psa_test_server_side_ ## name #define PSA_TEST_CLIENT(name) void PSA_TEST_CLIENT_NAME(name) (void) -#define PSA_TEST_SERVER(name) psa_status_t PSA_TEST_SERVER_NAME(name) (psa_status_t* status_ptr) +#define PSA_TEST_SERVER(name) psa_status_t PSA_TEST_SERVER_NAME(name) (psa_status_t *status_ptr) #define PSA_TEST(name) \ PSA_TEST_CLIENT(name); \ diff --git a/TESTS/psa/spm_smoke/COMPONENT_SPE/TARGET_MBED_SPM/psa_smoke_test_part1_partition.c b/TESTS/psa/spm_smoke/COMPONENT_SPE/TARGET_MBED_SPM/psa_smoke_test_part1_partition.c index b4e0617201..d59eedae57 100644 --- a/TESTS/psa/spm_smoke/COMPONENT_SPE/TARGET_MBED_SPM/psa_smoke_test_part1_partition.c +++ b/TESTS/psa/spm_smoke/COMPONENT_SPE/TARGET_MBED_SPM/psa_smoke_test_part1_partition.c @@ -23,8 +23,6 @@ * Generated by tools/spm/generate_partition_code.py Version 1.0 **********************************************************************************************************************/ -#if !defined(TARGET_TFM) - #include "cmsis.h" #include "mbed_toolchain.h" /* For using MBED_ALIGN macro */ #include "rtx_os.h" @@ -102,4 +100,3 @@ void smoke_test_part1_init(spm_partition_t *partition) } } -#endif // !defined(TARGET_TFM) diff --git a/components/TARGET_PSA/services/crypto/COMPONENT_SPE/TARGET_MBED_SPM/psa_crypto_srv_partition.c b/components/TARGET_PSA/services/crypto/COMPONENT_SPE/TARGET_MBED_SPM/psa_crypto_srv_partition.c index 4e388950b6..86b5e88e61 100644 --- a/components/TARGET_PSA/services/crypto/COMPONENT_SPE/TARGET_MBED_SPM/psa_crypto_srv_partition.c +++ b/components/TARGET_PSA/services/crypto/COMPONENT_SPE/TARGET_MBED_SPM/psa_crypto_srv_partition.c @@ -23,8 +23,6 @@ * Generated by tools/spm/generate_partition_code.py Version 1.0 **********************************************************************************************************************/ -#if !defined(TARGET_TFM) - #include "cmsis.h" #include "mbed_toolchain.h" /* For using MBED_ALIGN macro */ #include "rtx_os.h" @@ -230,4 +228,3 @@ void crypto_srv_init(spm_partition_t *partition) } } -#endif // !defined(TARGET_TFM) diff --git a/components/TARGET_PSA/services/psa_prot_internal_storage/COMPONENT_SPE/TARGET_MBED_SPM/psa_its_partition.c b/components/TARGET_PSA/services/psa_prot_internal_storage/COMPONENT_SPE/TARGET_MBED_SPM/psa_its_partition.c index 1f0a76703d..2f829941ad 100644 --- a/components/TARGET_PSA/services/psa_prot_internal_storage/COMPONENT_SPE/TARGET_MBED_SPM/psa_its_partition.c +++ b/components/TARGET_PSA/services/psa_prot_internal_storage/COMPONENT_SPE/TARGET_MBED_SPM/psa_its_partition.c @@ -23,8 +23,6 @@ * Generated by tools/spm/generate_partition_code.py Version 1.0 **********************************************************************************************************************/ -#if !defined(TARGET_TFM) - #include "cmsis.h" #include "mbed_toolchain.h" /* For using MBED_ALIGN macro */ #include "rtx_os.h" @@ -138,4 +136,3 @@ void its_init(spm_partition_t *partition) } } -#endif // !defined(TARGET_TFM) diff --git a/rtos/TARGET_CORTEX/mbed_rtos_rtx.c b/rtos/TARGET_CORTEX/mbed_rtos_rtx.c index af8e528333..9172dfe62c 100644 --- a/rtos/TARGET_CORTEX/mbed_rtos_rtx.c +++ b/rtos/TARGET_CORTEX/mbed_rtos_rtx.c @@ -24,12 +24,11 @@ #include "mbed_critical.h" #include "mbed_boot.h" -#if defined(TARGET_PSA) && defined(TARGET_MBED_SPM) +#if defined(TARGET_MBED_SPM) #include "spm_init.h" #include "spm_api.h" #endif - #if defined(COMPONENT_NSPE) && defined(COMPONENT_SPM_MAILBOX) MBED_ALIGN(8) char psa_spm_dispatcher_th_stack[0x100]; @@ -85,18 +84,22 @@ MBED_NORETURN void mbed_rtos_start() spm_ipc_mailbox_init(); #endif // defined(COMPONENT_SPM_MAILBOX) -#if defined(COMPONENT_SPE) && defined(TARGET_MBED_SPM) +#if defined(TARGET_MBED_SPM) + +#if defined(COMPONENT_SPE) // At this point, the mailbox is already initialized spm_hal_start_nspe(); psa_spm_init(); -#endif // defined(COMPONENT_SPE) && defined(TARGET_MBED_SPM) +#endif // defined(COMPONENT_SPE) -#if defined(COMPONENT_NSPE) && defined(COMPONENT_SPM_MAILBOX) && defined(TARGET_MBED_SPM) +#if defined(COMPONENT_NSPE) && defined(COMPONENT_SPM_MAILBOX) osThreadId_t spm_result = osThreadNew((osThreadFunc_t)psa_spm_mailbox_dispatcher, NULL, &psa_spm_dispatcher_th_attr); if ((void *)spm_result == NULL) { MBED_ERROR1(MBED_MAKE_ERROR(MBED_MODULE_PLATFORM, MBED_ERROR_CODE_INITIALIZATION_FAILED), "Dispatcher thread not created", &psa_spm_dispatcher_th_attr); } -#endif // defined(COMPONENT_NSPE) && defined(COMPONENT_SPM_MAILBOX) && defined(TARGET_MBED_SPM) +#endif // defined(COMPONENT_NSPE) && defined(COMPONENT_SPM_MAILBOX) + +#endif // defined(TARGET_MBED_SPM) singleton_mutex_id = osMutexNew(&singleton_mutex_attr); osThreadId_t result = osThreadNew((osThreadFunc_t)mbed_start, NULL, &_main_thread_attr); diff --git a/tools/spm/templates/COMPONENT_SPE/TARGET_MBED_SPM/psa_NAME_partition.c.tpl b/tools/spm/templates/COMPONENT_SPE/TARGET_MBED_SPM/psa_NAME_partition.c.tpl index f42826a096..19fc22cc1d 100644 --- a/tools/spm/templates/COMPONENT_SPE/TARGET_MBED_SPM/psa_NAME_partition.c.tpl +++ b/tools/spm/templates/COMPONENT_SPE/TARGET_MBED_SPM/psa_NAME_partition.c.tpl @@ -23,8 +23,6 @@ * Generated by tools/spm/generate_partition_code.py Version {{script_ver}} **********************************************************************************************************************/ -#if !defined(TARGET_TFM) - #include "cmsis.h" #include "mbed_toolchain.h" /* For using MBED_ALIGN macro */ #include "rtx_os.h" @@ -146,5 +144,4 @@ void {{partition.name|lower}}_init(spm_partition_t *partition) } } -#endif // !defined(TARGET_TFM) {# End of file #}